I'm trying to use the Python Shopify API (specifically to automatically upload products). I'm following the guide on the GitHub repo (see previous link). The problem is it doesn't really explain how I get the "params" dict (see "TODO" in code below).
import shopify
# Create Shopify session.
API_KEY = 'somekeyhere123'
PASSWORD = 'somepasswordhere123456'
shop_url = "https://%s:%s@SHOP_NAME.myshopify.com/admin" % (API_KEY, PASSWORD)
shopify.ShopifyResource.set_site(shop_url)
session = shopify.Session("SHOP_NAME.myshopify.com")
scope = ["write_products"]
permission_url = session.create_permission_url(scope)
# TODO: params = dict(...).
token = session.request_token(params)
session = shopify.Session("SHOP_NAME.myshopify.com", token)
shopify.ShopifyResource.activate_session(session)
Is anyone able to shed some light on the matter?
Aucun commentaire:
Enregistrer un commentaire