Operations
Operations in Contendo Server define the actions that can be performed within the repository.
Operations include:
- retrieving, creating, updating, and deleting objects
- managing types
- fetching repository information
- handling access control
Every API request must specify an operation to indicate the intended action.
Parameters
Operation parameters are specified depending on the HTTP method:
GET
- using query parametersPOST
- using the request body as a JSON field (application/json) or multipart/form-data parameter.
Specifying the operation
Operations can be included in API requests using the operation
query parameter for both GET
and POST
requests.
Additionally, for POST
requests the operation
parameter can be set in the request body.
GET Requests
A GET
request is typically used for retrieving data, such as fetching object details. The operation is specified via
query parameter.
Example: Fetching an Object
curl -X 'GET' \
'{REPOSITORY_URL}?operation=object&objectId={target_objectId}'
Example: Searching for Objects
curl -X 'GET' \
'{REPOSITORY_URL}?operation=query&q={search_query}'
POST Requests
A POST
request is used for operations that modify the repository, such as creating, updating, or deleting
objects.
The operation is specified via:
operation
query parameteroperation
parameter in the request body
Example: Creating and Object - operation is defined via query parameter:
curl -X 'POST' \
'{REPOSITORY_URL}/root/Animals/Dogs?operation=createObject' \
-H 'Content-Type: application/json' \
-d '{
"properties": {
"cmis:name": "Rex",
"cmis:objectTypeId": "cmis:document"
}
}'
Example: Creating and Object - operation is defined via body:
curl -X 'POST' \
'{REPOSITORY_URL}/root/Animals/Dogs' \
-H 'Content-Type: application/json' \
-d '{
"operation": "createObject",
"properties": {
"cmis:name": "Rex",
"cmis:objectTypeId": "cmis:document"
}
}'