Authentication
Oracle WebCenter Portal Rest API has primarily a basic authentication that accepts user name and password for accessing the resource index. The resource index (/rest/api) gives the user the API Token for accessing the portal APIs.
To obtain the API token and access the REST API:
Access the Oracle WebCenter Portal REST API resources using the following URL structure.
https://hostname:port/rest/api/
Enter the Authorization and Accept details.
HTTP Headers
Description
Authorization
Basic Authorization with WebCenter Portal user name and password
Accept
application/json
The utoken is displayed in the Response message. The following example provides sample index URL in the Response message with the utoken.
{ "links": [ { "href": "http://hostname:port/rest/api/v1/resourceIndex?utoken=sampletoken", "rel": "alternate", "resourceType": "urn:oracle:webcenter:resourceindex", "capabilities": "urn:oracle:webcenter:read" }, "resourceType": "urn:oracle:webcenter:resourceindex", "version": "12.2.1.0.0" }
After you have the utoken, you can access the Oracle WebCenter Portal REST API resources as follows:
curl -u jstein:welcome1 -H "Content-Type:application/json" -H "Accept: application/json" -X POST -d '{"commentStr":"add test Comment"}' http://hostname.port/rest/api/v1/portal/portals?utoken=sampletoken
Ensure that you have the permissions for creating, managing, and deleting Oracle WebCenter Portal resources, as described in Administering Oracle WebCenter Portal.
In case of HTTPS, an SSL certificate authority (CA) certificate file or bundle to authenticate against the Verisign CA certificate is required for authentication.