Chunk Upload Media Complete
This endpoint completes the chunk upload and create the Media
info
This operation requires authentication
HTTP Request
POST /api/v2/media/upload/complete/
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
» type | body | string | false | Default to image or document based on file extension |
» upload_id | body | string | true | Id of the chunk uploaded file |
» md5 | body | string | true | MD5 hash of the original file for checksum proposal |
Enumerated Values
Parameter | Value | Description |
---|---|---|
» type | image | Image media type |
» type | doc | Document media type (only pdf documents are supported) |
» type | eimage | Other images related to contributes. eg. Images uploaded and inserted as <img> into the contribute text |
Example Body Parameters
- JSON
{
"type": "image",
"upload_id": "string",
"md5": "string"
}
Example Request
- JavaScript
- Bash
const inputBody = '{
"type": "image",
"upload_id": "string",
"md5": "string"
}';
const headers = {
'Content-Type':'application/x-www-form-urlencoded',
'Accept':'application/json',
'Authorization': 'Bearer {access_token}'
};
fetch('/api/v2/media/upload/complete/',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
# You can also use wget
curl -X POST /api/v2/media/upload/complete/ \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access_token}' \
--data-raw 'upload_id=UPLOAD_ID&md5=FILE_MD5' \
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
201 | Created | Response status code | Media |
Example responses
- 200
{
"id": "integer",
"added_at": "string",
"type": "string",
"title": "string",
"description": "string",
"url": "string(uri)",
"image": "string",
"image_width": "integer",
"image_height": "integer",
"order": "integer",
"embed": {Embed}
}