logoBack to home screen

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.

  1. Log in to ADx.

  2. 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.

Creating a Single Content

  1. 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.

  2. Attach the file to be a basis for your content in the resource field.

  3. Optionally, change other properties as required.

  4. Click Execute and check the response. A response with code 200 (success) means that the content is now created.

  5. 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

  1. Find the /access.adx.content.repository_name/v1/contents Create Contents endpoint and expand it.
  2. Attach the files your contents should be created from in the resources field.
  3. Optionally, change other properties as required.
  4. Click Execute and check the response. A response with code 200 (success) means that the content is now created.
  5. Your contents are now created and in WORKING_COPY status.