Refresh TRACES session
curl --request POST \
--url https://test-api.sandbox.co.in/tds/traces/deductors/refresh \
--header 'Authorization: <authorization>' \
--header 'x-api-key: <x-api-key>'import requests
url = "https://test-api.sandbox.co.in/tds/traces/deductors/refresh"
headers = {
"Authorization": "<authorization>",
"x-api-key": "<x-api-key>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'x-api-key': '<x-api-key>'}
};
fetch('https://test-api.sandbox.co.in/tds/traces/deductors/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://test-api.sandbox.co.in/tds/traces/deductors/refresh",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"x-api-key: <x-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://test-api.sandbox.co.in/tds/traces/deductors/refresh"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("x-api-key", "<x-api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://test-api.sandbox.co.in/tds/traces/deductors/refresh")
.header("Authorization", "<authorization>")
.header("x-api-key", "<x-api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://test-api.sandbox.co.in/tds/traces/deductors/refresh")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["x-api-key"] = '<x-api-key>'
response = http.request(request)
puts response.read_body{
"code": 200,
"timestamp": 1792176147631,
"transaction_id": "068a8718-9122-47b4-8e2f-56635d6299ed",
"data": {
"@entity": "in.co.sandbox.tds.compliance.traces.authentication.response",
"access_token": "eyJhbGciOiJSU0FTU0FfUFNTX1NIQV81MTIiLCJ0eXAiOiJKV1QiLCJraWQiOiJleGFtcGxlLXNpZ25pbmcta2V5In0.eyJpc3MiOiJhcGkuc2FuZGJveC5jby5pbiIsImF1ZCI6IkFQSSIsImludGVudCI6IkFDQ0VTU19UT0tFTiIsImlhdCI6MTc5MjE3NjE0NywiZXhwIjoxNzkyMTc3MDQ3fQ.invalid-example-signature",
"refresh_token": "eyJhbGciOiJSU0FTU0FfUFNTX1NIQV81MTIiLCJ0eXAiOiJKV1QiLCJraWQiOiJleGFtcGxlLXNpZ25pbmcta2V5In0.eyJpc3MiOiJhcGkuc2FuZGJveC5jby5pbiIsImF1ZCI6IkFQSSIsImludGVudCI6IlJFRlJFU0hfVE9LRU4iLCJpYXQiOjE3OTIxNzYxNDcsImV4cCI6MTc5MjE4MzM0N30.invalid-example-signature",
"access_token_expiry": 1792177047000,
"refresh_token_expiry": 1792183347000
}
}Refresh a TRACES deductor session
Use a deductor refresh token to obtain new TRACES deductor access and refresh tokens without entering the TRACES password again.
POST
/
tds
/
traces
/
deductors
/
refresh
Refresh TRACES session
curl --request POST \
--url https://test-api.sandbox.co.in/tds/traces/deductors/refresh \
--header 'Authorization: <authorization>' \
--header 'x-api-key: <x-api-key>'import requests
url = "https://test-api.sandbox.co.in/tds/traces/deductors/refresh"
headers = {
"Authorization": "<authorization>",
"x-api-key": "<x-api-key>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'x-api-key': '<x-api-key>'}
};
fetch('https://test-api.sandbox.co.in/tds/traces/deductors/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://test-api.sandbox.co.in/tds/traces/deductors/refresh",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"x-api-key: <x-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://test-api.sandbox.co.in/tds/traces/deductors/refresh"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("x-api-key", "<x-api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://test-api.sandbox.co.in/tds/traces/deductors/refresh")
.header("Authorization", "<authorization>")
.header("x-api-key", "<x-api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://test-api.sandbox.co.in/tds/traces/deductors/refresh")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["x-api-key"] = '<x-api-key>'
response = http.request(request)
puts response.read_body{
"code": 200,
"timestamp": 1792176147631,
"transaction_id": "068a8718-9122-47b4-8e2f-56635d6299ed",
"data": {
"@entity": "in.co.sandbox.tds.compliance.traces.authentication.response",
"access_token": "eyJhbGciOiJSU0FTU0FfUFNTX1NIQV81MTIiLCJ0eXAiOiJKV1QiLCJraWQiOiJleGFtcGxlLXNpZ25pbmcta2V5In0.eyJpc3MiOiJhcGkuc2FuZGJveC5jby5pbiIsImF1ZCI6IkFQSSIsImludGVudCI6IkFDQ0VTU19UT0tFTiIsImlhdCI6MTc5MjE3NjE0NywiZXhwIjoxNzkyMTc3MDQ3fQ.invalid-example-signature",
"refresh_token": "eyJhbGciOiJSU0FTU0FfUFNTX1NIQV81MTIiLCJ0eXAiOiJKV1QiLCJraWQiOiJleGFtcGxlLXNpZ25pbmcta2V5In0.eyJpc3MiOiJhcGkuc2FuZGJveC5jby5pbiIsImF1ZCI6IkFQSSIsImludGVudCI6IlJFRlJFU0hfVE9LRU4iLCJpYXQiOjE3OTIxNzYxNDcsImV4cCI6MTc5MjE4MzM0N30.invalid-example-signature",
"access_token_expiry": 1792177047000,
"refresh_token_expiry": 1792183347000
}
}Send the
deductor_refresh_token returned by Authenticate a TRACES deductor in the Authorization header. Include your Sandbox API key in x-api-key. This request has no body.
Replace both saved deductor tokens with the returned data.access_token and data.refresh_token.
If the refresh token has expired or is rejected, authenticate the deductor again.Headers
Deductor refresh token returned by Authenticate a TRACES deductor or this endpoint. Send the token without a Bearer prefix.
Sandbox API key.
Was this page helpful?