Forum Discussion

natewallis's avatar
natewallis
Contributing Partner
6 years ago
Solved

API key is missing or inactiv

Hi, 

 

I have managed to be able to retrieve my access token from the MYOB API, however when I make a simple call to the Sandbox commpany file, I receive the following response:

 

 

[29-Jan-2019 10:57:47 Australia/Sydney] {
    "Errors": [
      {
        "Name": "DeveloperInactive",
        "Message": "API key is missing or inactive",
        "AdditionalDetails": "Header: x-myobapi-key",
        "ErrorCode": null,
        "Severity": "Error",
        "LearnMore": "http://developer.myob.com/api/accountright/api-overview/error-messages/?label=developer_inactive&context=403"
      }
    ],
    "Information": "Warning, error messages have not been finalised in this release and may change"
}

 

 

I have verified that I am passing through the required headers.   To test the API has authenticated properly, I am doing a simple GET request to the following URL:

 

https://api.myob.com/accountright/Sale/Invoice/Item

 

I have created several API keys during testing the MYOB authentication - could this be the issue?

 

Do I have to do the "email developers@myob.com" dance to get this sorted?

 

Cheers..

 

5 Replies

Replies have been turned off for this discussion
  • natewallis's avatar
    natewallis
    Contributing Partner

    Looks like I might be using the wrong URL for making API calls, I see references to using the company file GUID in various documentation, but no mention of it elsewhere....   Confusing.

    • Will_SolnX's avatar
      Will_SolnX
      Super Partner

      I'd recommend reading hte documentation here:

      http://developer.myob.com/api/accountright/v2/company-files/

      And verifying first using the Files endpoint:

      http://localhost:8080/accountright/
      http://[IP OF NETWORK COMPUTER]:8080/accountright/
      https://api.myob.com/accountright/

      Once you've got a company file ID, you should be able to construct the appropriate endpoints to call.   I find it easiest to start by bashing a localhosted version of AccountRight before bashing the Web API endpoints.

      • natewallis's avatar
        natewallis
        Contributing Partner

        Thanks Will and Jacob. 

         

        Turns out the API key was inactive, I am guessing this is because I created so many while developing the access_token storage code... 

         

        So I can authenticate now.... 

         

        I am also using the following for authenticating to the company file:

         

        $username_password = base64_encode("Administrator:");

         

        However when I hit the URL: 

        https://api.myob.com/accountright/

        All, I get back is:

         

        ?

         

        Is that common?  I was expecting to get a list of the company files.