我尝试使用Python从Shopify(Analytics->reports)获取报告,如下所示:
import requests
APIkey = "myAPYkey"
APIversion = "2019-04"
Pass = "myPass"
hostname = "myHost"
response = requests.get("https://{}:{}
{}/admin/api/{}/reports.json".format(APIkey,Pass,hostname,APIversion))
print(response.text)
不管我得到什么
^{pr2}$另一方面,我不知道在哪里可以找到报告的ID。在
为什么?如果我进入“分析->报告”部分,我可以看到多个报告。在
如果您阅读了Report Page in REST API Reference处的描述,则说明
第一段说明了如何在基于shoppify管理的shoppifyql中创建报表。这个API提供了创建和更新报表等资源。在
第二段指出,创建报表的唯一应用程序可以通过API访问它们。此外,从shoppify管理创建的任何报告也不能通过API访问。在
因此,对于getallreports调用的这个空响应,只是告诉您没有通过API创建任何报表。一旦你这样做,你就会看到结果。在
如果您想在shoppify管理中复制报表,请查看ShopifyQL,然后您可以创建类似的东西,也可以通过API访问。除此之外,还没有其他方法可以通过restapi获取Shopify报告。在
相关问题 更多 >
编程相关推荐