Creating Contents with REST
This document explains how to create new contents in a repository using ADx REST API. You can create either a single content or a batch of contents in one go.
-
Log in to ADx.
-
On the landing page, click the API link under repository where you want to create content(s):
OpenAPI page opens, showing the available ADx endpoints. You have two options now - see Creating a single content and Creating multiple contents.
On this page
Creating a Single Content
-
Find the
/access.adx.content.repository_name/v1/content
Create Content endpoint and expand it.To create folders, use the
/access.adx.content.demo/v1/folder Create Folder
endpoint. -
Attach the file to be a basis for your content in the resource field.
-
Optionally, change other properties as required.
-
Click Execute and check the response. A response with code 200 (success) means that the content is now created.
-
Your content is now created and in
WORKING_COPY
status.
Setting custom type values on creating a content
In case a custom content is prepared it can on upload already set the according types. At the moment the OpenAPI UI 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, e.g.
curl -X POST "[http|https]://[HOST]:[PORT]/tribefire-services/api/v1/access.adx.content.[REPO_TECHNICAL_NAME]/v1/content?sessionId=[SESSION_ID]" -H "accept: application/json" -H "Content-Type: multipart/form-data" -F "serialized-request={\"properties\": { \"[PROPERTY_NAME]\": \"[PROPERTY_VALUE]\" } }" -F "resource=@[RESOURCE_NAME]" -F "entryType=[CUSTOM_TYPE]"
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?sessionId=[SESSION_ID]" -H "accept: application/json" -H "Content-Type: multipart/form-data" -F "serialized-request={\"properties\": { \"invoiceNumber\": \"myInvoiceNumberValue\" } }" -F "resource=@myInvoice.pdf" -F "entryType=Invoice"
Creating Multiple Contents
- Find the
/access.adx.content.repository_name/v1/contents Create Contents
endpoint and expand it. - Attach the files your contents should be created from in the resources field.
- Optionally, change other properties as required.
- Click Execute and check the response. A response with code 200 (success) means that the content is now created.
- Your contents are now created and in
WORKING_COPY
status.