Exchange access token
curl --request PUT \
--url https://api.extole.io/v4/tokens/exchange/{token} \
--header 'Authorization: <api-key>'import requests
url = "https://api.extole.io/v4/tokens/exchange/{token}"
headers = {"Authorization": "<api-key>"}
response = requests.put(url, headers=headers)
print(response.text)const options = {method: 'PUT', headers: {Authorization: '<api-key>'}};
fetch('https://api.extole.io/v4/tokens/exchange/{token}', 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://api.extole.io/v4/tokens/exchange/{token}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.extole.io/v4/tokens/exchange/{token}"
req, _ := http.NewRequest("PUT", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.extole.io/v4/tokens/exchange/{token}")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.extole.io/v4/tokens/exchange/{token}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"access_token": "<string>",
"client_id": "<string>",
"expires_in": 123,
"identity_id": "<string>",
"person_id": "<string>",
"scopes": [
"BACKEND"
],
"type": "MANAGED"
}
Authentication
Exchange access token
Exchanges the supplied access token for a fresh one with the same scopes and a renewed expiry. The original token is invalidated immediately on success. Use this to rotate long-lived integration tokens without re-authenticating.
PUT
https://api.extole.io
/
v4
/
tokens
/
exchange
/
{token}
Exchange access token
curl --request PUT \
--url https://api.extole.io/v4/tokens/exchange/{token} \
--header 'Authorization: <api-key>'import requests
url = "https://api.extole.io/v4/tokens/exchange/{token}"
headers = {"Authorization": "<api-key>"}
response = requests.put(url, headers=headers)
print(response.text)const options = {method: 'PUT', headers: {Authorization: '<api-key>'}};
fetch('https://api.extole.io/v4/tokens/exchange/{token}', 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://api.extole.io/v4/tokens/exchange/{token}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.extole.io/v4/tokens/exchange/{token}"
req, _ := http.NewRequest("PUT", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.extole.io/v4/tokens/exchange/{token}")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.extole.io/v4/tokens/exchange/{token}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"access_token": "<string>",
"client_id": "<string>",
"expires_in": 123,
"identity_id": "<string>",
"person_id": "<string>",
"scopes": [
"BACKEND"
],
"type": "MANAGED"
}
Response
Successful response
Access-token metadata returned by POST /v4/tokens, POST /v4/tokens/openid-connect/authorization-code-flow, GET /v4/tokens, GET /v4/tokens/{token}, and PUT /v4/tokens/exchange/{token}. Pass access_token in the Authorization header (Bearer ...) on subsequent requests.
Authorization scopes granted to this token. Determines which API operations the token may invoke.
Authorization scopes granted to this token. Determines which API operations the token may invoke.
Available options:
BACKEND, CLIENT_ADMIN, CLIENT_REPORT_DOWNLOAD, CLIENT_SUPERUSER, ONE_TIME, PASSWORD_RESET, USER_SUPPORT, VIEWER Was this page helpful?
