Update a Media
This endpoint updates a Media
info
It must be used for media of type
url for set the preview image that can be choosed between the images returned by the create endpoint or other images that can be retrieved by an url.
info
This operation requires authentication. The logged user must be the media creator
HTTP Request
PUT /api/v2/media/{id}/
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | string | true | A unique integer value identifying this media object |
» image | body | string(uri) | true | Image url |
Example Body Parameters
- JSON
{
"image": "https://example.com"
}
Example Request
- JavaScript
- Bash
const inputBody = '{
"image": "string"
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'Authorization': 'Bearer {access_token}'
};
fetch('/api/v2/media/{id}/',
{
method: 'PUT',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
# You can also use wget
curl -X PUT /api/v2/media/{id}/ \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access_token}' \
--data-raw '{
"image": "string"
}'
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | 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}
}