Translate file extraction results
curl --request POST \
--url https://docflow.textin.com/api/app-api/sip/platform/v2/file/translate \
--header 'Content-Type: application/json' \
--header 'x-ti-app-id: <api-key>' \
--header 'x-ti-secret-code: <api-key>' \
--data '
{
"task_id": "202412190001",
"source_language": "",
"target_language": "zh-CN"
}
'import requests
url = "https://docflow.textin.com/api/app-api/sip/platform/v2/file/translate"
payload = {
"task_id": "202412190001",
"source_language": "",
"target_language": "zh-CN"
}
headers = {
"x-ti-app-id": "<api-key>",
"x-ti-secret-code": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-ti-app-id': '<api-key>',
'x-ti-secret-code': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({task_id: '202412190001', source_language: '', target_language: 'zh-CN'})
};
fetch('https://docflow.textin.com/api/app-api/sip/platform/v2/file/translate', 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://docflow.textin.com/api/app-api/sip/platform/v2/file/translate",
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([
'task_id' => '202412190001',
'source_language' => '',
'target_language' => 'zh-CN'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-ti-app-id: <api-key>",
"x-ti-secret-code: <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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://docflow.textin.com/api/app-api/sip/platform/v2/file/translate"
payload := strings.NewReader("{\n \"task_id\": \"202412190001\",\n \"source_language\": \"\",\n \"target_language\": \"zh-CN\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-ti-app-id", "<api-key>")
req.Header.Add("x-ti-secret-code", "<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))
}HttpResponse<String> response = Unirest.post("https://docflow.textin.com/api/app-api/sip/platform/v2/file/translate")
.header("x-ti-app-id", "<api-key>")
.header("x-ti-secret-code", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"task_id\": \"202412190001\",\n \"source_language\": \"\",\n \"target_language\": \"zh-CN\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://docflow.textin.com/api/app-api/sip/platform/v2/file/translate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-ti-app-id"] = '<api-key>'
request["x-ti-secret-code"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"task_id\": \"202412190001\",\n \"source_language\": \"\",\n \"target_language\": \"zh-CN\"\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"msg": "<string>",
"result": {
"fields": [
{
"key": "invoiceNumber",
"translated_key": "<string>",
"index": 0,
"value": "<string>"
}
],
"tables": [
{
"table_name": "<string>",
"translated_table_name": "<string>",
"items": [
[
{
"key": "invoiceNumber",
"translated_key": "<string>",
"index": 0,
"value": "<string>"
}
]
],
"item_headers": [
{
"key": "<string>",
"translated_key": "<string>"
}
]
}
],
"stamps": [
{
"key": "<string>",
"page": 123,
"index": 123,
"stamp_prefix": "<string>",
"type_key": "<string>",
"type": "<string>",
"color_key": "<string>",
"color": "<string>",
"stamp_shape_key": "<string>",
"stamp_shape": "<string>",
"value_key": "<string>",
"value": "<string>"
}
],
"handwritings": [
{
"key": "<string>",
"page": 123,
"index": 123,
"handwriting_prefix": "<string>",
"text": "<string>"
}
]
}
}API Reference
Translate file extraction results
Languages use ISO 639-1 codes; Chinese is region-qualified as zh-CN or zh-TW.
Omitting source_language or sending an empty string enables automatic source-language detection.
A concrete source language must differ from target_language.
Calling this endpoint translates the task and enables translation in the frontend task detail view.
A concurrent request returns a “task is being translated” error.
Common business error codes:
1005025065: task recognition failed and cannot be translated1005025066: task recognition has not completed1005025067: task translation is already in progress1005025068: source and target languages are the same1005025069: target language is empty or is not a concrete language code
POST
/
api
/
app-api
/
sip
/
platform
/
v2
/
file
/
translate
Translate file extraction results
curl --request POST \
--url https://docflow.textin.com/api/app-api/sip/platform/v2/file/translate \
--header 'Content-Type: application/json' \
--header 'x-ti-app-id: <api-key>' \
--header 'x-ti-secret-code: <api-key>' \
--data '
{
"task_id": "202412190001",
"source_language": "",
"target_language": "zh-CN"
}
'import requests
url = "https://docflow.textin.com/api/app-api/sip/platform/v2/file/translate"
payload = {
"task_id": "202412190001",
"source_language": "",
"target_language": "zh-CN"
}
headers = {
"x-ti-app-id": "<api-key>",
"x-ti-secret-code": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-ti-app-id': '<api-key>',
'x-ti-secret-code': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({task_id: '202412190001', source_language: '', target_language: 'zh-CN'})
};
fetch('https://docflow.textin.com/api/app-api/sip/platform/v2/file/translate', 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://docflow.textin.com/api/app-api/sip/platform/v2/file/translate",
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([
'task_id' => '202412190001',
'source_language' => '',
'target_language' => 'zh-CN'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-ti-app-id: <api-key>",
"x-ti-secret-code: <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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://docflow.textin.com/api/app-api/sip/platform/v2/file/translate"
payload := strings.NewReader("{\n \"task_id\": \"202412190001\",\n \"source_language\": \"\",\n \"target_language\": \"zh-CN\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-ti-app-id", "<api-key>")
req.Header.Add("x-ti-secret-code", "<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))
}HttpResponse<String> response = Unirest.post("https://docflow.textin.com/api/app-api/sip/platform/v2/file/translate")
.header("x-ti-app-id", "<api-key>")
.header("x-ti-secret-code", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"task_id\": \"202412190001\",\n \"source_language\": \"\",\n \"target_language\": \"zh-CN\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://docflow.textin.com/api/app-api/sip/platform/v2/file/translate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-ti-app-id"] = '<api-key>'
request["x-ti-secret-code"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"task_id\": \"202412190001\",\n \"source_language\": \"\",\n \"target_language\": \"zh-CN\"\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"msg": "<string>",
"result": {
"fields": [
{
"key": "invoiceNumber",
"translated_key": "<string>",
"index": 0,
"value": "<string>"
}
],
"tables": [
{
"table_name": "<string>",
"translated_table_name": "<string>",
"items": [
[
{
"key": "invoiceNumber",
"translated_key": "<string>",
"index": 0,
"value": "<string>"
}
]
],
"item_headers": [
{
"key": "<string>",
"translated_key": "<string>"
}
]
}
],
"stamps": [
{
"key": "<string>",
"page": 123,
"index": 123,
"stamp_prefix": "<string>",
"type_key": "<string>",
"type": "<string>",
"color_key": "<string>",
"color": "<string>",
"stamp_shape_key": "<string>",
"stamp_shape": "<string>",
"value_key": "<string>",
"value": "<string>"
}
],
"handwritings": [
{
"key": "<string>",
"page": 123,
"index": 123,
"handwriting_prefix": "<string>",
"text": "<string>"
}
]
}
}Body
application/json
ID of a task that completed recognition. Send Snowflake IDs as strings; do not convert them to JavaScript Number.
Example:
"1978297791713619968"
Required target language as a concrete ISO 639-1 code.
Available options:
zh-CN, zh-TW, ja, ko, en, fr, pt, de, it, es, ru, th, vi, ms, id, hi, bn, ar, pl Example:
"zh-CN"
Source language as an ISO 639-1 code. Omit it or send an empty string to enable automatic detection.
Available options:
, zh-CN, zh-TW, ja, ko, en, fr, pt, de, it, es, ru, th, vi, ms, id, hi, bn, ar, pl Example:
""

