Mo_JM
3 months agoContributing User
Trouble getting Access token
Hi. I'm new to APIs. I know there are articles on how to obtain an Access token, but I'm still stuck. I'm using Rest Fox and trying to POST to https://secure.myob.com/oauth2/v1/authorize/ with the appropriate information, but I get a 502-Bad Gateway error. Being new, I'm not sure if it's the URL, or the credentials, or something else that is wrong. Could someone help please?
Hi Mo_JM , you need to encode both the redirect URL and the authorization code itself.
EG:
code=Wvof%21IAA[[TRUNCATED_FOR_READABILITY]]luF&redirect_uri=http%3A%2F%2Flocalhost%2Fmyob_redirect%2F&client_id=[[MY_API_KEY]]&scope=CompanyFile&client_secret=[[MY_SECRET]]&grant_type=authorization_code