Request the access token

post

/api/v4/oauth2/token

The API uses a standard OAuth 2.0 flow to authorize and authenticate API clients and users. If you're using the API, you should already have an OAuth 2.0 client ID and client secret. Request an access token by providing the client_id, client_secret and user credentials.

Versions Supported:

v4

Request

There are no request parameters for this operation.

Supported Media Types
Request Body - application/json ()
A body of type:
  • application/json
Root Schema : schema
Type: object
Back to Top

Response

Supported Media Types

200 Response

Success
Body ()
Root Schema : schema
Type: object

401 Response

Unauthorized

403 Response

Forbidden

500 Response

An unexpected error occurred during the request.
Back to Top

Examples

Example Request:

curl -i -X POST -u client_id:client_secret https://daas.oraclecloud.com/data/api/v4/oauth2/token

Example Request Body:

Password Grant:
{"username":"daas_admin1@oracle.com","password":"Welcome12345"}

Client Credentials Grant:
{"grant_type":"client_credentials"}

Example Output:

{
    "access_token":"eyJ4NXQjUzI1XJ2aWNlX1R5cGVfQ2xpZW50IiwidGVuYW50IjoiaWRjcy1hN2E4YjU2MDllNTc0MjMxYmViYzcxODg4OTFiM2EzNiIsImp0aSI6IjExZWE5YTdmODMxMGM1YzQ4MzFiMjM1NGJmMTdkN2EzIn0.NTANiI6ImlEUnJDWUk2WGpnZ3gzN3pjVHFZNE82SjlsRlROa0dxTzWK_S_BE2dc7MMTC5CQ",
    "token_type":"Bearer",
    "expires_in":3600
}

Error Response Details:

{
    "error": "invalid_client",
    "error_description": "Invalid OAuth Client daas_admin1@oracle.com.",
    "ecid": "rHOZX16N200000000"
}
Back to Top