Sending Requests

This page covers the basics of calling CX Audience REST APIs.

The sequence of steps required for processing a CX Audience REST API request is:

  1. Client issues an HTTP POST request to authenticate via the login endpoint.

    https://<ACCOUNT_TOKEN>-api.prod.cxaudience.ocs.oraclecloud.com

    Account tokens are account specific. For each customer account, a branded API URL is created inline with the branded UI URL with the specific account token generated during account provisioning.

  2. CX Audience returns a JSON response with an authentication token.
  3. Client issues desired HTTP POST to the API endpoint along with the token in the HTTP HEADER.

    NOTE: Design your client API code to create the API endpoint URI, followed by your account token, and the specific path of the desired API. For example, the API endpoint to get all profile lists for an account would be:

    
    https://<ENDPOINT_URI><ACCOUNT_TOKEN>-api.prod.cxaudience.ocs.oraclecloud.com/rest/api/v1.3/lists				
    				
  4. If the API request is successfully processed, CX Audience returns a specific JSON response according to the specification of the processed API. Otherwise, CX Audience returns an error payload for interpretation.
  5. Depending on the success or failure of the previous API request, take the next action.
  6. Repeat step 3-5 as needed.
  7. If needed, refresh the token to avoid having to re-authenticate.

    By default, tokens last for a fixed period of time (two hours).