Attach or use a photo in content
POST
/cms/photo/{id}/use
const url = 'https://api.example.com/cms/photo/1/use';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"id":1,"inline":true}'};
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.example.com/cms/photo/1/use \ --header 'Content-Type: application/json' \ --data '{ "id": 1, "inline": true }'Creates a new attachment for an existing photo and associates it with a content item.
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”id
required
integer
Photo attachment id
Request Body
Section titled “Request Body”Media typeapplication/json
object
id
Existing article id. If omitted, a new draft article is created.
integer
inline
If true, creates an inline image attachment.
boolean
Example generated
{ "id": 1, "inline": true}Responses
Section titled “Responses”Attachment added
Media typeapplication/json
object
id
New Attachment ID
integer
content_id
Content ID the attachment was added to
integer
Example generated
{ "id": 1, "content_id": 1}