Specifying the Target Object

Most operations involving objects require specifying a target object. For example:

  • Fetching an object requires identifying the object to be retrieved.
  • Updating an object requires specifying the object to be modified.
  • Deleting an object requires specifying the object to be removed.
  • Creating a new document requires specifying the folder where the document will be stored.

We have two ways to specify the target object:

  1. Via objectId (using the unique identifier of the object)
  2. Via path (using the human-readable location of the object in the repository)

Via Object ID

Using objectId is useful when:

  • You do not know or do not need to know the object's location in the folder structure.
  • The object's path might change, but its ID remains constant.
  • You retrieve an object through a search query and need to reference it directly.
  • You work with an object programmatically, without concern for its position in the hierarchy.

The objectId corresponds to the cmis:objectId property of the target object. When using this approach, the request URL only needs to specify the repository host.

GET Request Example - To fetch an object using its objectId, include the parameter in the request:

curl -X 'GET' \
  '{REPOSITORY_URL}?operation=object&objectId={target_objectId}'

POST Request Example - To create a new object within a specified folder, pass the folder's objectId as a parameter:

curl -X 'POST' \
  '{REPOSITORY_URL}' \
  -H 'Content-Type: multipart/form-data' \
  -F 'operation=createObject' \
  -F 'objectId={target_folder_objectId}' \
  -F 'properties={"cmis:name":"Rex","cmis:objectTypeId":"cmis:document"}'

Via Path

Using path is useful when:

  • You need to reference an object by its logical location in the hierarchy.
  • The object’s structure is important, such as when working with folder-based organization.
  • You are manually browsing the repository or working interactively (e.g., during testing or debugging).
  • You want to reference objects in a human-readable way, avoiding the need to look up their objectId.

The path is set by appending /root followed by the object's location to the repository URL. The /root prefix indicates the root folder of the repository.

GET Request Example - To fetch an object using its path, include the full path in the URL:

curl -X 'GET' \
  '{REPOSITORY_URL}/root/Animals/Dogs/Rex?operation=object'

POST Request Example - To create a new object within a specific folder, use the folder's path in the request URL:

curl -X 'POST' \
  '{REPOSITORY_URL}/root/Animals/Dogs' \
  -H 'Content-Type: multipart/form-data' \
  -F 'operation=createObject' \
  -F 'properties={"cmis:name":"Rex","cmis:objectTypeId":"cmis:document"}'