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:

  1. 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/api
    

    Notes:

    • Replace Basic your_encoded_username_password with the Basic base64 encoded authcode. For example, Basic c3VqYXRoYS5ndWRpcGF0aUBvcmFjbGUuY29tOlByaW1hdmVyYUAx.
    • Use a base64 converter to generate the authcode. For example, you can use: https://base64.guru/converter.
    • Enter the input in your base64 converter in the username.password format. For example, testuser@oracle.com:Primavera@1.
  2. Execute the command and copy the access token.
  3. Open the Playground link: https://primavera.oraclecloud.com/api/playground.html and replace primavera.oraclecloud.com with your own Primavera Cloud instance.
  4. 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"
    }
    

    Notes:

    • Replace your_token with the access token generated using the above cURL command to authorize. Make sure to keep Bearer before the token.
    • Update the other required header parameters, such as x-prime-tenant-code and x-prime-tenant.
  5. Select the Docs tab.

    After the headers are set properly, the Docs and Schema tabs are displayed on the right side of the page.

  6. Select Queries, and then select any query to view its details.


Last Published Friday, July 12, 2024