This article outlines the steps required to generate an access token for yourself when you don't need a user to authorize your OAuth Client.


  1. Complete your company profile in account settings.
  2. Create an OAuth Client
    1. Enter a name for your client.
    2. The fields for Website, Redirect URI, and E-mail are not important for clients that wish to generate an access token for personal use but are still required fields.
    3. Select the "openid profile email" scope listed under Permissions.
    4. Click Submit.
  3. Copy your Client ID (client_id) and Client Secret (client_secret). You can generate a new secret in the future.
  4. Open Postman, Terminal, or some other command line application and follow the steps below.


Postman


URLhttps://accounts.boxc.com/auth/v1/token
HTTP MethodPOST
Authorization
Auth TypeBasic Auth
UsernameThis is your client_id
PasswordThis is your client_secret
Body
Content typex-www-form-urlencoded
Parametergrant_type=client_credentials





cURL (Terminal / Command Line)


Copy the cURL command below.


curl --location 'https://accounts.boxc.com/auth/v1/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: {{auth}}' \
--data-urlencode 'grant_type=client_credentials'

Replace {{auth}} with your client_id and client_secret and Base64 encode it. For example:


base64(client_id + ":" + client_secret)

An access token will be returned if the request was successful.


For more technical information regarding our API and the authorization flow please refer to our documentation.