HomeAge Verification HeadlessAI Services for TerminalsAge Estimation VerifySupportTrust APIIdentity Verification LivenessDigital IDIdentity verificationDigital ID MigrationDBS RTWDigital IDDBS/RTW portaleSignaturesAge verificationAge estimationIn-Branch VerificationAge Estimation v2idv-portal-errorsIdentity ProfilesVerifiable Credentialssandbox-betaIdentity Verification APIAI Services APITrust APIProof of Age (PoA) API
eSignatures
v9.0
Title
Message
Create new category
What is the title of your new category?
Edit page index title
What is the title of the page index?
Edit category
What is the new title of your category?
Edit link
What is the new title and URL of your link?
Extend recipient tokens
AI Tools
Summarize Page
Copy Markdown
Open in ChatGPT
Open in Claude
Connect to Cursor
Connect to VS Code
The Yoti sign API has an endpoint that refreshes the expiry of the recipient token. An array of tokens is passed in the body of the request. If refreshing multiple tokens, the tokens must belong to the same envelope, and this can be done for any envelope regardless of whether it is an embedded one or not.
Sandbox:
POST https://demo.api.yotisign.com/v2/envelopes/:envelopeId/extend-tokens
Production:
POST https://api.yotisign.com/v2/envelopes/:envelopeId/extend-tokens
Headers Explained
The following elements are needed:
Headers | Content |
|---|---|
Authorization | API Key to call the Yoti Sign API. This should be sent as a bearer token. |
Content-Type | application/json |
Request Body
{
recipient_tokens: ["<recipient_token_uuid>", "<recipient_token_uuid>"]
}
Example Code
const rp = require("request-promise");
const extendToken = () => {
const request = {
method: "POST",
uri: "<BASE_URL>/v2/envelopes/:envelopeId/extend-tokens",
body: JSON.stringify({
"recipient_tokens": [
<id>,
<id>
]
}),
headers: {
authorization: "Bearer <API_KEY>",
},
};
return rp(request)
.then((body) => body)
.catch((err) => err);
};
//send request
let result = await extendToken();
package com.yoti.sign;
import java.io.IOException;
import java.net.URI;
import javax.json.Json;
import javax.json.JsonObject;
import javax.json.JsonReader;
import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
public class MainExtendToken {
private static final String YOTI_SIGN_AUTH_TOKEN = "<YOUR_AUTH_TOKEN>";
private static final String YOTI_SIGN_BASE_URL = "https://api.yotisign.com/v2";
public static void main(String[] args) {
CloseableHttpClient client = HttpClients.createDefault();
final String envelopeId = "<YOUR_ENVELOPE_ID>";
HttpPost httpPost = new HttpPost();
httpPost.setHeader("Authorization", "Bearer " + YOTI_SIGN_AUTH_TOKEN);
// add request body
StringBuilder json = new StringBuilder();
json.append("{");
json.append("\"recipient_tokens\":\"[<id>, <id>]\",");
json.append("}");
httpPost.setEntity(new StringEntity(json.toString()));
URI uri = URI.create(YOTI_SIGN_BASE_URL + "/envelopes/:envelopeId/extend-tokens");
httpPost.setURI(uri);
try {
HttpResponse response = client.execute(httpPost);
JsonReader reader = Json.createReader(response.getEntity().getContent());
JsonObject envelopeInfo = reader.readObject(); // Access envelopeInfoHere
} catch (IOException e) {
e.printStackTrace();
}
}
}
<?php
use GuzzleHttp\Client;
use GuzzleHttp\Psr7\Request;
$request = new Request(
'POST',
API_BASE_URL . "/envelopes/:envelopeId/extend-tokens",
[
'headers' => [
'Authorization' => 'Bearer ' . YOUR_API_KEY,
'Content-Type' => 'application/json',
],
'body' => [
"recipient_tokens" => [
<id>,
<id>
],
],
]
);
$client = new Client();
$response = $client->send($request);
$json = json_decode($response->getBody());
using (HttpRequestMessage request = new HttpRequestMessage
{
Method = new HttpMethod("POST"),
RequestUri = new Uri("https://api.yotisign.com/v2/envelopes/:envelopeId/extend-tokens")
})
{
request.Headers.Add("Authorization", "Bearer " + "<API_KEY>");
// add request body
using (HttpClient httpClient = new HttpClient())
{
HttpResponseMessage response = httpClient.SendAsync(request).Result;
string responseContent = response.Content.ReadAsStringAsync().Result;
return new JsonResult(
responseContent,
new JsonSerializerOptions
{
WriteIndented = true,
Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping
});
}
}
options := `{}`
payload := &bytes.Buffer{}
writer := multipart.NewWriter(payload)
_ = writer.WriteField("options", options)
req, err := http.NewRequest("POST", "<BASE_URL>/envelopes/:envelopeId/extend-tokens", payload)
req.Header.Add("Authorization", "Bearer <API_KEY>")
req.Header.Add("Content-Type", "application/json")
client := &http.Client{}
response, err := client.Do(req)
if err != nil {
fmt.Println(err)
} else {
result, _ := ioutil.ReadAll(response.Body)
}
Last updated on
Was this page helpful?
Next to read:
Sign offlineGot a question? Contact us here.
Discard Changes
Do you want to discard your current changes and overwrite with the template?
Archive Synced Block
Message
Create new Template
What is this template's title?
Delete Template
Message