Search code examples
pythonpython-3.xpodio

Python integration with Podio


I am not able to work with the Python library of Podio. I downloaded the GitHub repository to work on it. But getting an error. Code:

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

Error:

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"}

Does this have a relation with the domain name that I had associated with the token? If so, then please tell me what value should I set for the domain if I am not running the script from any server.


Solution

  • It seems the item_id that you are passing 6769 is not the real one or you don't have access to that item. Pass the correct item_id and try again. You can find the item_id from the Developer Info option in Actions menu in the Podio item view.