Search code examples
servicem8

CORS error when making an AJAX request to the ServiceM8 REST API


I'm trying to make an API request to the ServiceM8 REST endpoints from my browser using AJAX. I'm basically having the same problem as this unresolved issue that was posted on the ServiceM8 discussion board:

https://developer.servicem8.com/discuss/5a0e0513ff22d5001e9587f6

Is there currently no CORS support integrated into ServiceM8 to allow this?


Solution

  • I contacted the ServiceM8 Helpdesk and they confirmed the was an issue that has now been resolved.

    Trying it on test-cors.org appears to work:

    https://www.test-cors.org/#?client_method=GET&client_credentials=false&server_url=https%3A%2F%2Fapi.servicem8.com%2Fapi_1.0%2Fjob.json&server_enable=true&server_status=200&server_credentials=false&server_tabs=remote