Error in PATCH or POST API

We tried to make an API request with the EasyMorph (lizensed) but we received the following error:

HTTP/1.1 415 Unsupported Media Type
Transfer-Encoding: chunked
Connection: keep-alive
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 56
Vary: Origin
Strict-Transport-Security: max-age=31536000; includeSubDomains
X-Frame-Options: SAMEORIGIN
Cache-Control: no-cache, private
Date: Fri, 23 Dec 2022 19:40:34 GMT
Server: nginx/1.14.0, (Ubuntu)
Content-Type: text/html; charset=UTF-8

We setted up the same configuration as we had in Postman and there we had a positive answer.

PATCH https://****************************
Authorization: Bearer *********************
Accept: application/problem+json
Content-Type: application/vnd.xentral.default.v1-beta+json; charset=utf-8

{
“product”: {
“sku”: “AP1172”
},
“quantity”: 147
}

Ist something that we should change in EasyMorph?

Thanks

What was the Content-Type in your web request in EasyMorph?

I send you as the 2nd code the EasyMorph’s header, and the Content-Type was:

Content-Type: application/vnd.xentral.default.v1-beta+json; charset=utf-8

HTTP requests are simple: method + URL, headers, and request body. EasyMorph doesn’t do any black magic (except calculate Content-Length). It simply sends what you configured. Compare what you send in EasyMorph with what you send in Postman. If it’s the same, there is no reason why the same HTTP request wouldn’t work in EasyMorph.

Also, Postman is known to add User-Agent implicitly. Try adding User-Agent too. See this topic: Import from WEB not recognizing JSON or XML - #2 by dgudkov

Hi @Sebastian_von_Borzyk

I’ve googled “xentral” and it seems that the xentral uses different content types. At least there are two options, application/vnd.xentral.default.v1+json and application/vnd.xentral.default.v1-beta+json.

According to xentanl, error http code 415 means that "resource representation send in the request is not supported." You may have chosen the wrong content type or something like this.

Please contact the xental API provider and ask them for the correct Content-Type header value.