Establish a Secure REST API Connection

Before you can work with any of the Live Experience REST operations, you need to establish a secure connection with the Live Experience REST API.

Retrieve a JSON Web Token (JWT) using the Live Experience auth endpoint. Use the JWT to authorize your subsequent REST operations.

A JWT automatically expires after 20 minutes, after which you need to obtain a new one. As long as you have a valid JWT, you can send REST operations without needing to re-authenticate.

Oracle recommends that you save this request to obtain a JWT so you can easily access it as required.

  1. From the Live Experience Admin Console, get the Client ID for your application.
  2. From your tenant administrator, get the Client Secret for your application.
  3. Concatenate the Client ID and the Client Secret, separated by a colon. For example, 1u4fejhn9pi1gnikha4e:64e740ae-77e7-41a3-97a7-712ba7a9b9f0.
  4. Encode the resulting string as base64 (using UTF-8 as the character encoding).

    You can use any encoding utility you like (for example, https://www.base64decode.org). Here's an example of the text string: MXU0ZmVqaG45cGkxZ25pa2hhNGU6NjRlNzQwYWUtNzdlNy00MWEzLTk3YTctNzEyYmE3YTliOWYw.

  5. In your REST client, select a GET operation and specify one of these auth endpoints, replacing Tenant_Name with your own tenant name:
    • Non EMEA users: https://api.live.oraclecloud.com/v1/auth/Tenant_Name
    • EMEA users: https://api.emea.live.oraclecloud.com/v1/auth/Tenant_Name
  6. Add these values to the keys of the GET request:
    • grant_type: password

    • domain_name: Insert your Live Experience domain URL, either live.oraclecloud.com or emea.live.oraclecloud.com.

    • credentials: Enter your base64 encode string you created earlier.

  7. Add these Headers to your request:
    • Accept: application/json
    • Origin: Insert a Live Experience domain URL. Don't include the protocol prefix.
  8. Configure authorization by setting the Type to Basic Auth, then provide your IDCS credentials.
  9. Send the request to generate result. The operation returns a JSON value that looks like this:
    {
     "access_token": "eyJhbGciOiJSUOpDBdG9... ...MmlTDEb4e0TQQK3yIpJEkJrRieA",
     "token_type": "Bearer",
     "expires_in": "1200"
    }
    The key and values are:
    • access_token: The JWT (much longer than the example).
    • token_type: This is always bearer and can be ignored.
    • expires_in: The amount of time until the JWT token expires in seconds.

Results:

You'll use the value for access_token in all your other requests. Configure authentication in the REST client by setting the Type to Bearer and enter the access_token value for Token.

Your JWT expires in 1200 seconds, as indicated by the expires_in key, after which you need to generate a new one. Oracle recommends that you save the request so you can easily access it as required.