A GraphQL Playground Set Up
GraphQL Playground is an interactive API explorer where query and mutation requests can be created and executed. The GraphQL set up helps you to interact with and understand the Oracle Primavera Cloud Adapter services.
To set up GraphQL Playground:
-
Generate the access token for Oracle Primavera Cloud by using either CURL or Postman. Open a command prompt and enter the following CURL command to generate the access token.
curl -i -X POST -H "Content-Type: application/x-www-form-urlencoded" -H "Authorization: Basic your_encoded_username_password" -d 'grant_type=client_credentials' https://primavera.oraclecloud.com/primediscovery/apitoken/request?scope=http://primavera.oraclecloud.com/apiNote:
-
In the command above, replace
Basic your_encoded_username_passwordwith the Basic base64 encoded authcode. For example:Basic c3VqYXRoYS5ndWRpcGF0aUBvcmFjbGUuY29tOlByaW1hdmVyYUAx - Use a base64 converter such as https://base64.guru/converter to generate the authcode.
-
Enter the input in your base64 converter in the
username.passwordformat. For example:testuser@oracle.com:Primavera@1
-
- Execute the command and copy the access token.
- Open the Playground link: https://primavera.oraclecloud.com/api/playground.html
and replace
primavera.oraclecloud.comwith your own Oracle Primavera Cloud instance. -
On the Playground page, click HTTP Headers in the bottom-left, and then enter the following information:
{ "Authorization": "Bearer your_token", "x-prime-tenant-code": "idcs-d9c5e846631a4fa387b7e012a76b6370", "x-prime-tenant": "idcs-a17cc933a60a40149c40575d80bb6917", "x-prime-identity-app": "cegbu-prime_primaveracloudwtssapp_US-IAD_APPID", "userId": "95e21a3833a84d40b6c1efba4b055cc4", "x-prime-region": "EU", "Invoked-By": "OIC_Adapter" }Note:
- Replace
your_tokenwith the access token generated using the above cURL command to authorize. Make sure to keepBearerbefore the token. - Update the other required header parameters, such as
x-prime-tenant-codeandx-prime-tenant.
- Replace
-
Select the Docs tab.
After the headers are set properly, the Docs and Schema tabs are displayed on the right side of the page.
- Select Queries, and then select any query to view its details.