Issue
I have to make this call with Standard shopify API (python)
https://store.myshopify.com/admin/shop.json
what i am getting is :
ipdb> shopify.Shop.current()
shop(2330215)
but :
ipdb> shopify.Shop.get(2330215)
*** ResourceNotFound: Not Found:https://store.myshopify.com/admin/shops/2330215.xml
ipdb>
what is the right way to make such call .
Solution
As far as I can tell, there is no /admin/shops
(plural) API path, at all.
You use the API per shop, the shop_url
parameter gives you access to a specific shop and then you cannot access other shops nor do you need to use shopify.Shop.get()
.
The Python library uses a generic base class for all resource types, and that is where the .get()
method comes from, but that method has no meaning for shops.
The shopify.Shop.current()
returns the one shop resource that you need to care about. It has an .attributes
attribute that holds all the data returned by the Shopify API; keys in that mapping also work as attributes on the main resource object:
shop = shopify.Shop.current()
print shop.attributes.keys()
print shop.name
Answered By - Martijn Pieters Answer Checked By - Marilyn (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.