Create an Embed
This endpoint creates an Embed
info
This operation requires admin role.
HTTP Request
POST /api/v2/embed/
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
» id | body | integer | false | A unique integer value identifying this embed |
» embed_type | body | string | true | Type of the embed, can be any string except sc_link that are used for embedded objects auomatically created by the community |
» embed_id | body | string | true | External id for the embed object |
» url | body | string(uri)¦null | false | Url for the resource, if any |
» metadata | body | json | false | Metadata associated to this embed. It mus be a valid json object |
Example Body Parameters
- JSON
{
"embed_type": "string",
"embed_id": "string",
"url": "string(uri)",
"metadata": {}
}
Example Request
- JavaScript
- Bash
const inputBody = '{
"embed_type": "string",
"embed_id": "string",
"url": "string(uri)",
"metadata": {}
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'Authorization': 'Bearer {access_token}'
};
fetch('/api/v2/embed/',
{
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/embed/ \
--H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access_token}' \
--data-raw '{
"embed_type": "string",
"embed_id": "string",
"url": "string(uri)",
"metadata": {}
}'
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
201 | Created | Response status code | Embed |
Example responses
- 200
{
"id": "integer",
"embed_type": "string",
"embed_id": "string",
"url": "string(uri)",
"metadata": {}
}