Use the token to make an API request

  • Work with your system administrator to make sure that you're properly provisioned in Oracle Life Sciences IAMS and Oracle Clinical One Platform to work with REST APIs.
  • Get the token generated in Get a token for authentication. To generate this token, you need a client ID and secret provided to you by your system administrator.
  • For this example, we will continue using cURL as an example, but you can use any other REST client. For more details, see Install and configure cURL.

Note:

The authentication token expires after 10 minutes. Once your token expires, generate a new one.

Steps

  1. Grab the token that you copied in the previous task.
  2. On a new line, write the following command using your token as indicated below:

    Note:

    When calling Oracle Clinical One Platform APIs you need to use the full tenant name and not the abbreviated tenant name, whereas when generating the authentication token, you use the abbreviated tenant name.
    cURL command Notes
    token="<paste your token here>"
    curl -X GET \https://clinicalorg.com/user/v1/myprofile \
    -H "Authorization: Bearer %token% "
    -H "Content-Type: application/x-www-form-urlencoded" \
    This is an example of how the URL in your cURL command should look like:
    https://<subdomain>.<domain>.com/<resource-path> -> https://tenant.clinicalone.oraclecloud.com/ec-designer-svc/some-specific-endpoint
    Your full cURL command should then look something like this:
    token="<paste your token here>" curl -X GET \https://tenant.clinicalone.oraclecloud.com/ec-designer-svc/some-specific-endpoint\ -H "Authorization: Bearer ${token} " \ -H "Content-Type: application/x-www-form-urlencoded" \ 
  3. Press Enter on your keyboard.

You're all set now! You can start making API calls.

If you want to learn more about your API work or troubleshoot any issues you may encoutner, see: