Forum Discussion
unauthorised seems to suggest it is well formed but has something to do with key or token...have you encoded it correctly..I recall I had a similar issue and needed to escape data string to get it going...sorry dont recall exactly what I did
what the url you are querying? put in the full route
here is my get request from the NET SDK from a trace in Fiddler. This works.
I would;
1. Get rid of Cache control header
2. Get rid of Accept header
3. Modify Accept-Encoding to only include gzip
4. Get rid of Connection header
I can't promise that will make any difference but I have had issues where otherwise harmless headers have prevented me fro getting it working. As you can see this is from the .NET SDK. I have a restsharp client that contructs it as well but I dont have the trace for it here. If you are still stuck afte rthis then reply and I'll get it to you and you can compare then
GET https://arl2.api.myob.com/accountright/f173[TRUNCATED]aa/Payroll/PayrollCategory/Wage/ HTTP/1.1 Authorization: Bearer AAEAAEX[TRUNCATED]CclRjZRxLZM Accept-Encoding: gzip User-Agent: MYOB-ARL-SDK/2022.6.425 (+http://developer.myob.com/api/accountright/v2/) x-myobapi-key: xdf[TRUNCATED]dye x-myobapi-version: v2 x-myobapi-cftoken: QWRt[TRUNCATED]N0Wjgj Host: arl2.api.myob.com
I just tried removing those headers but had no luck.
I have not personally encoded any of the keys or tokens except for the x-myobapi-cftoken containing the credentials which is b64 encoded. I'm not sure if the python requests module automatically applies and encoding scheme but I haven't run into any issues with that when requesting other APIs.
An example request that I've been using is:
GET: https://ar1.api.myob.com/accountright/{{company_file_id}}/Sale/Invoice/Service
Looking for something else?
Search the Community Forum for answers or find your topic and get the conversation started!
Find technical support and help for all MYOB products in our online help centre
Dig into MYOB Academy for free courses, learning paths and live events to help build your business with MYOB.