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/v1/resourceIndex
-
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 theutoken
.{{ "links": [ { "href": "http://example.com:8888/rest/api/v1/portal/visualizationtemplates?utoken=abcd_1OABAC5wordfhVoMLRDcT6F5vL_w%2A%2A", "resourceType": "urn:oracle:webcenter:portal:visualizationtemplates", "capabilities": "urn:oracle:webcenter:read urn:oracle:webcenter:create", "template": "http://example.com:8888/rest/api/v1/portal/visualizationtemplates?q={q}& offset={offset}& orderBy={orderBy}& limit={limit}& utoken=ICoaAzpMRMbQpxAcJ_1OABAC50CobfhVoMLRDcT6F5vL_w**" }, { "href": "http://example.com:8888/rest/api/v1/portal/portals?utoken=ICoaAzpMRMbQpxAcJ_1OABAC50CobfhVoMLRDcT6F5vL_w%2A%2A", "resourceType": "urn:oracle:webcenter:portal:portals", "capabilities": "urn:oracle:webcenter:read urn:oracle:webcenter:create", "template": "http://example.com:8888/rest/api/v1/portal/portals?q={q}& offset={offset}& includePortalContent={includePortalContent}& orderBy={orderBy}& limit={limit}& utoken=ICoaAzpMRMbQpxAcJ_1OABAC50CobfhVoMLRDcT6F5vL_w**" }, { "href": "http://example.com:8888/rest/api/v1/portal/pages?utoken=ICoaAzpMRMbQpxAcJ_1OABAC50CobfhVoMLRDcT6F5vL_w%2A%2A", "resourceType": "urn:oracle:webcenter:portal:pages", "capabilities": "urn:oracle:webcenter:read urn:oracle:webcenter:create", "template": "http://example.com:8888/rest/api/v1/portal/pages?q={q}& offset={offset}& orderBy={orderBy}& limit={limit}& utoken=ICoaAzpMRMbQpxAcJ_1OABAC50CobfhVoMLRDcT6F5vL_w**" }, { "href": "http://example.com:8888/rest/api/v1/portal/resourcecatalogs?utoken=ICoaAzpMRMbQpxAcJ_1OABAC50CobfhVoMLRDcT6F5vL_w%2A%2A", "resourceType": "urn:oracle:webcenter:portal:resourcecatalogs", "capabilities": "urn:oracle:webcenter:read urn:oracle:webcenter:create", "template": "http://example.com:8888/rest/api/v1/portal/resourcecatalogs?q={q}& offset={offset}& orderBy={orderBy}& limit={limit}& utoken=ICoaAzpMRMbQpxAcJ_1OABAC50CobfhVoMLRDcT6F5vL_w**" }, "resourceType": "urn:oracle:webcenter:resourceindex", "version": "12.2.1.3.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
Note:
Ensure that you have the permissions for creating, managing, and deleting Oracle WebCenter Portal resources.
In case of HTTPS, an SSL certificate authority (CA) certificate file or bundle to authenticate against the Verisign CA certificate is required for authentication.