Open a session for the web SDK
curl --request POST \
--url https://api.verifner.com/v1/sessions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"reference": "<string>",
"ttl_seconds": 900,
"metadata": {}
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({reference: '<string>', ttl_seconds: 900, metadata: {}})
};
fetch('https://api.verifner.com/v1/sessions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.verifner.com/v1/sessions"
payload = {
"reference": "<string>",
"ttl_seconds": 900,
"metadata": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.verifner.com/v1/sessions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'reference' => '<string>',
'ttl_seconds' => 900,
'metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"id": "<string>",
"mode": "live",
"status": "pending",
"reference": "<string>",
"document_type": "cni",
"metadata": {},
"verification_id": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"client_token": "<string>",
"url": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Sessions
Open a session for the web SDK
POST
/
v1
/
sessions
Open a session for the web SDK
curl --request POST \
--url https://api.verifner.com/v1/sessions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"reference": "<string>",
"ttl_seconds": 900,
"metadata": {}
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({reference: '<string>', ttl_seconds: 900, metadata: {}})
};
fetch('https://api.verifner.com/v1/sessions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.verifner.com/v1/sessions"
payload = {
"reference": "<string>",
"ttl_seconds": 900,
"metadata": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.verifner.com/v1/sessions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'reference' => '<string>',
'ttl_seconds' => 900,
'metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"id": "<string>",
"mode": "live",
"status": "pending",
"reference": "<string>",
"document_type": "cni",
"metadata": {},
"verification_id": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"client_token": "<string>",
"url": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Corps
application/json
Réponse
Session with its single-use client token
Hosted capture page for this session (https://verify.verifner.com/#…). Send it to the person to verify instead of embedding the SDK; the token is in the fragment. Single use, expires with the session.