Content Server Rest API

Number of APIs: 186

Content Server Rest API (v1 and v2 calls).

Please click the implementation notes below for further clarification on topics such as categories, body JSON parameters, etc.

[IMPLEMENTATION NOTES]
Inspect the available methods and learn how they work by trying them; not all methods may be allowed to execute on this server.

Unpublished Calls

API calls not mentioned in this document (such as csui resources) are not officially supported and are subject to change. Use at your own risk.

Authentication

To use the REST API you will be required to be authenticated (except for the /v1/auth POST). You can do this by using the /v1/auth POST on this page. Then, copy the ticket value returned. Click the Authorize button and paste the value in the value textbox (then click Authorize).

Performance Tips

  • The more you ask for the slower the REST API will be.
  • When using api/v1/nodes/id/nodes it is recommended to include the extra=false parameter. By default it will be included to maintain backwards compatibility. Getting this information is costly and should not be asked for. Use commands to get that same information in the REST API.
  • When using the v2 api you should specify the fields you want and not get everything back. This has multiple benefits such as less bytes over the wire, less unnecessary expansion of data on the server and in some cases less database calls. Some data is not contained in a standard node and must be retrieved in further database calls.
  • The more actions/commands you ask for the slower the response time the REST API will have. Only ask for the ones you need.
  • See the Query Formatting below on how to specify only certain fields be returned.
  • When using the v2 api, any expanded objects are returned in-line by default. To normalize the data, use the references parameter (references=expand) in conjunction with the expand parameter(s).

Query Formatting

Specify the fields being returned
  • REST API V1: v1/nodes/id/nodes?fields=data&fields=definitions
  • REST API v2: v2/nodes/id/nodes?fields=properties&fields=columns
Specify specific items being returned in a field
  • REST API v2: v2/nodes/id/nodes?fields=properties{id,name}
Query parameters with multiple values must be specified using multiple parameters (ex. &fields=properties&fields=versions) and not using a single parameter (&fields=properties,versions).

Body Parameter

For some requests, instead of specifying parameters in the form, the parameters can be formatted into a json object and submitted in a single body parameter.

NOTE: The content-type of the request must be: application/x-www-form-urlencoded

  • Ex. REST API v2 PUT
    v2/nodes/id
    body={description:best description, name:my new name}
Javascript Example // Include jQuery
<script src=https:\code.jquery.com/jquery-3.3.1.min.js></script>

// Get a OTCSTicket
function GetOTCSTicket(){
var formData = { username: Admin, password:mypassword}
var url = 'http:\mycontentsserver/alpha/cs.exe/api/v1/auth';
var jqxhr = $.ajax({
url: url,
type: POST,
contentType: application/x-www-form-urlencoded,
data: formData,
});
return jqxhr;
}

// Update the name and description for the node with data ID of 6966
function AjaxViaForm(ticket) {
var url = 'http:\mycontentsserver/main/cs.exe/api/v2/nodes/6966';
var formData = {description: best description, name: my new name};
$.ajax({
url: url,
type: PUT,
headers: { 'OTCSTicket': ticket},
contentType: application/x-www-form-urlencoded,
data: formData,
}).done(function(data){
console.log(data);
})
.fail(function(data){
console.log(data.responseJSON.error);
});
}

// Generic method to Get the ticket and update a node after the ticket is received.
function SubmitForm(){
GetOTCSTicket().done(function(data) {
console.log(data.ticket);
AjaxViaForm(data.ticket);
}) .fail(function(data) {
console.log(data.responseJSON.error);
}); }
  • To update fields such as namemultilingual or descriptionmultilingual, the body parameter must be used and the field name must be submitted along with the multilingual structure.
  • Ex. REST API v2 PUT
    v2/nodes/id
    body={description:abc, description_multilingual:{en:abc, de_DE:desc DE}}
Javascript Example // Include jQuery
<script src=https:\code.jquery.com/jquery-3.3.1.min.js></script>

// Get a OTCSTicket
function GetOTCSTicket(){
var formData = { username: Admin, password:mypassword}
var url = 'http:\mycontentsserver/alpha/cs.exe/api/v1/auth';
var jqxhr = $.ajax({
url: url,
type: POST,
contentType: application/x-www-form-urlencoded,
data: formData,
});
return jqxhr;
}

// Update the name and description for the node with data ID of 6966
function AjaxViaForm(ticket) {
var url = 'http:\mycontentsserver/main/cs.exe/api/v2/nodes/6966';
var bodyData = {
description:abc,
description_multilingual:{
en:abc,
de_DE:desc DE
}
};
var formData = {body: JSON.stringify(bodyData)};
$.ajax({
url: url,
type: PUT,
headers: { 'OTCSTicket': ticket},
contentType: application/x-www-form-urlencoded,
data: formData,
}).done(function(data){
console.log(data);
})
.fail(function(data){
console.log(data.responseJSON.error);
});
}

// Generic method to Get the ticket and update a node after the ticket is received.
function SubmitForm(){
GetOTCSTicket().done(function(data) {
console.log(data.ticket);
AjaxViaForm(data.ticket);
})
.fail(function(data) {
console.log(data.responseJSON.error);
});
}

  • To submit parameters in the body that allow multiple values, wrap the values with a JSON array.
  • Ex. REST API v2 POST
    v2/nodes/actions
    body={ids:[2000,4532,6425], actions:[open,download,delete]}

Determine if an action is allowed

  • REST API v1: v1/nodes/id/nodes?commands=rename&commands=properties etc.

  • REST API v2: v2/nodes/id/nodes?actions=rename&actions=open etc.

Using Categories

The following major operations can be performed with respect to Content Server Categories:
  • Apply categories during node creation:  (POST /nodes)
  • Apply a category on a node:  (POST /nodes/{id}/categories)
  • List categories on a node:  (GET /nodes/{id}/categories)
  • Get category info on a node:  (GET /nodes/{id}/categories/{categoryid})
  • Update a category on a node:  (PUT /nodes/{id}/categories/{categoryid})
  • Remove a category on a node:  (DELETE /nodes/{id}/categories/{categoryid}
  • Enable/Disable category inheritance:  (POST/DELETE /nodes/{id}/categories/{categoryid}/inheritance)
  • Upgrade categories on a node:  (PUT /nodes/{id}/categories/upgrade)
Where appropriate, the calls will use the body parameter, which contains a JSON strong. Examples will be provided in each of the URLs above that call for a body parameter.

NOTE: The category attributes mentioned in the examples will often look like 98302 or 9830324. Call 'GET /v2/nodes/{id}?fields=categories' to get the categories and their attributes in the above format, which will make it easier to create the body parameter.

Category with one Text Field Attribute (Category ID: 15847)

The specification for the Text Field attribute is as follows:

{categoryid}{attributeid}

The category will look like this:

Category: [15847
1]
textfield1: [158472]

The attribute ID starts at 2, this is because 1 is reserved for the Category itself. From the example above, the specification for the Text Field attribute would be:

15847
2

V1 example to create a node with this category
Syntax
- POST api/v1/nodes
- body = {name:myName,parent_id:2000,type:0,roles:{categories:{[category_id]:{[category_id]_[attribute_id]:Value goes here}}}}

Example:
- Post api/vi/nodes
- body = {name:myName,parent_id:2000,type:0,roles:{categories:{15384:{15384_2:test}}}}

V2 example to create a node with this category
Syntax
- POST api/v2/nodes
- body = {name:myName,parent_id:2000,type:0,roles:{categories:{[category_id]_[attribute_id]:Value goes here}}}

Example:
- POST api/v2/nodes
- body = {name:myName,parent_id:2000,type:0,roles:{categories:{15384_2:Value goes here}}}

V1 example to update a node that has this category already applied
Syntax
- PUT api/v1/nodes/{id}/categories/{categoryid}/
- body = {"category
id:[category_id],[categoryid][attributeid]:Value goes here"}

Example:
- PUT api/v1/nodes/{node
id}/categories/{categoryid}
- body = {"category
id:15384,153842:Value goes here"}

V2 example to update a node that has this category already applied
Syntax
- PUT api/v2/nodes/{id}/categories/{category
id}/
- body = {category_id:[categoryid], "[categoryid][attributeid]:Value goes here}

Example:
- PUT api/v2/nodes/{id}/categories/{category_id}
- body = {
categoryid:15384,153842:Value goes here}

Category with a Multi-Row Text Field Attribute (Category ID 15847)

The specification for the Text Field attribute is as follows:

{category_id}_{attribute_id}

This Category has one normal text field and a multi-row text field. It will appear as follows:

Category: [15847_1]
text_field_1: [15847_2]
text_field_multi(3 rows): [15847_3]

Even though it is a multi-row text field, its specification is the same as a single row attribute:

15847_3
To assign values to multi-row fields, the values for each row needs to be inside a list which is enclosed by square brackets:

[value 1,value 2,value 3,....]

V1 example to create a node with this category
Syntax
- POST api/v1/nodes
- body = {
name:myName,parentid:2000,type:0,roles:{categories:{[categoryid]:{[categoryid][attributeid]:[value 1,value 2,value 3, ....]}}}}

Example:
- Post api/v1/nodes
- body = {
name:myName,parent
id:2000,type:0,roles:{categories:{15847:{158473:[test1,test2,test3]}}}}

V2 example to create a node with this category
Syntax
- POST api/v2/nodes
- body = {
name:myName,parent
id:2000,type:0,roles:{categories:{[categoryid][attributeid]:[value 1,value 2,value 3, ....]}}}

Example:
- Post api/v2/nodes
- body = {
name:myName,parent
id:2000,type:0,roles:{categories:{158475:[test1,test2,test3"]}}}

V1 example to update a node that has this category already applied
Syntax
- PUT api/v1/nodes/{id}/categories/{category
id}/
- body = {category_id:[categoryid], "[categoryid][attributeid]:[value 1,value 2,value 3, ....]}

Example:
- PUT api/v1/nodes/{id}/categories/{category_id}
- body = {
categoryid:15847,158473:[value 1,value 2,value 3, ....]}

V2 example to update a node that has this category already applied
Syntax
- PUT api/v2/nodes/{id}/categories/{category_id}/
- body = {
categoryid":[categoryid], [category_id]_[attribute_id]:[value 1, value 2, value 3, ....]}

Example:
- PUT api/v2/nodes/{id}/categories/{categoryid}
- body = {"category
id:15847,158473:[value 1,value 2,value 3, ....]}

To update or set multiple fields at once, use a comma to separate them in the body
- body = {...
15847
2:text field 1,158473:[value 1,value 2,value 3", ....]}

Category with set that has one normal field (Category ID 15847)

The specification for an attribute inside of a Set is as follows:

{category
id}{setid}{setrow}{attributeid}

This Category has a normal text field, a multi-row text field, and a Set with one text field.

Category:[158471]
text
field1:[158472]
textfieldmulti(3 rows):[158473]
Set: [15847
4]
textfieldset: [15847415]

Set
id follows the same rules for attributeid. Setrow is used to identify different rows if there is more than one row. Since there can be multiple attributes per row, attributeid is used to identify different attributes. However, the attributeid here still follows the general rule for attributes which means they don't start from 1, rather they start from setid plus 1. In this example, the attribute ID is 5 since setid is 4. The specification for a Category with a set that has one row would be:

15847415

V1 example to create a node with this category
Syntax
- POST api/v1/nodes
- body = {name:myName,"parent
id:2000,type:0,roles:{categories:{[categoryid]:{[categoryid][setid][setrow][attributeid]:value goes here}}}}

Example:
- Post api/v1/nodes
- body = {
name:myName,parentid:2000,type:0,roles:{categories:{15847:{15847415:value goes here}}}}

V2 example to create a node with this category
Syntax
- POST api/v2/nodes
- body = {
name:myName,parentid:2000,type:0,roles:{categories:{[categoryid][setid][setrow][attributeid]:value goes here}}}

Example:
- Post api/v2/nodes
- body = {
name:myName,parentid:2000,type:0,roles:{categories:{15847415:value goes here}}}

V1 example to update a node that has this category already applied
Syntax
- PUT api/v1/nodes/{id}/categories/{category_id}/
- body = {
categoryid":[categoryid], [category_id]_[set_id]_[set_row]_[attribute_id]:value goes here}

Example:
- PUT api/v1/nodes/{nodeid}/categories/{categoryid}
- body = {category_id:15384, 15384_4_1_5:Value goes here}

V2 example to update a node that has this category already applied
Syntax
- PUT api/v2/nodes/{id}/categories/{categoryid}/
- body = {"category
id:[category_id],[categoryid][setid][setrow][attributeid]:value goes here"}

Example:
- PUT api/v2/nodes/{node
id}/categories/{categoryid}
- body = {"category
id:15384,15384415:Value goes here}

To update or set multiple fields at once, use a comma to separate them in the body
- body = {...
15847
2:text field 1,158473:[value 1,value 2,value 3", ....]}

Category with a Set that contains a multi-row field (Category ID 15847)

The specification for attributes inside of a Set is as follows:

{category
id}{setid}{setrow}{attributeid}

This Category has a normal text field, a multi-row text field, and a Set with one text field and one mutli-row field.

Category: [158471]
text
field1: [158472]
textfieldmulti(3 rows): [158473]
Set: [15847
4]
textfieldset: [15847415]
text
fieldsetmulti(3 rows): [15847416]

Set
id follows the same rules for attributeid. Setrow is used to identify different rows if there is more than one row. Since there can be multiple attributes per row, attributeid is used to identify different attributes. In this case it is 1. Attributes inside a Set follow the same rules and in this example, as it is the fifth attribute in this category, its id is 6. Therefore textfieldsetmulti's specification is:

15847416

V1 example to create a node with this category
Syntax
- POST api/v1/nodes
- body = {name:myName,"parent
id:2000,type:0,roles:{categories:{[categoryid]:{[categoryid][setid][setrow][attributeid]:[value 1,value 2,value 3, ....]}}}}

Example:
- Post api/v1/nodes
- body = {
name:myName,parentid:2000,type:0,roles:{categories:{15847:{15847416:[value 1,value 2,value 3, ....]}}}}

V2 example to create a node with this category
Syntax
- POST api/v2/nodes
- body = {
name:myName,parentid:2000,type:0,roles:{categories:{[categoryid][setid][setrow][attributeid]:[value 1,value 2,value 3, ....]}}}

Example:
- Post api/v2/nodes
- body = {
name:myName,parentid:2000,type:0,roles:{categories:{15847416:[value 1,value 2,value 3, ....]}}}

V1 example to update a node that has this category already applied
Syntax
- PUT api/v1/nodes/{id}/categories/{category_id}/
- body = {
categoryid":[categoryid], [category_id]_[set_id]_[set_row]_[attribute_id]:[value 1, value 2, value 3, ....]}

Example:
- PUT api/v1/nodes/{nodeid}/categories/{categoryid}
- body = {category_id:15384, 15384_4_1_6:[value 1, value 2, value 3, ....]}

V2 example to update a node that has this category already applied
Syntax
- PUT api/v2/nodes/{id}/categories/{categoryid}/
- body = {"category
id:[category_id],[categoryid][attributeid]:[value 1,value 2,value 3", ....]}

Example:
- PUT api/v2/nodes/{node
id}/categories/{categoryid}
- body = {"category
id:15384,15384416:[value 1,value 2,value 3, ....]}

- This example can be used to add and remove rows from a category attribute that has multiple rows
- To set the value for the first row as
value 1" and remove other rows:
- PUT api/v2/nodes/{node
id}/categories/{categoryid}
- body = {"category
id:15384,15384416:[value 1]}

- To put
value 1andvalue 2" into the first and second row:
- PUT api/v2/nodes/{node
id}/categories/{categoryid}
- body = {"category
id:15384,15384416:[value 1,value 2"]}

- The following example will return an error if the max limit of rows is 2:
- PUT api/v2/nodes/{node
id}/categories/{categoryid}
- body = {"category
id:15384,15384416:[value 1,value 2,value 3]}

To update or set multiple fields at once, use a comma to separate them in the body
- body = {...
15847
2:text field 1,158473:[value 1,value 2,value 3", ....]}

Category with a Set that has more than one row (Category ID 15847)

The specification for attributes inside of a Set is as follows:

{category
id}{setid}{setrow}{attributeid}

This Category contains a normal text field, a multi-row text field, and a Set that contains two rows with one text field and one mutli-row field.

Category: [158471]
text
field1: [158472]
textfieldmulti(3 rows): [158473]
Set: [15847
4]
- row 1
textfieldse: [15847415]
text
fieldsetmulti: [15847416]
- row 2
text
fieldset: [15847425]
textfieldsetmulti: [15847426]

Setid follows the same rules for attributeid. Setrow is used to identify different rows if there is more than one row. Since there can be multiple attributes per row, attributeid is used to identify different attributes. In this example it needs to refer to row 2, so setrow is 2. Attributes inside a Set follow the same rules and in this example, as it is the fifth attribute in this category, its id is 6. Therefore textfieldsetmulti's specification is:

15847416

V1 example to create a node with this category
Syntax
- POST api/v1/nodes
- body = {name:myName,"parent
id:2000,type:0,roles:{categories:{[categoryid]:{[categoryid][setid][setrow][attributeid]:[value 1,value 2,value 3, ....]}}}}

Example:
- Post api/v1/nodes
- body = {
name:myName,parentid:2000,type:0,roles:{categories:{15847:{15847426:[value 1,value 2,value 3, ....]}}}}

V2 example to create a node with this category
Syntax
- POST api/v2/nodes
- body = {
name:myName,parentid:2000,type:0,roles:{categories:{[categoryid][setid][setrow][attributeid]:[value 1,value 2,value 3, ....]}}}

Example:
- Post api/v2/nodes
- body = {
name:myName,parentid:2000,type:0,roles:{categories:{15847426:[value 1,value 2,value 3, ....]}}}

V1 example to update a node that has this category already applied

Syntax
- PUT api/v1/nodes/{id}/categories/{category_id}/
- body = {
categoryid":[categoryid], [category_id]_[set_id]_[set_row]_[attribute_id]:[value 1, value 2, value 3, ....]}

Example:
- PUT api/v1/nodes/{nodeid}/categories/{categoryid}
- body = {category_id:15384, 15384_4_2_6:[value 1, value 2, value 3, ....]}

V2 example to update a node that has this category already applied
Syntax
- PUT api/v2/nodes/{id}/categories/{categoryid}/
- body = {"category
id:[category_id],[categoryid][attributeid]:[value 1,value 2,value 3", ....]}

Example:
- PUT api/v2/nodes/{node
id}/categories/{categoryid}
- body = {"category
id:15384,15384426:[value 1,value 2,value 3, ....]}

To update or set multiple fields at once, use a comma to separate them in the body
- body = {...
15847
425:text field set in row 2,15847426:[value 1,value 2,value 3", ....]}

Category with Disable Inheritance Attribute (Category ID: 15847)

The specification for the Disable Inheritance attribute is as follows:

{category
id}inheritance

The category will look like this:

Category: [15847
1]
textfield1: [158472]
disable
inheritance: [15847inheritance]

{category
id}inheritance is a boolean attribute and used to enable/disable the Disable Inheritance feature of a category. This attribute cannot be applied alone and requires at least one more category attribute to be specified with it. As shown in the example above a text attribute is also applied in addition to the disabled inheritance attribute. By default, {categoryid}inheritance attribute is disabled for a category applied to a node.

The specification for the Disable Inheritance attribute would be:

15847
inheritance

V1 example to create a node with this category

Syntax
- POST api/v1/nodes
- body = {name:myName,parent_id:2000,type:0,roles:{categories:{[category_id]:{[category_id]_[attribute_id]:Value goes here, [category_id]_inheritance: true/false}}}}

Example:
- Post api/v1/nodes
- body = {name:myName,parent_id:2000,type:0,roles:{categories:{15384:{15384_2:test, 15384_inheritance: false}}}}

V2 example to create a node with this category
Syntax
- POST api/v2/nodes
- body = {name:myName,parent_id:2000,type:0,roles:{categories:{[category_id]_[attribute_id]:Value goes here, [category_id]_inheritance: true/false}}}

Example:
- POST api/v2/nodes
- body = {name:myName,parent_id:2000,type:0,roles:{categories:{15384_2:test, 15384_inheritance: false}}}

V1 example to copy a node that has this category applied
Syntax
- POST api/v1/nodes
- body = {original_id:15847,parent_id:2000,name:myName,roles:{categories:{[category_id]:{[category_id]_[attribute_id]:Value goes here, [category_id]_inheritance: true/false}}}}

Example:
- POST api/v1/nodes
- body = {original_id:15847,parent_id:2000,name:myName,roles:{categories:{[category_id]:{15384_2:test, 15384_inheritance: true}}}}

V2 example to copy a node that has this category applied
Syntax
- PUT api/v2/nodes
- body = {original_id:15847,parent_id:2000,name:myName,roles:{categories:{[category_id]_[attribute_id]:Value goes here, [category_id]_inheritance: true/false}}}

Example:
- PUT api/v2/nodes
- body = {original_id:15847,parent_id:2000,name:myName,roles:{categories:{15384_2:test, 15384_inheritance: true}}}

Authentication

  1. v1-nodes-{id}-content - Get content with a specified filename GET {{baseUrl}}/v1/nodes/:id/content/:filename?action=aliquip aute&suppress_response_codes=irure labore Duis dolor ea

  2. v1-forms-nodes-versions - Alpaca form for updating a version on a node GET {{baseUrl}}/v1/forms/nodes/versions/update?id=-11141396&version_number=-11141396&suppress_response_codes=irure labore Duis dolor ea

  3. v1-validation/nodes - Check for name collisions POST {{baseUrl}}/v1/validation/nodes/names

  4. v2-nodes-{id}-permissions-owner - Update or Restore the owner permissions PUT {{baseUrl}}/v2/nodes/:id/permissions/owner?suppress_response_codes=irure labore Duis dolor ea

  5. v2-search-template-settings/display - Sets Display Options from the user's default template PUT {{baseUrl}}/v2/search/template/settings/display

  6. v2-nodes-{id}-permissions-public - Get public access permissions GET {{baseUrl}}/v2/nodes/:id/permissions/public?fields=aliquip aute&expand=aliquip aute&metadata=irure labore Duis dolor ea&suppress_response_codes=irure labore Duis dolor ea

  7. v2-nodes-{id}-permissions - Get all node permissions GET {{baseUrl}}/v2/nodes/:id/permissions?page=-11141396&limit=-11141396&fields=aliquip aute&expand=aliquip aute&metadata=irure labore Duis dolor ea&suppress_response_codes=irure labore Duis dolor ea

  8. v2 - Export System Settings to a report file GET {{baseUrl}}/v2/export/system/settings?includeDefaults=true&fileFormat=aliquip aute

  9. v2-nodes-{id}-categories - Apply a category to a node POST {{baseUrl}}/v2/nodes/:id/categories

  10. v2-nodes-{id}-permissions-group - Get owner group permissions GET {{baseUrl}}/v2/nodes/:id/permissions/group?fields=aliquip aute&expand=aliquip aute&metadata=irure labore Duis dolor ea&suppress_response_codes=irure labore Duis dolor ea