Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/340.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/api/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何从shopify拨打此电话?(GET/POST)python_Python_Api_Shopify - Fatal编程技术网

如何从shopify拨打此电话?(GET/POST)python

如何从shopify拨打此电话?(GET/POST)python,python,api,shopify,Python,Api,Shopify,我必须使用标准shopify API(python)进行此调用 我得到的是: ipdb> shopify.Shop.current() shop(2330215) 但是: ipdb> 进行此类调用的正确方法是什么。据我所知,根本没有/admin/shops(复数)API路径 您使用API每家店铺,shop\u url参数允许您访问特定店铺,然后您无法访问其他店铺,也不需要使用shopify.shop.get() Python库对所有资源类型使用一个通用基类,这就是.get()方法的来源,

我必须使用标准shopify API(python)进行此调用

我得到的是:

ipdb> shopify.Shop.current()
shop(2330215)
但是:

ipdb>


进行此类调用的正确方法是什么。

据我所知,根本没有
/admin/shops
(复数)API路径

您使用API每家店铺
shop\u url
参数允许您访问特定店铺,然后您无法访问其他店铺,也不需要使用
shopify.shop.get()

Python库对所有资源类型使用一个通用基类,这就是
.get()
方法的来源,但该方法对商店没有意义

shopify.Shop.current()
返回您需要关心的一个商店资源。它有一个
.attributes
属性,保存Shopify API返回的所有数据;该映射中的键也用作主资源对象上的属性:

shop = shopify.Shop.current()
print shop.attributes.keys()
print shop.name 

谢谢你的提示:),但是有没有办法获得上面提到的API托管的详细店铺信息。Martijin也有同样的问题或是什么?我使用的是PyActiveResource 2.1.0和ShopifyAPI 2.1.0,但是我找不到你在这里提到的get_current()函数。我用ipython检查过,但它不在那里。请帮帮我,回答得好。请注意,get_current()已重命名为current(),因此现在它的
shopify.Shop.current()
ipdb> shopify.Shop.get(2330215)
*** ResourceNotFound: Not Found:https://store.myshopify.com/admin/shops/2330215.xml
shop = shopify.Shop.current()
print shop.attributes.keys()
print shop.name