CORS errors on BuildAPI calls


#1

I now get CORS errors on all my BuildAPI calls, whereas I wasn’t yesterday. I know that the API is deprecated, but I thought the API server upgrade wasn’t going to affect users.

{
    "errors": [
        {
            "code": "PX300",
            "status": "403",
            "title": "Cross-Origin Request Rejected",
            "detail": "You do not have permission to complete this request; please verify CORS headers."
        }
    ]
}

#2

Can you tell us the server address you’re hitting?
What client are you using, e.g. postman?
Can you also send us the headers you included in your request?


#3

POST /v4/models/<MY_MODEL>/restart HTTP/1.1
Host: build.electricimp.com
Authorization: Basic <MY_API_TOKEN>
Cache-Control: no-cache
Postman-Token: d656c833-1d1e-1232-8753-63ec48530327
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW


#4

Thanks @coverdriven for the information and reporting this.

Sorry, It looks like this is a side-effect from our earlier production release today. This should have been fixed now in Build API.


#5

Thanks @kenny, all working now.