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 Oracle Fusion Middleware Developing with Oracle WebCenter Sites and Oracle Fusion Middleware Administering Oracle WebCenter Sites.
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 | GET |
Possible Error Codes | 500 if unforeseen error occurred |
Selected Asset Type | /types/{assettype} |
---|---|
Description | This resource displays detailed information about the specified asset type. |
REST Methods | GET , PUT , DELETE |
Possible Error Codes | 404 if asset type does not exist
|
All Subtypes | /types/{assettype}/subtypes |
---|---|
Description | This resource reads all subtypes of the specified asset type. |
REST Methods | GET |
Possible Error Codes | 404 if asset type does not exist
|
Selected Subtype | /types/{assettype}/subtypes/{subtype} |
---|---|
Description | This resource reads the specified subtype of the specified asset type. |
REST Methods | GET |
Possible Error Codes | 404 if asset type or subtype does not exist
|
Site-Enabled Asset Types | /sites/{sitename}/types |
---|---|
Description | This resource lists all asset types on the specified site. |
REST Methods | GET |
Possible Error Codes | 404 if site does not exist
|
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 | GET |
Possible Error Codes | 404 if site does not exist |
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 | GET |
Possible Error Codes | 404 if the indexing configuration does not exist
|
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 | GET |
Possible Error Codes | 404 if site does not exist
|
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 | GET |
Possible Error Codes | 404 if site does not exist |
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 | GET |
Possible Error Codes | 500 if unforeseen error occurred |
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 | GET , PUT , POST , DELETE |
Possible Error Codes | 404 if indexing configuration does not exist
|
Indexing Configuration | /indexes/{source} |
---|---|
Description | This resource supports the configuration of global indexing and provides CRUD functions for operating on global and per asset type indexing configurations. Global indexing produces a single index of asset types. Asset type indexing produces one index per asset type.
Note: In this resource's URL, source is either |
REST Methods | GET , POST , PUT , DELETE |
Possible Error Codes | 404 if indexing configuration does not exist
|
All Sites | /sites |
---|---|
Description | This resource lists all sites in the system. |
REST Methods | GET |
Possible Error Codes | 500 if unforeseen error occurred |
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 | HEAD , GET , POST , PUT , DELETE |
Possible Error Codes | 404 if site does not exist
|
Publication Node | /sites/{sitename}/navigation |
---|---|
Description | This resource reads the Site Plan tree for the site specified by {sitename} . Accessing this resource requires having READ permission on the corresponding site resource. Query parameters defined for the service are as follows:
For more information about the Site Plan tree, see Oracle Fusion Middleware Developing with Oracle WebCenter Sites. |
REST Methods | GET |
Possible Error Codes | 400 Exception in parsing depth.
|
Page Node | /sites/{sitename}/navigation/{pageid} |
---|---|
Description | This resource reads the Site Plan sub-tree for the site specified by {sitename} and page specified by {pageid} as the root. Accessing this resource requires having READ permission to at least the page asset resource that is specified by pageid . Query parameters defined for the service are as follows:
Default value: Accepted values: Integers or the string For more information about the Site Plan tree, see Oracle Fusion Middleware Developing with Oracle WebCenter Sites. |
REST Methods | GET |
Possible Error Codes | 400 Page asset type is not enabled on site.
|
All Roles | /roles |
---|---|
Description | This resource reads the list of roles that are stored in the system. |
REST Methods | GET |
Possible Error Codes | 500 if unforeseen error occurred |
Selected Role | /roles/{rolename} |
---|---|
Description | This resource provides CRUD functions for operating on the specified role. |
REST Methods | GET , POST , PUT , DELETE |
Possible Error Codes | 404 if role does not exist.
|
All Applications | /applications |
---|---|
Description | This resource lists registered applications. |
REST Methods | GET |
Possible Error Codes | 500 if unforeseen error occurred |
Selected Application | /applications/{applicationid} |
---|---|
Description | This resource registers the specified application by performing CRUD operations on the application's FW_View and FW_Application assets. More information about application registration is available in the Oracle Fusion Middleware Developing with Oracle WebCenter Sites guide. |
REST Methods | GET , PUT , POST , DELETE |
Possible Error Codes | 404 if application does not exist.
|
All Users | /users |
---|---|
Description | This resource lists all users that are defined in the system. |
REST Methods | GET |
Possible Error Codes | 500 if unforeseen error occurred |
Selected User | /users/{username} |
---|---|
Description | This resource provides CRUD functions for operating on the specified user. If the user profile contains an image, a 90 x 90 pixel thumbnail image is returned by the service. If the thumbnail image is required in a different size, the request can be made with the following parameters: imageHeight and imageWidth (in pixels); the thumbnail image is then returned at the specified size. The actual uploaded image is always returned in its original size when user information is requested. To restrict the user service to return only the thumbnail image and not the actual image, set the thumbOnly parameter to true .
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 | HEAD , GET , POST , PUT , DELETE |
Possible Error Codes | 404 if user does not exist
|
All Site Users | /sites/{sitename}/users |
---|---|
Description | This resource lists the roles of all users on the specified site. |
REST Methods | GET |
Possible Error Codes | 404 if site does not exist
|
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 | GET |
Possible Error Codes | 404 if site does not exist
|
The /userlocales
resource is not protected
User Locales | /userlocales |
---|---|
Description | This resource lists all locales that are defined in the system. |
REST Methods | GET |
Possible Error Codes | 500 if unforeseen error occurred |
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 requiredPeopleAttrs property of the dir.ini file, along with the predefined WebCenter Sites attributes. |
REST Methods | GET |
Possible Error Codes | 500 if unforeseen error occurred |
ACLs | /acls |
---|---|
Description | This resource lists all ACLs that are defined in WebCenter Sites. |
REST Methods | GET |
Possible Error Codes | 500 if unforeseen error occurred |
All Groups | /groups |
---|---|
Description | This resource lists all REST security groups in the system. |
REST Methods | GET |
Possible Error Codes | 500 if unforeseen error occurred |
Selected Group | /groups/{groupname} |
---|---|
Description | This resource provides the security privilege configuration of the specified group. |
REST Methods | GET |
Possible Error Codes | 404 if requested group is not found |
The /timezone
resource is not protected.
Time Zone | /timezone |
---|---|
Description | This resource returns the server's time zone. |
REST Methods | GET |
Possible Error Codes | 500 if unforeseen error occurred |
Current Device Information | /currentdevice |
---|---|
Description | This service retrieves the device information from the User-Agent header present in an HTTP request, and returns the matching device and device group information in the form of a DeviceBean . If the User-Agent is present in the current device repository, and it has device capabilities that are mentioned in the repository, the returned DeviceBean will contain a DeviceCapabilites bean.
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 | GET |
Possible Error Codes | 500 if unforeseen error occurred. |
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 fields parameter to specify the attributes to be retrieved from and populated in the Recommendation asset. You can also use the segments parameter to specify a comma separated list of segments to be included in the result.
Parameters:
Example URL: |
REST Methods | GET |
Possible Error Codes | 404 if site or recommendation does not exist.
|
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 | GET |
Possible Error Codes | 404 if site does not exist
|
Visitor History | /visitor/visitorhistory |
---|---|
Description | This resource provides interfaces for retrieving and recording history of visitors. While recording history, the history attribute must be provided in the following format:
?visitorid=testuser&historyDef=LoginRecord¶m1=attributeName1&value1=valueOfAttributeName1 Parameters:
|
REST Methods | GET , POST |
Possible Error Codes | 500 if unforeseen error occurs. |