REST API End Points - Documentation topics on: apis,end point,java api,jersey,rest,.

This documentation is a static copy for this version. For current documentation, see: http://dotcms.com/docs/latest

REST API End Points

This document lists all of the publicly exposed end points in the dotCMS code base.

Important Notes:

  • Although some of these methods (e.g. HTTP GET methods) may be accessed via a URL, the ideal way of accessing them is through the dotCMS back-end, since some of them depend on values associated with a form, or HTML request or session values.
    • Accessing some of these end-points via a URL will cause an error, unless an appropriate tool (e.g. curl) is used to supply the appropriate data to the request or session object.
  • End-points which are intended to be accessible from a URL (e.g. end-points using HTTP GET methods) include a demo Link next to the method Description and Example.
    • These demo links run against the dotCMS Demo Site to demonstrate use of the end point.
  • Many of these end-points require appropriate Permissions on the dotCMS site to work.
    • These end-points - and any demo Links in the tables below - will fail if you do not first login to the site.
    • To enable the demo Links below, you can login to the dotCMS Demo Site with the user name admin and password admin.
  • Even for end-points that cannot be accessed via a URL, the URL is provided so that developers can easily look for the Javascript code that is making the Ajax call to the exposed back-end services.
    • If it’s not possible to get to any end-point through the dotCMS UI, you can use the Postman Chrome extension to access the end-points directly, when possible.

For more information on how to call each of the APIs, please see Calling the API below, and refer to the example provided for the specific API call.

Calling the API

There are two sections of the dotCMS REST API: The Original API and New API. The URL format used to call the API varies for each section of the API and each call, as outlined for each class below. With new versions of dotCMS, all new REST API endpoints will use the New REST API URL format.

Original API

Calls to the Original API are made in the following form:

http://host.domain/api/api_name/api_call/arguments

New API

Calls to the New API are made in similar form, except:

  • The New API requires specification of the API version (current version is /v1).
  • The New API calls often allow more specific identification of the system objects being referenced, in a standard form that follows the path of the class being referenced:
http://host.domain/api**/v1**/api_path/api_name/api_call/arguments

Documentation Conventions

Please note the following for each of the API paths and examples below:

  • The api_path, api_name, and api_call values vary for each API call, and are shown in red in each of the specific examples below.
  • Values displayed in green italics in the below examples should be replaced with specific values for your desired call.

Original REST API

The following classes use the traditional calling conventions of the Original REST API. Most of these methods are supported in earlier version of dotCMS (dotCMS release 3.3 and below). For the specific methods available, see the documentation for each specific class.

com/dotcms/rest/AuditPublishingResource.java

End PointHTTP
Method
Description and ExampleLogin
Required
getGETUsed by the sending server to request a status update from the receiver.
/api/auditPublishing/get/{BUNDLE ID}
Yes

com/dotcms/rest/BaseRestPortlet.java

End PointHTTP
Method
Description and ExampleLogin
Required
getLayoutGET
/api/layout/getLayout
Yes

com/dotcms/rest/BundlePublisherResource.java

End PointHTTP
Method
Description and ExampleLogin
Required
publishPOSTCreate a bundle and publish it. Waits for the process to start before returning.
/api/bundlePublisher/publish
Yes

com/dotcms/rest/BundleResource.java

End PointHTTP
Method
Description and ExampleLogin
Required
getUnsendBundlesGETDisplay a list of bundles that have not yet been sent.
/api/bundle/getunsendbundles/userid/{USER ID}
Yes
updateBundleGETChange the name of a bundle.
/api/bundle/updatebundle/bundleid/{BUNDLE ID}?bundleName=newname
Yes
deletePushHistoryGETDelete the Push History for a piece of Content.
/api/bundle/deletepushhistory/assetid/{ASSET ID}
Yes
deleteEnvironmentPushHistoryGETDelete the Push History for an entire Publishing environment
/api/bundle/deleteenvironmentpushhistory/environmentid/{ENVIRONMENT ID}
Yes

com/dotcms/rest/CMSConfigResource.java

End PointHTTP
Method
Description and ExampleLogin
Required
saveCompanyBasicInfoPOSTSave the company Basic Information.
/api/config/saveCompanyBasicInfo
Yes
saveCompanyLocaleInfoPOSTSave the company Locale info.
/api/config/saveCompanyLocaleInfo
Yes
saveCompanyAuthTypeInfoPOSTSave the company authorization info.
/api/config/saveCompanyAuthTypeInfo
Yes
saveCompanyLogoPOSTUpload a new company logo image.
/api/config/saveCompanyLogo
Yes
deleteEnvironmentPOSTDelete a publishing environment.
/api/config/deleteEnvironment
Yes
deleteEndpointPOSTDelete an endpoint from a publishing environment.
/api/config/deleteEndpoint
Yes

com/dotcms/rest/ContentResource.java

End PointHTTP
Method
Description and ExampleLogin
Required
indexSearchGETPerform an ElasticSearch query and return the results.
/api/content/indexsearch/+structurename:webpagecontent/sortby/modDate/limit/20/offset/0
No
indexCountGETCount the number of results returned in an ElasticSearch query.
/api/content/indexcount/+structurename:webpagecontent
No
lockContentPUTLock a piece of content, specified by inode.
/api/content/lock/inode/{CONTENT INODE}
Yes
canLockPUTReturns whether the content can be locked (by the logged in user).
/api/content/canlock/inode/{CONTENT INODE}
Yes
unlockContentPUTUnlock a piece of content, specified by inode.
/api/content/unlock/inode/{CONTENT INODE}
Yes
getContentGETRetrieve content using an ElasticSearch query.
/api/content/render/false/query/+contentType:webPageContent%20+(conhost:48190c8c-42c4-46af-8d1a-0cd5db894797%20conhost:SYSTEM_HOST)%20+languageId:1%20+deleted:false%20+working:true/orderby/modDate%20desc
No
multipartPUTPUTCreate new content on your dotCMS site.
For a detailed example of using a multipartPOST, please see the Content API - JSON & Binary Submit documentation, and replace "POST" with "PUT".
Yes
multipartPOSTPOSTCreate new content on your dotCMS site.
For a detailed example of using a multipartPUT, please see the Content API - JSON & Binary Submit documentation.
Yes
singlePUTPUTCreate new content on your dotCMS site.
/api/content/save/1
/api/content/publish/1
/api/content/[Workflow Action Name][/wfActionComments/{COMMENT}][/wfActionAssign/{USER ID}]
For a detailed example of using a singlePUT, please see the Save Content Using REST API documentation.
Yes
singlePOSTPOSTCreates new content on your dotCMS site.
/api/content/save/1
/api/content/publish/1
/api/content/[Workflow Action Name][/wfActionComments/{COMMENT}][/wfActionAssign/{USER ID}]
For a detailed example of using a singlePOST, please see the Save Content Using REST API documentation, and replace -XPUT with -XPOST.
Yes

com/dotcms/rest/EnvironmentResource.java

End PointHTTP
Method
Description and ExampleLogin
Required
loadEnvironmentsGETReturn a JSON representation of the environments (with servers) that the Role with the given roleid can push to.
/api/environment/loadenvironments/roleId/{ROLE ID}/
Yes

com/dotcms/rest/JSPPortlet.java

End PointHTTP
Method
Description and ExampleLogin
Required
layoutGetGET
/api/portlet//
Yes
layoutPostPOST
/api/portlet//
Yes

com/dotcms/rest/LicenseResource.java

End PointHTTP
Method
Description and ExampleLogin
Required
getAllGETRetrieve the license info (the contents of the License Manager screen).
/api/license/all/
Yes
putZipFilePOSTUpload a license pack.
/api/license/upload/
Yes
deleteDELETEDelete one of the available licenses in a license pack.
/api/license/delete/id/{LICENSE ID}
Yes
pickLicensePOSTSelect one of the available licenses from a (already uploaded) license pack.
/api/license/pick/serial/{LICENSE ID}
Yes
freeLicensePOSTUnlock an already picked license from a license pack.
/api/license/free/serial/{LICENSE ID}/serverid/{SERVER ID}/
Yes
requestLicensePOSTRequest a trial license.
/api/license/requestCode/
Yes
applyLicensePOSTApply a license key received from dotCMS or downloaded from the dotCMS support portal.
/api/license/applyLicense/serial/{LICENSE ID}
Yes
resetLicensePOSTReset License Identity.
/api/license/resetLicense/
Yes

com/dotcms/rest/NotificationResource.java

End PointHTTP
Method
Description and ExampleLogin
Required
getNotificationsGETRetrieve the notifications available.
/api/notification/getNotifications/allusers/{TRUE or FALSE}/
Yes
getNewNotificationsCountGETRetrieve the count of new Notifications Note: This is refreshed (and cleared) every 5 seconds.
/api/notification/getNewNotificationsCount/allusers/{TRUE or FALSE}/
Yes

com/dotcms/rest/OSGIResource.java

End PointHTTP
Method
Description and ExampleLogin
Required
getNotificationsGETList Loaded OSGI Plugins.
/api/osgi/getInstalledBundles/ignoreSystemBundles/true/type/json
Yes

com/dotcms/rest/RestExamplePortlet.java

End PointHTTP
Method
Description and ExampleLogin
Required
loadJsonGETDisplay the REST API JSON example code (available from “Rest Example Portlet”).
/api/restexample/test/
No

com/dotcms/rest/RoleResource.java

End PointHTTP
Method
Description and ExampleLogin
Required
loadchildrenGETDisplay child Roles.
/api/role/loadchildren/
Yes
loadbyidGETLoad a Role by the Role ID.
/api/role/loadbyid/id/{ROLE ID}/r/8026756389329
Yes
loadbynameGETLoad a Role by the Role name.
/api/role/loadbyname/name/{ROLE NAME}/
Yes

com/dotcms/rest/RulesEnginePortlet.java

No methods available.

com/dotcms/rest/StructureResource.java

End PointHTTP
Method
Description and ExampleLogin
Required
getStructuresWithWYSIWYGFieldsGETList structures that contain WYSIWYG fields.
/api/structure/
Yes

com/dotcms/rest/TagResource.java

End PointHTTP
Method
Description and ExampleLogin
Required
listGETList tags added to the Visitor object.
/api/v1/tags
No

com/dotcms/rest/UserResource.java

End PointHTTP
Method
Description and ExampleLogin
Required
getloggedinuserGETDeprecated
Get the currently logged in user.
/api/user/getloggedinuser

Note: This returns the same information (in a different order) as the current method of the New REST API UserResource.java class.
Yes

com/dotcms/rest/UtilResource.java

Please see UserResource, above.

com/dotcms/rest/WidgetResource.java

End PointHTTP
Method
Description and ExampleLogin
Required
getWidgetGET
/api/widget/id/{WIDGET ID}
No

New REST API

The following classes use the new calling conventions of the Rules REST API. For the specific methods available, see the documentation for each specific class.

End PointHTTP
Method
Description and ExampleLogin
Required
getMenusGETGet the layout menus and sub-menus that the logged in user has access to.
Note: This API is intended for internal dotCMS use only, and results are returned as application/javascript.
/api/v1//menu
Yes

com/dotcms/rest/api/v1/personas/PersonaResource.java

End PointHTTP
Method
Description and ExampleLogin
Required
listGETList all Personas on a site.
Note: The site ID is read from the com.dotmarketing.session_host session key.
/api/v1/personas
Yes

com/dotcms/rest/api/v1/sites/ruleengine/rules/actions/ActionResource.java

End PointHTTP
Method
Description and ExampleLogin
Required
selfGETRetrieve information about an Action on a site.
/api/v1/sites/{SITE ID}/ruleengine/actions/{ACTION ID}
Yes
addPOSTAdd an Action to a site.
/api/v1/sites/{SITE ID}/ruleengine/actions
Yes
updatePUTUpdate an Action on a site.
/api/v1/sites/{SITE ID}/ruleengine/actions/{ACTION ID}
Yes
removeDELETEDelete an Action from a site.
/api/v1/sites/{SITE ID}/ruleengine/actions/{ACTION ID}
Yes

For more information on these end points, please see the Actions REST API documentation.

com/dotcms/rest/api/v1/sites/ruleengine/rules/conditions/ConditionGroupResource.java

End PointHTTP
Method
Description and ExampleLogin
Required
listGETList Conditions groups for a Rule.
/api/v1/sites/{SITE ID}/ruleengine/rules/{RULE ID}/conditionGroups
Yes
selfGETRetrieve information about a Condition group.
/api/v1/sites/{SITE ID}/ruleengine/rules/{RULE ID}/conditionGroups/{CONDITION GROUP ID}
Yes
addPOSTAdd a Condition group to a Rule.
/api/v1/sites/{SITE ID}/ruleengine/rules/{RULE ID}/conditionGroups
Yes
updatePUTUpdate a Condition Group in a Rule.
/api/v1/sites/{SITE ID}/ruleengine/rules/{RULE ID}/conditionGroups/{CONDITION GROUP ID}
Yes
removeDELETERemove a Condition group from a Rule.
/api/v1/sites/{SITE ID}/ruleengine/rules/{RULE ID}/conditionGroups/{CONDITION GROUP ID}
Yes

For more information on these end points, please see the Conditions REST API documentation.

com/dotcms/rest/api/v1/sites/ruleengine/rules/conditions/ConditionResource.java

End PointHTTP
Method
Description and ExampleLogin
Required
selfGETRetrieve information about a Condition on a site.
/api/v1/sites/{SITE ID}/ruleengine/conditions/{CONDITION ID}
Yes
addPOSTAdd a Condition to a site.
/api/v1/sites/{SITE ID}/ruleengine/conditions
Yes
updatePUTUpdate a Condition on a site.
/api/v1/sites/{SITE ID}/ruleengine/conditions/{CONDITION ID}
Yes
removeDELETEDelete a Condition from a site.
/api/v1/sites/{SITE ID}/ruleengine/conditions/{CONDITION ID}
Yes

For more information on these end points, please see the Conditions REST API documentation.

com/dotcms/rest/api/v1/sites/ruleengine/rules/conditions/ConditionValueResource.java

End PointHTTP
Method
Description and ExampleLogin
Required
listGETList values of a Condition.
/api/v1/sites/{SITE ID}/ruleengine/conditions/{CONDITION ID}/conditionValues
Yes
selfGETRetrieve information about a specific Condition value.
/api/v1/sites/{SITE ID}/ruleengine/conditions/{CONDITION ID}/conditionValues/{CONDITION VALUES ID}
Yes
addPOSTAdd a value to a Condition.
/api/v1/sites/{SITE ID}/ruleengine/conditions/{CONDITION ID}/conditionValues
Yes
updatePUTUpdate the a Condition value.
/api/v1/sites/{SITE ID}/ruleengine/conditions/{CONDITION ID}/conditionValues/{CONDITION VALUES ID}
Yes
removeDELETERemove a value from a Condition.
/api/v1/sites/{SITE ID}/ruleengine/conditions/{CONDITION ID}/conditionValues/{CONDITION VALUES ID}
Yes

com/dotcms/rest/api/v1/sites/ruleengine/rules/RuleResource.java

End PointHTTP
Method
Description and ExampleLogin
Required
listGETList all Rules.
/api/v1/sites/{SITE ID}/ruleengine/rules
Yes
selfGETRetrieve information about an individual Rule.
/api/v1/sites/{SITE ID}/ruleengine/rules/{RULE ID}
Yes
addPOSTAdd a Rule.
/api/v1/sites/{SITE ID}/ruleengine/rules
Yes
updatePUTEnable or disable a Rule.
/api/v1/sites/{SITE ID}/ruleengine/rules/{RULE ID}
Yes
removeDELETERemove a Rule.
/api/v1/sites/{SITE ID}/ruleengine/rules/{RULE ID}
Yes

com/dotcms/rest/api/v1/system/i18n/I18NResource.java

End PointHTTP
Method
Description and ExampleLogin
Required
listGETRetrieve the value of the specified language variable for the specified language or country.
/api/v1/system/i18n/{LANGUAGE OR COUNTRY CODE}/{LANGUAGE KEY}
No

com/dotcms/rest/api/v1/system/role/RoleResource.java

End PointHTTP
Method
Description and ExampleLogin
Required
checkuserrolesGETList all Roles of the currently logged in user.
/api//v1/roles/checkuserroles/userid/{USER ID}/roleids/{ROLE ID}
Yes

com/dotcms/rest/api/v1/system/ruleengine/actionlets/ActionletsResource.java

End PointHTTP
Method
Description and ExampleLogin
Required
listGETList all available Actionlets.
/api/v1/system/ruleengine/actionlets
Yes

com/dotcms/rest/api/v1/system/ruleengine/conditionlets/ConditionletsResource.java

End PointHTTP
Method
Description and ExampleLogin
Required
listGETList all available Conditionlets.
/api/v1/system/ruleengine/conditionlets
Yes

com/dotcms/rest/api/v1/users/UserResource.java

End PointHTTP
Method
Description and ExampleLogin
Required
currentGETGet the currently logged in user.
/api/v1/users/current
Yes
currentPUTChanges field values for the currently logged in user.
/api/v1/users/current
Yes
filterGETReturns a list of dotCMS users based on the specified search criteria.
/api/users/filter/{Parameters}
Yes
loginasPUTLogin as a specific user account.
/api/user/loginas/userid/{USER ID}
/api/user/loginas/userid/{USER ID}/pwd/{PASSWORD}
Yes
logoutasPUTEnd current “Login as” session (logout from specific user account).
/api/v1/users/logoutas
Yes

com/dotcms/rest/api/v1/contenttype/ContentTypeResource.java

End PointHTTP
Method
Description and ExampleLogin
Required
currentGETGet a Content Type:
/api/v1/contenttype//id/{typeId}
Yes
addPOSTCreates a Content Type of the type specified in a json file being passed to the API:
/api/v1/contenttype/
Yes
currentPUTUpdates a Content Type of the type specified in a json file being passed to the API:
/api/v1/contenttype//id/{typeId}
Yes
removeDELETEDeletes the specified Content Type (by identifier):
/api/v1/contenttype//id/{typeId}
Yes

com/dotcms/rest/api/v1/contenttype/FieldResource.java

End PointHTTP
Method
Description and ExampleLogin
Required
currentGETLists all fields of given content type:
/api/v1/contenttype/{typeId}/fields
Yes
currentGETRetrieves a specific field by ID, and returns all the properties of the field:
/api/v1/contenttype/{typeId}/fields/id/{fieldID}
Yes
currentGETRetrieves a specific field by Variable, and returns all the properties of the field:
/api/v1/contenttype/{typeId}/fields/var/{fieldVar}
Yes
addPOSTCreates a field of the type specified in a json file being passed to the API:
/api/v1/contenttype/{typeId}/fields
Yes
currentPUTUpdates a field of the type specified in a json file being passed to the API
/api/v1/contenttype/{typeId}/fields/id/{fieldID}
Yes
removeDELETEDeletes the field specified by variable, from the specified Content Type (by identifier):
/api/v1/contenttype/{typeId}/fields/id/{fieldID}
Yes
removeDELETEDeletes the field specified by variable, from the specified Content Type (by identifier):
/api/v1/contenttype/{typeId}/fields/var/{fieldVar}
Yes

com/dotcms/rest/api/v1/contenttype/FieldVariableResource.java

End PointHTTP
Method
Description and ExampleLogin
Required
currentGETLists all Field Variables of a Field (by identifier), on a given Content Type:
/api/v1/contenttype//fields/id/{fieldId}/variables
Yes
currentGETLists all Field Variables of a Field (by variable), on a given Content Type:
/api/v1/contenttype//fields/var/{fieldVar}/variables
Yes
currentGETRetrieves a Field Variable, after passing the Field Variable ID and the Field ID:
/api/v1/contenttype//fields/id/{fieldId}/variables/id/{fieldVarId}
Yes
currentGETRetrieves a Field Variable, after passing the Field Variable ID and the variable of the Field:
/api/v1/contenttype/{typeId}/fields/var/{fieldVar}/variables/id/{fieldVarId}
Yes
addPOSTCreates a Field Variable of the type specified in a json file being passed to the API (by Field ID):
/api/v1/contenttype/{typeId}/fields/id/{fieldId}/variables
Yes
addPOSTCreates a Field Variable of the type specified in a json file being passed to the API (by Field Var):
/api/v1/contenttype/{typeId}/fields/var/{fieldVar}/variables
Yes
currentPUTUpdates a Field Variable of the type specified in a json file being passed to the API (by Field ID and Field Variable ID):
/api/v1/contenttype/{typeId}/fields/id/{fieldId}/variables/id/{fieldVarId}
Yes
currentPUTUpdates a field of the type specified in a json file being passed to the API (by variable of the Field and Field Variable ID):
/api/v1/contenttype/{typeId}/fields/var/{fieldVar}/variables/id/{fieldVarId}
Yes
removeDELETEDeletes the Field Variable specified by Field Variable identifier and the Field Identifier, from the specified Content Type (by identifier):
/api/v1/contenttype/{typeId}/fields/id/{fieldId}/variables/id/{fieldVarId}
Yes
removeDELETEDeletes the Field Variable specified by Field Variable identifier and the Field Variable, from the specified Content Type (by identifier):
/api/v1/contenttype/{typeId}/fields/var/{fieldVar}/variables/id/{fieldVarId}
Yes