post
https://api.emaktalk.com/api/v2/files
Uploads one file, sent as the request body itself with its real Content-Type, never as a form. It answers the file with its id, which the request that uses it takes as its file_id.
Rules:
Content-Typeis one ofaudio/wavoraudio/mpeg(audio/x-wav,audio/wave,audio/vnd.waveandaudio/mp3are taken as those), and the file's first bytes must be what its type says.Content-Lengthgives the file's size: at most 25 MB.filenamenames it, as you'll see it infilename: control characters are removed, at most 255 characters;uploadwhen you send none.
Response: 201 with { data }: the file's id, filename, content_type, size_bytes and expires_at, when it is deleted if nothing has used it.
Notes:
- Send an
Idempotency-Keyto retry an upload safely: a retry with the same key and the same file answers the first upload again, withIdempotent-Replayed: true, and stores nothing new. - A
500names the file it was storing: waitRetry-After, thenGETit to see whether it was uploaded. - An answer of
400,401,403,405,409,413,415,429or503stores nothing. - A body typed
multipart/form-data,application/x-www-form-urlencodedortext/plainthat doesn't carry this site'sOriginis refused with a403in plain text, not the error object, before this endpoint answers. - Every answer carries
X-Request-IdandCache-Control: private, no-store.
Recent Requests
Log in to see full request history
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
Loading…
