Thank you for visiting our Partner Zone. This area is an exclusive space for MYOB Partners. Find out how to Partner with MYOB.
August 2021
August 2021
I'm tring to request company files via the following endpoint from localhost
https://api.myob.com/accountright/
however, it always comes back with CORS error
Access to XMLHttpRequest at 'https://api.myob.com/accountright' from origin 'http://localhost:8080' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resourc
By the way, I've already successfully get the access_token and refresh_token from the https://secure.myob.com/oauth2/v1/authorize/
August 2021
August 2021
Thanks for reaching out, I am not overly familiar with the Cors policy however from what I've found online this seems to be a Javascript error that occurs when the Same Origin Policy is preventing the response form from being received.
To resolve this you would need to return CORS headers in your response.
CORS - https://developer.mozilla.org/en-US/docs/Glossary/CORS
CORS errors - https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS/Errors
If you have any questions you can create a support request with us HERE.
Thanks,
@Hannah_B
MYOB API Specialist
MYOB API Support Centre|MYOB App Marketplace|MYOB AccountRight API Endpoint Doc's
Did my answer help?
Mark it as a Solution