Start a Post

Requesting data from cloud-based company file

4 REPLIES
Contributing Partner andreboc
6 Posts
Contributing Partner

Re: Requesting data from cloud-based company file

Any luck getting the GUID through "https://api.myob.com/accountright"?

 

I get a blank response.... therefore, i cant access anything further without the GUID...

Contributing Partner d_ocrex
8 Posts
Contributing Partner

Re: Requesting data from cloud-based company file

I am facing same problem, If you found any solution kindly share with me.

 

Thanks

Contributing Partner MitchPearce
10 Posts
Contributing Partner
Australia
Accepted Solution Solved Solution

Re: Requesting data from cloud-based company file

Having done a bit more digging around through the other posts on this forum I think I have found my answer.

 

The Developer Inactive issue I assume has something to do with my API_Key being the third I have registered and beyond my initial allowance. I have deleted my previous two test keys, and eagerly await MYOB to manually activate my new key...

 

The second issue I believe is answered in the docs at http://developer.myob.com/api/accountright/best-practice-guides/hypermedia-and-uris/... which I had previously overlooked (Thanks Jack Skinner for drawing my attention to this reference).

 

I need to get my cloud company file details by sending a GET request to https://api.myob.com/AccountRight, then I can use the URI of the applicable cloud record to request a list of Contacts, i.e.

 

Send GET request to: https://[Location].api.myob.com/accountright/[GUID]/Contact     'applicable URI from previous request

 

Once my key has been activated and I have confirmed this works I'll close out this post.

 

Cheers! 

Contributing Partner MitchPearce
10 Posts
Contributing Partner
Australia

Re: Requesting data from cloud-based company file

In case this has any bearing on my post, an example of the reponse body when requesting an access token...

 

{"access_token":"AAe[truncated for readability]eAA","token_type":"bearer","expires_in":"1200","refresh_token":"nBRn[truncated for readability]y12AEA","scope":"CompanyFile","user":{"uid":"XXXXXXXXXXXXXX","username":"xxxxx@xxxx.com"}}

Highlighted
Contributing Partner MitchPearce
10 Posts
Contributing Partner
Australia
Solved: Go to Solution

Requesting data from cloud-based company file

Hi,

 

I'm trying to retreive data from my cloud-based company file. I can get the Authcode and Access token no worries, and I've checked and rechecked my API Key, API Secret, Username and Password. I have formulated the headers in accordance with the example at http://developer.myob.com/api/accountright/api-overview/authentication/.

 

Example:

 

"Authorization", "Bearer " & AAEAAAiFiUQ6L1K82L[..access token shortened for readability.]
"x-myobapi-cftoken", "Basic " + Base64Encode(csUsername + ":" + csPassword)
"x-myobapi-key", XXXxxxXXXXXxxxxxXXXX
"x-myobapi-version", "v2"

 

Note: I use the same base64encode function with my local company files and it works just fine.

 

Issue 1: When I send a request I get a response "Developer Inactive" - I can see from other posts that this could be related to an incorrect key, but I have checked and rechecked. I couldn't be exceeding my request limits, surely?

 

Issue 2: I am unclear on where to send the request...

 

To retrieve a list of my Contacts, should I send a GET request to https://api.myob.com/accountright and include the REST query in the body of the request? Or do I send to https://api.myob.com/accountright/[something?]/contact/?api-version=v2 ?.

I can't find a GUID for my company file, so I am assuming that the request does not get sent to http://localhost:8080/AccountRight/[GUID]/Contact/?api-version=v2

 

Issue 3: If I need to send a query in the body of my request to retreive a list of contacts, how would I format this?

 

An ideas?

 

Many thanks for your assistance in advance! : )

 

Mitch

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