OAuth Client Credentials Login Flow
Introduction
This guide walks through the steps of using the OAuth client credentials grant. For more information, see Use a Client Credentials Grant.
The client credentials grant is useful in applications without a user interface that do not make API calls on behalf of a user. This means that if you log in using the client credentials grant, you cannot use operations like /api/v2/users/me because the application is not running as a user.
Obtain an Access Token
Start by making a request to POST https://login.mypurecloud.com/oauth/token
with the following settings:
- Authentication- Basic
- User- Client ID
- Password- Client secret
To use basic authentication, set the authentication header to Basic <base64EncodedUserPass>
, where base64EncodedUserPass is a base64-encoded string containing the username and password separated by a colon: base64(user:password)
Some languages handle the basic authentication. Other languages require you to encode the header as base64.
Make API Calls
The response of the POST contains the access token. Include this token in the authorization header of API calls.