Python与Podio集成

问题描述 投票:1回答:1

我无法使用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"}

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

python python-3.x podio
1个回答
0
投票

[您似乎正在传递item_id6769不是真实的,或者您无权访问该项目。通过正确的item_id,然后重试。您可以在Podio项目视图的操作菜单的开发者信息选项中找到item_id

© www.soinside.com 2019 - 2024. All rights reserved.