Updating contents via REST
This document explains how to execute content updates using the Document.One (D1) REST API.
Log in to D1 and open the repository where the contents to be updated are stored:
Select the content you want to update. Copy the content's technical ID:
Go back to the landing page and click the API link under the repository where the contents to be updated are stored:
The OpenAPI page opens, showing the available D1 endpoints.
Optionally, open the
/access.adx.content.test/v1/content/checkout
endpoint available under Versioning.Optionally, paste the content's technical ID into the contentId field:
Optionally, click Execute and check the response. A response with status
200
(success) is expected, meaning that the content is now checked out. At this point, a new version of the content is created, with a new content ID. Copy the new content ID from the message:Open the
/access.adx.content.test/v1/content/update
endpoint available under Content. Click Try it out to activate the fields.Paste the new content ID into the contentId field.
Change the properties as required. If you want to upload a new resource, simply attach it in the resource field.
Click Execute and check the response. A response with status
200
(success) is expected, meaning that the content is now updated. Check the content access again to verify this is the case.Optionally, open the
/access.adx.content.test/v1/content/checkin
endpoint available under Versioning.Optionally, paste the new content technical ID into the contentId field.
Optionally, click Execute. Your content is now saved with a new version, with the status
CURRENT
.
Updating custom type values on an existing content
In case a custom content exists it can be set. At the moment the OpenAPI user interface is not supporting custom types. Use curl
instead to do so. The properties needs to be sent as JSON as part of the properties
String-To-String map, for example,
curl -X POST "[http|https]://[HOST]:[PORT]/tribefire-services/api/v1/access.adx.content.[REPO_TECHNICAL_NAME]/v1/content/update?sessionId=[SESSION_ID]" -H "accept: application/json" -H "Content-Type: multipart/form-data" -F "serialized-request={ \"properties\": { \"[PROPERTY_NAME]\": \"[PROPERTY_VALUE]\" } }" -F "contentId=[CONTENT_ID]"
Imagine there exists a custom type called Invoice
and it has an invoiceNumber
, then use the following:
curl -X POST "[http|https]://[HOST]:[PORT]/tribefire-services/api/v1/access.adx.content.[REPO_TECHNICAL_NAME]/v1/content/update?sessionId=[SESSION_ID]" -H "accept: application/json" -H "Content-Type: multipart/form-data" -F "serialized-request={ \"properties\": { \"invoiceNumber\": \"myInvoiceNumberValue\" } }" -F "contentId=[CONTENT_ID]"
OpenAPI
For code samples, see