Forum Discussion

ktech's avatar
5 months ago

401 Unauthorised Error MYOB Business Plus

Trying to integrate an API solution and having trouble doing the very basics with MYOB API.

In summary:

  1. Purchased a subscription of MYOB Business Pro to test
  2. Obtained a developer API Key for our application
  3. Successfully can use Oauth to get the code
  4. Successfully use https://secure.myob.com/oauth2/v1/authorize to get the token and refresh token
  5. Successfully use  https://secure.myob.com/oauth2/v1/authorize to get a refresh token

However when we try to do the following basic call to get the companyFiles connected to the user using api:

https://api.myob.com/accountright

We get a 401 Unauthorized.

 

Using postman to make the call, here are the snapshots. Tried both with and without 'Bearer'. Also tried including property x-myobapi-cftoken, with password Based64(Adminstrator:) => QWRtaW5zdHJhdG9yOg==


Still get the same error. Only had the MYOB subscription account for 7 days not sure if this is the problem?

Also is this the correct endpoint for MYOB Business plus? https://api.myob.com/accountright

 

Also the user is the owner of the CompanyFile + also connected to other profiles. I have also tried registering another email as a user with File access but still get the same error.

 

 Appreciate if we can get some help on this. Have also raised ticket with MYOB but not got a response yet.

 

  • Issue resolved, I had passed the auth paramaters in the body not the header. Now working

  • Hi ktech,

     

    I can see that you are unable to integrate an API solution with MYOB API. I highly suggest checking our Developer Centre site MYOBapi Developer Centre , you will see our instructional guides, help, and general information, or you may lodge a ticket through this link that will be checked by our developer's team.

     

    Feel free to write a post if you need further assistance.

     

    Cheers,

    Jem

  • Issue resolved, I had passed the auth paramaters in the body not the header. Now working