ChrisC
ChrisC

Reputation: 916

How can I use the Shopify python api adapter to pull assets?

Shopify Python API on Github

I am able to get this far and pull in a list of all of the assets, but can't figure out how to actually pull them down from here. Any ideas?

SHOP_NAME = "SHOP-NAME"
API_PASSWORD = "API-PASSWORD"
session = shopify.Session(SHOP_NAME)
session.token = API_PASSWORD
shopify.ShopifyResource.activate_session(session)

assets = shopify.Asset.find()

Upvotes: 1

Views: 372

Answers (1)

Dylan Smith
Dylan Smith

Reputation: 1522

shopify.Asset.find() is using the list endpoint which doesn't include the asset value, and it sounds like that is what you are after.

If you use the receive a single Asset endpoint, then you can also get the assets value.

asset = shopify.Asset.find(assets[0].key, theme_id=assets[0].theme_id)
print asset.value

Upvotes: 2

Related Questions