Request an OAuth Access Token

To request an OAuth access token, use cURL to send an HTTP/HTTPS request to the Billing Care REST API authorization endpoint. For example:

curl -i 
     -H "Authorization: Basic client_id:client_secret"
     -H "Content-Type: application/json"
     -H "Accept: application/json"
     -X GET http(s)://hostname:port/bcws/webresources/v1.0/authentication/queryAccessToken"
         

where:

  • client_id:client_secret are the Base64-encoded credentials for your REST client.
  • hostname:port is the IP address or host name and port of the Billing Care REST API server.

If the request is successful, the token type, expiry time, and access token are returned. For example:

{
    "expires_in": 3600,
    "token_type": "Bearer",
    "access_token": "accessToken"
}

The token expires after the number of seconds shown in expires_in. This value is set while setting up the OAuth identity domain as described in "Configure OAuth Services". After the token expires, you must request a new one.

You use the token in the Authorization header for each REST request with the following format:

-H  "Authorization: Bearer accessToken"