In order to use Oauth, you'll need to be registered in our partner program. You can learn more about this and apply to be a partner here.
Once you're registered, we'll send you a ClientId and ClientSecret pair. You'll need both of those to follow the instructions on this page.
We use OAuth 2.0 with a code grant flow and no PKCE. If you need help troubleshooting or to update your information, please contact us.
To authorize a user, redirect them to https://account.lessannoyingcrm.com/oauth/authorize.php
.
Include the following URL params:
We will return by redirecting to your app's redirect URL, along with these params:
error
along with a brief message.To get an API token for a user, send a POST to https://script.lessannoyingcrm.com/oauth/token.php
.
Include the following header with your request:
Authorization: Basic BASE_64_STRING_HERE
The body of the request should be JSON. The same endpoint handles token and refresh requests.Exchange the authorization code from step one for an API token.
Request:
{
"grant_type": "authorization_code",
"code": "AUTH_CODE_HERE",
"redirect_url": "only if included in the authorization request"
}
Response:
{
"access_token": "ACCESS_TOKEN_HERE",
"token_type": "Bearer",
"expires_in": 3600,
"refresh_token": "REFRESH_TOKEN_HERE"
}
The access token expires in 1 hour. Exchange a refresh token (good for 30 days) for a new access token using the same endpoint and auth. Refresh tokens may only be used a single time; multiple uses will be assumed to indicate a man-in-the-middle attack.
Request:
{
"grant_type": "refresh_token",
"refresh_token": "REFRESH_TOKEN_HERE"
}
If successful, the response will look the same as the original token grant.
Failures at the token endpoint will return a 4XX HTTP code, along with a message.
Include the access token with an API request as a bearer token in an authorization header:
Authorization: Bearer ACCESS_TOKEN_HERE