Create real-person verification session
Create a real-person liveness verification session. After verification, AiToEarn redirects the browser to callbackUrl with result parameters. Use the same API key to create and complete the session.
curl --request POST \
--url https://aitoearn.cn/api/ai/volcengine/assets/visual-validation-sessions \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"callbackUrl": "https://example.com/real-person/callback"
}
'import requests
url = "https://aitoearn.cn/api/ai/volcengine/assets/visual-validation-sessions"
payload = { "callbackUrl": "https://example.com/real-person/callback" }
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({callbackUrl: 'https://example.com/real-person/callback'})
};
fetch('https://aitoearn.cn/api/ai/volcengine/assets/visual-validation-sessions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://aitoearn.cn/api/ai/volcengine/assets/visual-validation-sessions"
payload := strings.NewReader("{\n \"callbackUrl\": \"https://example.com/real-person/callback\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Api-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"code": 0,
"message": "Request succeeded",
"data": {
"bytedToken": "20260902170610426DEDD5F07EEF7EF075",
"h5Link": "https://ark.volcengine.com/region:cn-beijing/mobile/liveness-face-manage/authorization",
"shortLink": "https://aitoearn.cn/s/example",
"callbackUrl": "https://example.com/real-person/callback"
}
}Authorizations
Need to get API Key from AiToEarn. Click to go to "API Key Obtaining Tutorial".
Body
HTTP(S) URL to open after verification.
Response
The request has been processed by the service. Business success is determined by whether the response body has code === 0.
Business status code. 0 means success; non-zero means a business error.
Response message.
Hide child attributes
Hide child attributes
Real-person verification session token.
"20260902170610426DEDD5F07EEF7EF075"
Real-person verification H5 URL.
"https://ark.volcengine.com/region:cn-beijing/mobile/liveness-face-manage/authorization"
Real-person verification short link suitable for a QR code.
"https://aitoearn.cn/s/example"
Redirect URL after verification.
"https://example.com/real-person/callback"
Request ID.
Error response timestamp in Unix milliseconds.
curl --request POST \
--url https://aitoearn.cn/api/ai/volcengine/assets/visual-validation-sessions \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"callbackUrl": "https://example.com/real-person/callback"
}
'import requests
url = "https://aitoearn.cn/api/ai/volcengine/assets/visual-validation-sessions"
payload = { "callbackUrl": "https://example.com/real-person/callback" }
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({callbackUrl: 'https://example.com/real-person/callback'})
};
fetch('https://aitoearn.cn/api/ai/volcengine/assets/visual-validation-sessions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://aitoearn.cn/api/ai/volcengine/assets/visual-validation-sessions"
payload := strings.NewReader("{\n \"callbackUrl\": \"https://example.com/real-person/callback\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Api-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"code": 0,
"message": "Request succeeded",
"data": {
"bytedToken": "20260902170610426DEDD5F07EEF7EF075",
"h5Link": "https://ark.volcengine.com/region:cn-beijing/mobile/liveness-face-manage/authorization",
"shortLink": "https://aitoearn.cn/s/example",
"callbackUrl": "https://example.com/real-person/callback"
}
}
