Complete an upload
const url = 'https://api.ebitex.io/assets/management/v1/uploads/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/complete';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"parts":[{"partNumber":1,"eTag":"example"}],"name":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.ebitex.io/assets/management/v1/uploads/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/complete \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "parts": [ { "partNumber": 1, "eTag": "example" } ], "name": "example" }'Call this once the file has been sent. The file is checked for what it actually is, an image is re-encoded without its metadata and given a thumbnail, an SVG is rebuilt, and the asset is created. Calling it again for an upload already completed is harmless.
A video may still be processing: the answer is then 202 with { "status": "processing" }; call again until you get 201.
Key: an Assets management key with assets.management.write.
Authorizations
Section titled “Authorizations”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters”Request Body
Section titled “Request Body”Responses
Section titled “ Responses ”The new asset, as GET /assets/{id} returns it.
missing_api_key or invalid_api_key: no key was sent, or it is unknown, revoked or expired.
payment_required: the organization’s subscription needs attention.
scope_denied: the key is not an Assets management key. permission_denied: a read key was used for a write. app_not_available: Assets is not enabled for the organization. origin_denied or ip_denied: the key was used from an origin or address outside its restrictions.
not_found: the upload does not exist, or has already finished and been removed.
upload_incomplete: the file has not arrived yet.
The file was refused (not an allowed type, too large, or unreadable); the answer names the reason, and the upload is removed.
too_many_failed_authentications: too many bad keys from this address; rate_limited: too many requests from the organization. Retry-After says how long to wait.