Use OAuth Token for HTTPS Authentication
The Oracle Primavera Cloud API uses HTTPS token authentication to authenticate requests. To authenticate, clients must provide the token generated by a valid Primavera Cloud user or an authorization server in the HTTPS headers of their requests. Various tools and programming languages, such as curl and Java, offer mechanisms to facilitate HTTPS token authentication.
Depending on the authentication type you are using, see the How Does Primavera Cloud Support Basic Authentication? or How Does Primavera Cloud Support OAuth 2.0? sections to generate an OAuth token to access the API.
Authentication Using Curl
To authenticate using curl, include the OAuth token generated through Basic Authentication or an authorization server in your request headers.
curl -X GET https://<SERVER_URL>/api/restapi/util/testConnection \ -H "Authorization: Bearer <OAuth-Access-Token>"
Where:
-
<SERVER_URL>
is the server URL where Oracle Primavera Cloud is deployed. For example, primavera.oraclecloud.com. -
<OAuth-Access-Token>
is the OAuth access token generated using Basic Authentication or an authorization server (see note below).
Note:
You can find the value for<OAuth-Access-Token>
in the OAuth access token generation response. For details, see
How Does Primavera Cloud Support Basic Authentication?.
Sample Curl Request Using OAuth Token
Construct the curl request with the OAuth token and additional headers as follows :
curl -X GET https://<SERVER_URL>/api/restapi/util/testConnection \ -H "Authorization: Bearer <OAuth-Access-Token>" \ -H "Version: <versionNumber>"
Authentication Using a REST Client
Construct the request in the REST client with the OAuth token as follows:
GET: https://<SERVER_URL>/api/restapi/workspace/1 Authorization: Bearer <OAuth-Access-Token>
Authentication Using Java
To learn how to authenticate using the HTTPS token authentication with Java, see Sample Java Code.
Note Federated users can invoke Public API using OAuth 2.0. See the methods mentioned in How Does Primavera Cloud Support OAuth 2.0? for more information.