Skip to main content
Create an access token
curl --request POST \
  --url https://app.simpledocs.com/api/oauth/token \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data grant_type=client_credentials \
  --data 'client_id=<string>' \
  --data 'client_secret=<string>' \
  --data 'scope=read write'
import requests

url = "https://app.simpledocs.com/api/oauth/token"

payload = {
    "grant_type": "client_credentials",
    "client_id": "<string>",
    "client_secret": "<string>",
    "scope": "read write"
}
headers = {"Content-Type": "application/x-www-form-urlencoded"}

response = requests.post(url, data=payload, headers=headers)

print(response.text)
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/x-www-form-urlencoded'},
  body: new URLSearchParams({
    grant_type: 'client_credentials',
    client_id: '<string>',
    client_secret: '<string>',
    scope: 'read write'
  })
};

fetch('https://app.simpledocs.com/api/oauth/token', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
{
  "access_token": "eyJhbGciOiJIUzI1NiJ9...",
  "token_type": "Bearer",
  "expires_in": 7200,
  "scope": "read write",
  "created_at": 1709654400
}
{
  "error": "invalid_client",
  "error_description": "Client authentication failed due to unknown client, no client authentication included, or unsupported authentication method."
}

Body

application/x-www-form-urlencoded
grant_type
enum<string>
required

Must be client_credentials.

Available options:
client_credentials
client_id
string
required

Your OAuth application UID.

client_secret
string
required

Your OAuth application secret.

scope
string

Space-separated list of scopes. Available: read, write, read write. Can be omitted if you only need read access and your OAuth application is scoped to read or write — defaults to read. Required when scoped to read write.

Example:

"read write"

Response

Token created successfully.

access_token
string
Example:

"eyJhbGciOiJIUzI1NiJ9..."

token_type
string
Example:

"Bearer"

expires_in
integer

Token lifetime in seconds.

Example:

7200

scope
string
Example:

"read write"

created_at
integer
Example:

1709654400