Post

2 followers Follow
-1
Avatar

Getting random PodioAuthorizationError on file->attach api call...

So our app is working perfectly receiving lots of emails with attachments and creating/attaching them into Podio... but every once in a while we get this exception:

PodioAuthorizationError

when we are calling the same $api->file->attach call that we make for many other emails... 

Any ideas on what would cause this exception to be raised on the file attach call?  Note, that we had already uploaded the file using file->upload successfully... 

Thanks!

Patrick Steil

http://www.PodioTools.com 

Patrick Steil

Please sign in to leave a comment.

5 comments

0
Avatar

My guess would be that the token expired, but the request was not retried after the refresh of the token. It helps a lot if you give us the payload of the exception also, which would have a description of exactly what the problem was.

Christian Holm 0 votes
0
Avatar

I forgot to mention in this case we are using App Authentication, so there would be no refreshing of tokens correct?

Here is the error info we are logging... does this help? 

'PodioAuthorizationError' in /var/www/helpdesk/libs/PodioApi/PodioAPI.php:272

Stack trace:#0 /var/www/helpdesk/libs/PodioApi/PodioAPI.php(305): Podio->request('POST', '/file/27921124/...', Array, Array)

#1 /var/www/helpdesk/libs/PodioApi/areas/PodioFile.php(77): Podio->post('/file/27921124/...', Array)

#2 /var/www/helpdesk/email-receive-new/index.php(317): PodioFile->attach(27921124, Array)

#3 {main}  thrown

 

A related question on authorization... what happens if you do app Authentication against one App and then again against another App in the same scope?  Does the 2nd completely override the first?

Thanks

Patrick Steil

http://www.PodioTools.com 

Patrick Steil 0 votes
0
Avatar

You will work with access tokens the exact same way. When you to app auth you provide the app id and app token and in return you get the standard access and refresh tokens. However, the PHP client should be refreshing these automatically (unless you don't store the refresh token).

Try catching the exception. There will be an error description in there. See the PodioError class for available properties.

Andreas Haugstrup Pedersen 0 votes
0
Avatar

Thanks guys... I think my exception handling is not capturing all the error details... I will resolve this... thanks!

Patrick Steil 0 votes
0
Avatar

Hi Patrick, did you fix that problem? I have the same error using Podio Api with Laravel.

Junior Obando 0 votes