thoughtco/Freeagent-PHP

Only works once, then get Access Denied

Closed this issue · 2 comments

This works once, it allows me to get Freeagent data. But when I refresh the page, my app shows an error. Debugging shows Freeagent returns an Access Denied message. The code is still in my URL, so I guess its trying to getAccessToken again, and this page states you cant get it again once its set, it will give access denied http://baddotrobot.com/blog/2012/08/13/oauth-and-http-part-iii/.

So is your script correct, and its left up to us to deal with the subsequent calls, or is there an issue in the script?

It fails at the $this->call method in the getAccessToken() method.

Thanks

Hello

You need to save the access token, and then use it again in subsequent calls. The Example file just shows the process you need to use - obviously you need to adapt it to your needs.

Thanks
Ryan

OK great, now I know its me not you! Thanks.