Refresh Token
curl --request POST \
--url https://app.aisync.link/oauth/token/refresh \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data 'client_id=<string>' \
--data 'client_secret=<string>' \
--data grant_type=refresh_token \
--data 'redirect_uri=<string>' \
--data 'refresh_token=<string>'import requests
url = "https://app.aisync.link/oauth/token/refresh"
payload = {
"client_id": "<string>",
"client_secret": "<string>",
"grant_type": "refresh_token",
"redirect_uri": "<string>",
"refresh_token": "<string>"
}
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({
client_id: '<string>',
client_secret: '<string>',
grant_type: 'refresh_token',
redirect_uri: '<string>',
refresh_token: '<string>'
})
};
fetch('https://app.aisync.link/oauth/token/refresh', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.aisync.link/oauth/token/refresh",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "client_id=%3Cstring%3E&client_secret=%3Cstring%3E&grant_type=refresh_token&redirect_uri=%3Cstring%3E&refresh_token=%3Cstring%3E",
CURLOPT_HTTPHEADER => [
"Content-Type: application/x-www-form-urlencoded"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.aisync.link/oauth/token/refresh"
payload := strings.NewReader("client_id=%3Cstring%3E&client_secret=%3Cstring%3E&grant_type=refresh_token&redirect_uri=%3Cstring%3E&refresh_token=%3Cstring%3E")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.aisync.link/oauth/token/refresh")
.header("Content-Type", "application/x-www-form-urlencoded")
.body("client_id=%3Cstring%3E&client_secret=%3Cstring%3E&grant_type=refresh_token&redirect_uri=%3Cstring%3E&refresh_token=%3Cstring%3E")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.aisync.link/oauth/token/refresh")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/x-www-form-urlencoded'
request.body = "client_id=%3Cstring%3E&client_secret=%3Cstring%3E&grant_type=refresh_token&redirect_uri=%3Cstring%3E&refresh_token=%3Cstring%3E"
response = http.request(request)
puts response.read_body{
"access_token": "<string>",
"token_type": "Bearer",
"expires_in": 123,
"refresh_token": "<string>"
}{
"error": "<string>",
"error_description": "<string>",
"message": "<string>"
}{
"error": "<string>",
"error_description": "<string>",
"message": "<string>"
}Authorization
Refresh Token
Obtain a new access token using your refresh token. Use this endpoint when your access token expires to continue making API calls without requiring user re-authorization.
POST
/
oauth
/
token
/
refresh
Refresh Token
curl --request POST \
--url https://app.aisync.link/oauth/token/refresh \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data 'client_id=<string>' \
--data 'client_secret=<string>' \
--data grant_type=refresh_token \
--data 'redirect_uri=<string>' \
--data 'refresh_token=<string>'import requests
url = "https://app.aisync.link/oauth/token/refresh"
payload = {
"client_id": "<string>",
"client_secret": "<string>",
"grant_type": "refresh_token",
"redirect_uri": "<string>",
"refresh_token": "<string>"
}
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({
client_id: '<string>',
client_secret: '<string>',
grant_type: 'refresh_token',
redirect_uri: '<string>',
refresh_token: '<string>'
})
};
fetch('https://app.aisync.link/oauth/token/refresh', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.aisync.link/oauth/token/refresh",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "client_id=%3Cstring%3E&client_secret=%3Cstring%3E&grant_type=refresh_token&redirect_uri=%3Cstring%3E&refresh_token=%3Cstring%3E",
CURLOPT_HTTPHEADER => [
"Content-Type: application/x-www-form-urlencoded"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.aisync.link/oauth/token/refresh"
payload := strings.NewReader("client_id=%3Cstring%3E&client_secret=%3Cstring%3E&grant_type=refresh_token&redirect_uri=%3Cstring%3E&refresh_token=%3Cstring%3E")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.aisync.link/oauth/token/refresh")
.header("Content-Type", "application/x-www-form-urlencoded")
.body("client_id=%3Cstring%3E&client_secret=%3Cstring%3E&grant_type=refresh_token&redirect_uri=%3Cstring%3E&refresh_token=%3Cstring%3E")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.aisync.link/oauth/token/refresh")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/x-www-form-urlencoded'
request.body = "client_id=%3Cstring%3E&client_secret=%3Cstring%3E&grant_type=refresh_token&redirect_uri=%3Cstring%3E&refresh_token=%3Cstring%3E"
response = http.request(request)
puts response.read_body{
"access_token": "<string>",
"token_type": "Bearer",
"expires_in": 123,
"refresh_token": "<string>"
}{
"error": "<string>",
"error_description": "<string>",
"message": "<string>"
}{
"error": "<string>",
"error_description": "<string>",
"message": "<string>"
}Refresh Token
Obtain a new access token using your refresh token. Use this endpoint when your access token expires to continue making API calls without requiring user re-authorization.string
required
Your OAuth client ID
string
required
Your OAuth client secret
string
required
Must be set to
refresh_token for this flowstring
required
The redirect URI registered with your OAuth client
string
required
The refresh token obtained from the Generate Token endpoint
curl --location 'https://app.aisync.link/oauth/token/refresh' \
--form 'client_id="{{client_id}}"' \
--form 'client_secret="{{client_secret}}"' \
--form 'grant_type="refresh_token"' \
--form 'redirect_uri="{{redirect_uri}}"' \
--form 'refresh_token="{{refresh_token}}"'
string
A new access token to use for API requests
string
A new refresh token (may be the same or different from the one provided)
string
The type of token, typically
Bearerinteger
The number of seconds until the new access token expires
Refresh your access token before it expires to ensure uninterrupted API access. Most applications refresh tokens proactively when they’re close to expiration.
Body
application/x-www-form-urlencoded
Your OAuth client ID
Your OAuth client secret
Must be set to 'refresh_token' for this flow
Available options:
refresh_token The redirect URI registered with your OAuth client
The refresh token obtained from the Generate Token endpoint
Response
Token response