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
Most API requests must specify an operation to indicate the intended action. Additionally, every operation has a scope it is applied to via the type of URL that is used.
Operation URL Types
Operations in Contendo Server are executed on either the global Contendo Server, Domain or the Repository level. The URL used for each operation specifies the level. Depending on this scope, we have these types of urls:
Name | Placeholder | Description | Example |
---|---|---|---|
Contendo Server URL | {CONTENDO_SERVER_URL} |
The root URL used for managing Contendo Server as a whole, such as creating domains. | http://my-cs-host.com |
Domain URL | {DOMAIN_URL} |
Used for operations that apply to the entire domain, such as managing repositories, users, and groups. Domain URLs are build upon the Contendo Server URL in this format {CONTENDO_SERVER_URL}/{domainId} |
http://my-cs-host.com/PetOrg |
Repository URL | {REPOSITORY_URL} |
Used for operations performed on a specific repository, including managing types, handling objects, and configuring access control. Repository URLs are built upon domain URLs in this format: {DOMAIN_URL}/{repositoryId} |
http://my-cs-host.com/PetOrg/PetEquipmentStore |
Check Multitenancy and Repositories for details about these levels.
Parameters
Operation parameters are specified depending on the HTTP method:
GET
- using query parametersPOST
- using the request body as a JSON field (application/json), multipart/form-data parameter or application/x-www-form-urlencoded.
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": {
"name": "Rex",
"objectTypeId": "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": {
"name": "Rex",
"objectTypeId": "document"
}
}'