Directly Developer Portal

Explore our developer documentation to learn how easy it is to deliver automated and elastic support operations with Directly's platform & APIs.

Get Started    Reference

Authentication

All Requests to the Directly APIs must be authenticated. To do this, you exchange either your Secret or your User Credentials for an Access Token, and use this token to authenticate the rest of your API calls.

📘

Getting a Secret

To get the secret for your instance contact us

❗️

Your Secret must remain confidential. To prevent third parties from accessing your API, always use it in requests from a server-side environment. Never expose your secret in client-side integrations.

API Routes



post
/oauth/token

Request an Access Token

Use the /oauth/token endpoint to obtain an Access Token from an Authorization Code, Refresh token, or client Secret. The Access Token authorizes all requests to other API endpoints, with the header Authorization set to Bearer <your_access_token>.

Parameters

Name Param Type Data Type Description
client_id body string predefined client id
client_secret body string predefined client id
grant_type body string `authorization_code` or `refresh_token`
code body string if grant type is set to `authorization_code`, then the code that oauth/authorize redirected
refresh_token body string if grant type is set to `refresh_token`, then the refresh token from a previous call to oauth/token
scope body string if grant type is set to `refresh_token` then the requested scope should also be included- note refresh requests do not support single user scopes

Responses

Code Description
201

Created


{
    "access_token": "",
    "expires_in": ,
    "refresh_token": "",
    "scope": “read write”,
    "token_type": "Bearer"
}
404 Not found
405 Method not allowed
500 Error



get
/oauth/auth

Request an Authorization Code

Use the /oauth/auth endpoint to request an authorization code be sent to a predefined callback URL. This code will allows you to generate an Access Token to authorize all requests to other API endpoints.

Parameters

Name Param Type Data Type Description
client_id query string predefined client id
scope query string What scope should the code include. If set to a specific user Email in addition to read and write, then only questions for that user will be retrievable and modifiable
redirect_uri query string Optionally, can be set to one of the predefined callback servers to select the server that will be directed the code. If not set, the code will be directed to the first predefined server.

Responses

Code Description
200 OK
404 Not found
405 Method not allowed
500 Error



get
/oauth/logout

Expires the provided Access Token

Use the /oauth/logout endpoint to invalidate the bearer Access Token that is included in the Authorization header.

Parameters

No parameters.

Responses

Code Description
200 OK
401 Invalid Authorization Credentials
405 Method not allowed
500 Error

Updated 3 months ago

Authentication


All Requests to the Directly APIs must be authenticated. To do this, you exchange either your Secret or your User Credentials for an Access Token, and use this token to authenticate the rest of your API calls.

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.