Thank you for visiting our Partner Zone. This area is an exclusive space for MYOB Partners. Find out how to Partner with MYOB.
I can successfully execute authentication, access_code request and refresh_token call in AR Live API. But I'm getting empty response for list of company files and for a particular company file. This is may be because my httpRequest object is missing some data. Can anyone please tell me what should be in the body of the request with an example code? Below is what I'm trying.
HttpRequest req = new HttpRequest(); String endPoint = 'https://api.myob.com/accountright/'; req.setBody(''); //what should be in the body? when this is empty getting warnings req.setEndpoint(endPoint); req.setMethod('POST'); req.setTimeout(60000); req.setHeader('content-type','application/x-www-form-urlencoded; charset=utf-8'); req.setHeader('Authorization', 'Bearer '+accessToken); req.setHeader('x-myobapi-cftoken',credentials); req.setHeader('x-myobapi-key',CLIENT_ID); req.setHeader('x-myobapi-version','v2'); //req.setHeader('Content-Length','1024'); Http http = new Http(); HTTPResponse res = http.send(req); System.debug(res.getBody());
Solved! Go to Solution.