Connect Refresh Token

Generate access token from refresh token

If an access token is expired this endpoint can be used with a grant_type of refresh_token and the refresh_token stored for the user's access token.

Refresh existing token

If it has been a while since you obtained your access token, all requests to Connect’s API will return an unauthorized error. To correct the error, you need to refresh your access token. This step works much like obtaining an access token. You will make a POST request to Connect’s token endpoint. This time specify a grant_type of refresh_token and you include your refresh token in the request (instead of the authorization code). The same rules apply to including your client credentials (client_id and client_secret). 

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.
refresh_tokenYesStringThe refresh token associated with the expired access token.
grant_typeYesStringThe grant type of the token. E.g. -refresh_token

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		"refresh_token":"eyJhbGciOiJIUzI1**************",
11		"grant_type":"refresh_token"
12	 }' \
13	"https://connectcloud.appypie.com/v1/oauth2/token"

RESPONSE

{
  "access_token": "eyJhbGciOiJIUzI1*******************",
  "refresh_token": "eyJhbGciOiJIUzI********************",
  "expires_at": 1642508535,
  "type": "bearer"
}