MuleSoft · APIkit for REST
APIKIT:NOT_ACCEPTABLE
Short answer
APIKIT:NOT_ACCEPTABLE is the APIkit for REST error type that maps to HTTP status 406 with the response message "Not acceptable". APIkit validates incoming requests against your RAML or OAS API specification, so compare the failing request with the specification.
Needs verificationLast reviewed
Needs verification. The error type, its HTTP status code and its response message are confirmed in the APIkit error handling reference. The documentation pages checked do not state exactly which request condition raises this type, so the causes below are not confirmed. Treat it as a starting point, not as a confirmed fix.
01Error text
Error type: APIKIT:NOT_ACCEPTABLE
HTTP status: 406
Response message: Not acceptable02Likely causes
- Unconfirmed: the request's
Acceptheader asks for a media type the API specification does not define for that response. - APIkit for REST automatically validates incoming requests against the API contract defined in RAML or OAS.
03How to fix it
- Check the
Acceptheader of the request against the response media types the API specification defines. - Compare the failing request with the API specification the APIkit router uses, and correct whichever of the two is wrong.
- To control what the caller receives, add an On Error Propagate handler with the type
APIKIT:NOT_ACCEPTABLEthat sets the response body and anhttpStatusvariable of 406. - Adapt the handler if your API needs a custom status code or message.
04Official documentation
→Related errors
- APIKIT:UNSUPPORTED_MEDIA_TYPEAPIKIT:UNSUPPORTED_MEDIA_TYPE is the APIkit for REST error type that maps to HTTP status 415 with the response message "Unsupported media type". APIkit validates incoming requests against your RAML or OAS API specification, so compare the failing request with the specification.
- HTTP:NOT_ACCEPTABLEHTTP:NOT_ACCEPTABLE means the server cannot produce a response that matches the content negotiation headers of the request (HTTP 406). Correct the Accept headers the HTTP Request operation sends.
- APIKIT:BAD_REQUESTAPIKIT:BAD_REQUEST is the APIkit for REST error type that maps to HTTP status 400 with the response message "Bad request". APIkit validates incoming requests against your RAML or OAS API specification, so compare the failing request with the specification.
Test every fix in a non-production environment before you apply it to production. See how entries are verified.
More for MuleSoft work:Open MuleSoft jobsMuleSoft rates and salariesHire a senior MuleSoft developer