Connect access token

Get an access token

These endpoints are used to authenticate with the api. The Connect API uses the OAuth 2.0 model to handle authentication. OAuth is a standardized way for services to grant permission on a user's behalf to another application, without exposing their credentials (ie - username and password).

Use access token to access connect API

This endpoint is used to get an access token. This endpoint can obtain an access point from one of two grant types.

In the initial authorization, a grant_type of authorization_code is used with the authorization_code received from the URL the user is redirected to after authorizing the integration to their account.

This endpoint must be provided with the client_id and client_secret either in the Authorization header (preferred) or in the request body.

POST https://connectcloud.appypie.com/v1/oauth2/token

Parameter NameRequiredParameter TypeParameter Description
client_idYesStringThe client ID of the application.
client_secretYesStringThe client secret of the application.
redirect_uriYesStringredirect_uri is your callback. This is where the user-agent (in most cases the customer’s browser) will be sent after the customer clicks authorize.
grant_typeYesStringThe grant type of the token.
codeYesStringThe authorization code received from the authorization call.

Errors

This error section displays all the errors with details.

Following are the error codes that indicate the success or failure of an API request:

Error CodeMeaning
400Bad Request -- Your request is invalid.
401Unauthorized -- Your API key is wrong.
403Forbidden -- The method requested is hidden for administrators only.
404Not Found -- The specified method could not be found.
405Method Not Allowed -- You tried to access a method with an invalid method.
406Not Acceptable -- You requested a format that is not json.
410Gone -- Request has been removed from our servers.
429Too Many Requests
500Internal Server Error -- We had a problem with our server. Try again later.
503Service Unavailable -- We are temporarily offline for maintenance. Please try again later.
2032API Key is required
2034Email is required
2036Invalid API Key
2038Provide valid API Key
2039Email already exists
2040Phone already exists
2041Email Invalid
To authorize, use this code:

1wget --no-check-certificate --quiet \
2	--method POST \
3	--timeout=0 \
4	--header "ACCESSTOKEN: Access Token Key" \
5	--header "Content-Type: application/json" \
6	--body-data
7	'{
8		"client_id":"**********",
9		"client_secret":"**********",
10		"redirect_uri":"https://app.example.com",
11		"grant_type":"authorization_code",
12		"code":"*******************"
13	 }' \
14	"https://connectcloud.appypie.com/v1/oauth2/token"

RESPONSE

{
  "access_token": "eyJhbGciOiJIUzI1NiIsInR5c*********************",
  "refresh_token": "eyJhbGciOiJI*********************************",
  "expires_at": 1642507278,
  "type": "bearer"
}