MYOBCommunity
Partner Zone
|
|
Partner Zone

Invalid Authentication token

This thread is now closed to new comments.
Some of the links provided in this thread may no longer be available or relevant.
If you have a question please start a new post.
5 REPLIES 5
Experienced Partner GeorgeChijarira
30 Posts
Experienced Partner
Australia
GeorgeChijarira
Experienced Partner

30Posts

4Kudos

6Solutions

Re: Invalid Authentication token

Hi Samis,

You need to ensure you have valid and correct values for AccessToken, and developer key.

401 suggests that your Token is not valid.

Please revise how you are generating the the initial access code and ensure all the details of your scope, key, secret and redirect url are correct.

Also ensure you have an essentials business.

NOTE: The redirect URI must match the url you entered when registering for your API Key and must be URL ENCODED.
Partner SamiS
2 Posts
Partner
Australia
SamiS
Partner

2Posts

0Kudos

0Solutions

Re: Invalid Authentication token

Thank you for the reply.

I am doing exactly the same ... but no luck. What else should I check ?

 

Headers:

request.Headers.Add("Authorization", "Bearer " + accessToken)

request.Headers.Add("x-myobapi-key", DeveloperKey)

request.Headers.Add("x-myobapi-version", "v0")

TryCast(request, HttpWebRequest).Accept = "application/json"

 

to URL: https://api.myob.com/essentials/businesses

 

Nothing seems wrong but  401 error still.

 

 

Former Staff KeranM
299 Posts
Former Staff
Australia
KeranM
Former Staff

299Posts

94Kudos

56Solutions

Re: Invalid Authentication token

For AccountRight = CompanyFile

For Essentials = la.global

 

All of this information is detailed for each API on the documentation site here http://developer.myob.com/ 

Hope that helps

Keran McKenzie
Futurist in residence @MYOB

Are you a developer? Check out http://developer.myob.com
Looking for an Add-on? Check out http://myob.com/addons/

Twitter: @myobapi | @keranm
Partner SamiS
2 Posts
Partner
Australia
SamiS
Partner

2Posts

0Kudos

0Solutions

Re: Invalid Authentication token

Hi,

I am having the same problem. What scope value you added which fixed your problem? Struggling for hours Smiley Sad

Partner A_Kartik
2 Posts
Partner
A_Kartik
Partner

2Posts

0Kudos

1Solutions

Accepted Solution Solved Solution

Re: Invalid Authentication token

Found my solution. 

While requesting for an Access token, I failed to specify the scope. 

Thanks
Kartik

Highlighted
Partner A_Kartik
2 Posts
Partner
A_Kartik
Partner

2Posts

0Kudos

1Solutions

Solved: Go to Solution

Invalid Authentication token

Hi everyone, 


I am using essentials API...

I can get an access token just fine.
However when I go to use it, I get a 401 - Invalid authentication token. 

I have attached screenshots of the request - giving me the acess token and me making a request with the token. 
Any help is appreciated, 


Thanks
Kartik

MYOB_OauthAccessToken.PNG
MYOB_request_InvalidToken.PNG
Didn't find your answer here?
Try using advanced search to find a post more easily Advanced Search
or
Get the conversation started and make a new post Start a Post