unsupported_media_type
415 Unsupported media type. The body isn’t a type the endpoint reads: JSON for most, a multipart form for file uploads, and only the file types listed for files.
| Status | Code | Retry? |
|---|---|---|
| 415 Unsupported media type | unsupported_media_type | After fixing it |
What it means
The body isn’t a type the endpoint reads: JSON for most, a multipart form for file uploads, and only the file types listed for files.
Common causes
Content-Typeis missing or isn’tapplication/json.- A file upload isn’t
multipart/form-data. - The file is a type Messages can’t send.
What to do
Send Content-Type: application/json.
Can I retry it?
Only after you fix what the message names. Until then the same request gets the same answer.
What the answer looks like
Response415
{
"error": {
"code": "unsupported_media_type",
"message": "Send `Content-Type: application/json`.",
"hint": "Send `Content-Type: application/json`.",
"doc_url": "https://usebluebot.com/docs/errors/unsupported_media_type",
"request_id": "req_1Hq2LxW9cVbN3mKpRtYs0a"
}
}Branch on code, which never changes. message and hint are written for people and may be reworded. Quote request_id when you write to support.
Related
- : the envelope and every code
- : retrying without sending twice
- : every cap and what happens when you reach it