Python 与跑道整合

Python integration with Podio

我无法使用跑道的 Python 库。我下载了 GitHub 存储库来处理它。但是得到一个错误。 代码:

from podio.pypodio2.api import OAuthClient

c = OAuthClient(
    '************',
    '************',
    '************',
    '************'    
)

print(c.domain)
x = lambda x,y: (x,y)
result = c.Item.find(6769, basic=True, handler=x)
print(result, data) #Returned info

错误:

Traceback (most recent call last):
  File "test.py", line 11, in <module>
    result = c.Item.find(6769, basic=True, handler=x)
  File "C:\Users\hp\Desktop\podio\pypodio2\areas.py", line 93, in find
    return self.transport.GET(url='/item/%d/basic' % item_id)
  File "C:\Users\hp\Desktop\podio\pypodio2\transport.py", line 145, in __call__
    return handler(response, data)
  File "C:\Users\hp\Desktop\podio\pypodio2\transport.py", line 215, in _handle_response
    raise TransportException(response, data)
podio.pypodio2.transport.TransportException: TransportException({'server': 'nginx', 'date': 'Wed, 03 Jun 2020 14:22:43 GMT', 'content-type': 'application/json; charset=utf-8', 'content-length': '279', 'connection': 'keep-alive', 'x-rate-limit-remaining': '999', 'x-rate-limit-limit': '1000', 'x-podio-auth-ref': 'user_5424431', 'x-podio-request-id': 'a5ufc4W3', 'strict-transport-security': 'max-age=31535999', 'status': '403'}): {"error_parameters":{},"error_detail":null,"error_propagate":false,"request":{"url":"http:\/\/api.podio.com\/item\/6769\/basic","query_string":"","method":"GET"},"error_description":"The user with id 5424431 does not have the right view on item with id 6769","error":"forbidden"}

这与我与令牌关联的域名有关系吗?如果是这样,那么请告诉我如果我不是来自任何服务器的 运行 脚本,我应该为域设置什么值。

您传递的 6769 似乎不是真实的 item_id,或者您无权访问该项目。 传递正确的 item_id 并重试。您可以在跑道项目视图的操作菜单中的开发者信息选项中找到item_id