Oracle WebCenter Sites provides a REST API for accessing WebCenter Sites data. REST services are supported on both WebCenter Sites and Satellite Server to leverage the Satellite Server cache.
This chapter contains the following sections:
The default location of REST resources is under the WebCenter Sites BaseURI
:
<protocol>://<hostname:port>/<servletPath>/REST/
For example, on a local installation the BaseURI
could be the following:
http://localhost:<port>/cs/REST/
The <BaseURI>/application.wadl
file lists the resources described in this reference.
This section lists supported REST resources and methods, including requirements and error codes that can be returned if a resource does not exist or unforeseen errors occur.
Each resource has two types of views: list and detail. The list view lists resources of a given type (users
for example) and for each resource, an href
pointing to the detailed view. For example, the resource <BaseURI>/users
returns a list view naming all users in the system, among them fwadmin
.
<users> <href>http://<hostname>:<port>/cs/REST/users/fwadmin</href> <name>fwadmin</name> </users>
The fwadmin
entry contains an <href>
that specifies the URL of the detail view where more information about fwadmin
can be found.
The following is a list of REST resource security requirements:
Except for /timezone
and /userlocales
, all other REST resources are protected. For information about REST resource security, see the Oracle Fusion Middleware WebCenter Sites Developer's Guide and the Oracle Fusion Middleware WebCenter Sites Administrator's Guide.
By default, if an authorization failure occurs, then the login page for Central Authentication Service (CAS) is displayed. If you want to receive a 500
error instead, add auth-redirect=false
to the URL when making the request.
To authenticate all REST POST
/PUT
/DELETE
requests as valid, each request requires a header with X-CSRF-Token
as the key and a value of either a CAS ticket (multi or single) or a sessionid
.
The rest of this section contains information about the following resources:
All Asset Types | /types |
---|---|
Description |
This resource reads the list of asset types in the system. |
REST Methods |
|
Possible Error Codes |
|
Selected Asset Type | /types/{assettype} |
---|---|
Description |
This resource displays detailed information about the specified asset type. |
REST Methods |
|
Possible Error Codes |
|
All Subtypes | /types/{assettype}/subtypes |
---|---|
Description |
This resource reads all subtypes of the specified asset type. |
REST Methods |
|
Possible Error Codes |
|
Selected Subtype | /types/{assettype}/subtypes/{subtype} |
---|---|
Description |
This resource reads the specified subtype of the specified asset type. |
REST Methods |
|
Possible Error Codes |
|
Site-Enabled Asset Types | /sites/{sitename}/types |
---|---|
Description |
This resource lists all asset types on the specified site. |
REST Methods |
|
Possible Error Codes |
|
Site-Specific Asset Type Search | /sites/{sitename}/types/{assettype}/search |
---|---|
Description |
This resource supports searches on the specified asset type on the specified site. Note: Access to any search is provided by granting |
REST Methods |
|
Possible Error Codes |
|
Global Asset Type Search | /types/{assettype}/search |
---|---|
Description |
This resource supports searches on the specified asset type. For this resource to work, the asset type index must be configured in WebCenter Sites (otherwise, an exception is thrown and the 404 error code is displayed to the user). Note: Access to any search is provided by granting |
Query Parameters |
Example: http://<hostname>:<port>/cs/REST/types/Content_ C/search?field:name:contains=FSII&startindex=5&count=3 |
REST Methods |
|
Possible Error Codes |
|
All Asset Associations, Selected Site | /sites/{sitename}/types/{assettype}/assets/{id}/associations |
---|---|
Description |
This resource lists all asset associations on the specified site. |
REST Methods |
|
Possible Error Codes |
|
Site-Specific Assets Search | /sites/{sitename}/search |
---|---|
Description |
This resource supports searches on all assets on the specified site. Note: Access to any search is provided by granting |
REST Methods |
|
Possible Error Codes |
|
Global Assets Search | /search |
---|---|
Description |
This resource supports global searches on assets. Note: REST does not restrict the types of assets that are returned. As a result, assets of a certain type can be returned to a user who may otherwise not have permission to access the asset type. Note: Access to any search is provided by granting |
Query Parameters |
Example: http://<hostname>:<port>/cs/REST/types/Content_ C/search?field:name:contains=FSII&startindex=5&count=3 |
REST Methods |
|
Possible Error Codes |
|
Indexing Configurations | /indexes |
---|---|
Description |
This resource lists configurations for global and asset type-based indexing. Global indexing produces a single index of asset types. Asset type indexing produces one index per asset type. |
REST Methods |
|
Possible Error Codes |
|
Indexing Configuration | /indexes/{source} |
---|---|
Description |
This resource supports the configuration of global indexing and provides Note: In this resource's URL, source is either |
REST Methods |
|
Possible Error Codes |
|
All Sites | /sites |
---|---|
Description |
This resource lists all sites in the system. |
REST Methods |
|
Possible Error Codes |
|
Selected Site | /sites/{sitename} |
---|---|
Description |
This resource provides developers with CRUD functions for operating on the specified site. To perform CRUD operations on a site, the user must have either the GeneralAdmin or SiteAdmin role on that site in addition to the privileges granted via groups. To manage AdminSite, a user must have the GeneralAdmin role. |
REST Methods |
|
Possible Error Codes |
|
Publication Node | /sites/{sitename}/navigation |
---|---|
Description |
This resource reads the Site Plan tree for the site specified by
For more information about the Site Plan tree, see the Oracle Fusion Middleware WebCenter Sites Developer's Guide. |
REST Methods |
|
Possible Error Codes |
|
Page Node | /sites/{sitename}/navigation/{pageid} |
---|---|
Description |
This resource reads the Site Plan sub-tree for the site specified by
Default value: Accepted values: Integers or the string For more information about the Site Plan tree, see the Oracle Fusion Middleware WebCenter Sites Developer's Guide. |
REST Methods |
|
Possible Error Codes |
|
All Roles | /roles |
---|---|
Description |
This resource reads the list of roles that are stored in the system. |
REST Methods |
|
Possible Error Codes |
|
Selected Role | /roles/{rolename} |
---|---|
Description |
This resource provides |
REST Methods |
|
Possible Error Codes |
|
All Applications | /applications |
---|---|
Description |
This resource lists registered applications. |
REST Methods |
|
Possible Error Codes |
|
Selected Application | /applications/{applicationid} |
---|---|
Description |
This resource registers the specified application by performing CRUD operations on the application's |
REST Methods |
|
Possible Error Codes |
|
All Users | /users |
---|---|
Description |
This resource lists all users that are defined in the system. |
REST Methods |
|
Possible Error Codes |
|
Selected User | /users/{username} |
---|---|
Description |
This resource provides The "otherAttributes" field provides placeholders for custom user attributes, which you define when creating a WebCenter Sites user either in LDAP or in the WebCenter Sites database. (Note that for LDAP, each user will be a descendant of the value that is specified for the Regardless of where custom user attributes are created, to take effect in the WebCenter Sites application they need to be specified in the WebCenter Sites requiredPeopleAttrs= attribute1=description1&attribute2=description2 The key is the attribute name as it appears in the WebCenter Sites database (or in LDAP), and the value is the attribute's description as it appears in the WebCenter Sites interface. The property will be looked up by both the WebCenter Sites Admin interface and REST API in defining user attributes. |
Description (continued) |
For example, if you want to specify two attributes called "Phone number" and "Fax" for all users, do the following:
<otherAttributes> <name>phone</name> <value>12345678</value> </otherAttributes> <otherAttributes> <name>fax</name> <value>23456789</value> </otherAttributes> |
REST Methods |
|
Possible Error Codes |
|
All Site Users | /sites/{sitename}/users |
---|---|
Description |
This resource lists the roles of all users on the specified site. |
REST Methods |
|
Possible Error Codes |
|
Selected Site User | /sites/{sitename}/users/{username} |
---|---|
Description |
This resource lists the roles of the specified user on the specified site and supports the REST methods listed below. |
REST Methods |
|
Possible Error Codes |
|
The /userlocales
resource is not protected
User Locales | /userlocales |
---|---|
Description |
This resource lists all locales that are defined in the system. |
REST Methods |
|
Possible Error Codes |
|
User Def | /userdef |
---|---|
Description |
This resource reads attributes in the user profile. When the database is used for authentication, only the WebCenter Sites predefined user attributes are returned. If LDAP is used, the service returns the attributes that are defined in the |
REST Methods |
|
Possible Error Codes |
|
ACLs | /acls |
---|---|
Description |
This resource lists all ACLs that are defined in WebCenter Sites. |
REST Methods |
|
Possible Error Codes |
|
All Groups | /groups |
---|---|
Description |
This resource lists all REST security groups in the system. |
REST Methods |
|
Possible Error Codes |
|
Selected Group | /groups/{groupname} |
---|---|
Description |
This resource provides the security privilege configuration of the specified group. |
REST Methods |
|
Possible Error Codes |
|
The /timezone
resource is not protected.
Time Zone | /timezone |
---|---|
Description |
This resource returns the server's time zone. |
REST Methods |
|
Possible Error Codes |
|
Current Device Information | /currentdevice |
---|---|
Description |
This service retrieves the device information from the For example: Input to the service is User-Agent header. Behavior of service for different cases - Case 1) User-Agent is present in device repository and a) User-Agent matches to a device group - Result: A DeviceBean with following info is returned - DeviceBean { Name of device; User Agent of device; DeviceGroupBean; //A bean representing a matching device group, with details such as name, suffix, priority. DeviceCapabilitiesBean; //A bean representing all device capabilities as present in current device repository. } b) User-Agent does not match to any device group - Result: A DeviceBean with name of device as present in repository, its capabilities as DeviceCapabilitiesBean and matching device group as default one i.e. Desktop device group. Case 2) User-Agent is NOT present in device repository(In which case DeviceCapabilitiesBean will not be returned, as capabilities are read from device repository) and |
Description (continued) |
a) User-agent matches to a device group based on user-agent regular expression as a criteria defined in some Device Group - Result: A DeviceBean with name as 'Unknown Device',its user-agent and a DeviceGroupBean with info about matched DeviceGroup. NO DeviceCapabilitiesBean. b) User-Agent does not match to any device group. The default device group DESKTOP will be returned as matching device group. Result: A DeviceBean with name as 'Unknown Device',it's user-agent and DESKTOP DeviceGroupBean." |
REST Methods |
|
Possible Error Codes |
|
Selected Recommendation | /sites/{sitename}/engage/recommendation/{recommendation} |
---|---|
Description |
This resource provides the Recommendation asset in the context of the specified site. You can use the Parameters:
Example URL: |
REST Methods |
|
Possible Error Codes |
|
Selected Segments | /sites/{sitename}/engage/segments |
---|---|
Description |
This service provides the segment details for a named set of segments or the segment details for a visitor. Parameters:
Example URLs:
|
REST Methods |
|
Possible Error Codes |
|
Visitor History | /visitor/visitorhistory |
---|---|
Description |
This resource provides interfaces for retrieving and recording the history of visitors. To record visitor history, the history attribute must be provided in the following format: ?visitorid=testuser&historyDef=LoginRecord& param1=attributeName1&value1=valueOfAttributeName1 Parameters:
Example: |
REST Methods |
|
Possible Error Codes |
|