Update File Processing Result
curl --request POST \
--url https://docflow.textin.ai/api/app-api/sip/platform/v2/file/update \
--header 'Content-Type: application/json' \
--header 'x-ti-app-id: <api-key>' \
--header 'x-ti-secret-code: <api-key>' \
--data '
[
{
"workspace_id": 1234567890,
"file_id": 202412190001,
"data": {
"fields": [
{
"key": "Invoice Code",
"value": "3100231130",
"position": [
{
"page": 0,
"vertices": [
0,
0,
100,
0,
100,
100,
0,
100
]
}
]
},
{
"key": "Invoice Number",
"value": "28737000",
"position": [
{
"page": 0,
"vertices": [
0,
0,
100,
0,
100,
100,
0,
100
]
}
]
}
],
"items": [
[
{
"key": "Goods and Services Name",
"value": "*Electronic Computer*Microcomputer Host",
"position": [
{
"page": 0,
"vertices": [
0,
0,
100,
0,
100,
100,
0,
100
]
}
]
},
{
"key": "Specification Model",
"value": "DMS-SC68",
"position": [
{
"page": 0,
"vertices": [
0,
0,
100,
0,
100,
100,
0,
100
]
}
]
}
],
[
{
"key": "Goods and Services Name",
"value": "*Mechanical Computer*Supercomputer Host",
"position": [
{
"page": 0,
"vertices": [
0,
0,
100,
0,
100,
100,
0,
100
]
}
]
},
{
"key": "Specification Model",
"value": "AN/FSQ-7",
"position": [
{
"page": 0,
"vertices": [
0,
0,
100,
0,
100,
100,
0,
100
]
}
]
}
]
]
}
}
]
'import requests
url = "https://docflow.textin.ai/api/app-api/sip/platform/v2/file/update"
payload = [
{
"workspace_id": 1234567890,
"file_id": 202412190001,
"data": {
"fields": [
{
"key": "Invoice Code",
"value": "3100231130",
"position": [
{
"page": 0,
"vertices": [0, 0, 100, 0, 100, 100, 0, 100]
}
]
},
{
"key": "Invoice Number",
"value": "28737000",
"position": [
{
"page": 0,
"vertices": [0, 0, 100, 0, 100, 100, 0, 100]
}
]
}
],
"items": [[
{
"key": "Goods and Services Name",
"value": "*Electronic Computer*Microcomputer Host",
"position": [
{
"page": 0,
"vertices": [0, 0, 100, 0, 100, 100, 0, 100]
}
]
},
{
"key": "Specification Model",
"value": "DMS-SC68",
"position": [
{
"page": 0,
"vertices": [0, 0, 100, 0, 100, 100, 0, 100]
}
]
}
], [
{
"key": "Goods and Services Name",
"value": "*Mechanical Computer*Supercomputer Host",
"position": [
{
"page": 0,
"vertices": [0, 0, 100, 0, 100, 100, 0, 100]
}
]
},
{
"key": "Specification Model",
"value": "AN/FSQ-7",
"position": [
{
"page": 0,
"vertices": [0, 0, 100, 0, 100, 100, 0, 100]
}
]
}
]]
}
}
]
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([
{
workspace_id: 1234567890,
file_id: 202412190001,
data: {
fields: [
{
key: 'Invoice Code',
value: '3100231130',
position: [{page: 0, vertices: [0, 0, 100, 0, 100, 100, 0, 100]}]
},
{
key: 'Invoice Number',
value: '28737000',
position: [{page: 0, vertices: [0, 0, 100, 0, 100, 100, 0, 100]}]
}
],
items: [
[
{
key: 'Goods and Services Name',
value: '*Electronic Computer*Microcomputer Host',
position: [{page: 0, vertices: [0, 0, 100, 0, 100, 100, 0, 100]}]
},
{
key: 'Specification Model',
value: 'DMS-SC68',
position: [{page: 0, vertices: [0, 0, 100, 0, 100, 100, 0, 100]}]
}
],
[
{
key: 'Goods and Services Name',
value: '*Mechanical Computer*Supercomputer Host',
position: [{page: 0, vertices: [0, 0, 100, 0, 100, 100, 0, 100]}]
},
{
key: 'Specification Model',
value: 'AN/FSQ-7',
position: [{page: 0, vertices: [0, 0, 100, 0, 100, 100, 0, 100]}]
}
]
]
}
}
])
};
fetch('https://docflow.textin.ai/api/app-api/sip/platform/v2/file/update', 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.ai/api/app-api/sip/platform/v2/file/update",
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([
[
'workspace_id' => 1234567890,
'file_id' => 202412190001,
'data' => [
'fields' => [
[
'key' => 'Invoice Code',
'value' => '3100231130',
'position' => [
[
'page' => 0,
'vertices' => [
0,
0,
100,
0,
100,
100,
0,
100
]
]
]
],
[
'key' => 'Invoice Number',
'value' => '28737000',
'position' => [
[
'page' => 0,
'vertices' => [
0,
0,
100,
0,
100,
100,
0,
100
]
]
]
]
],
'items' => [
[
[
'key' => 'Goods and Services Name',
'value' => '*Electronic Computer*Microcomputer Host',
'position' => [
[
'page' => 0,
'vertices' => [
0,
0,
100,
0,
100,
100,
0,
100
]
]
]
],
[
'key' => 'Specification Model',
'value' => 'DMS-SC68',
'position' => [
[
'page' => 0,
'vertices' => [
0,
0,
100,
0,
100,
100,
0,
100
]
]
]
]
],
[
[
'key' => 'Goods and Services Name',
'value' => '*Mechanical Computer*Supercomputer Host',
'position' => [
[
'page' => 0,
'vertices' => [
0,
0,
100,
0,
100,
100,
0,
100
]
]
]
],
[
'key' => 'Specification Model',
'value' => 'AN/FSQ-7',
'position' => [
[
'page' => 0,
'vertices' => [
0,
0,
100,
0,
100,
100,
0,
100
]
]
]
]
]
]
]
]
]),
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.ai/api/app-api/sip/platform/v2/file/update"
payload := strings.NewReader("[\n {\n \"workspace_id\": 1234567890,\n \"file_id\": 202412190001,\n \"data\": {\n \"fields\": [\n {\n \"key\": \"Invoice Code\",\n \"value\": \"3100231130\",\n \"position\": [\n {\n \"page\": 0,\n \"vertices\": [\n 0,\n 0,\n 100,\n 0,\n 100,\n 100,\n 0,\n 100\n ]\n }\n ]\n },\n {\n \"key\": \"Invoice Number\",\n \"value\": \"28737000\",\n \"position\": [\n {\n \"page\": 0,\n \"vertices\": [\n 0,\n 0,\n 100,\n 0,\n 100,\n 100,\n 0,\n 100\n ]\n }\n ]\n }\n ],\n \"items\": [\n [\n {\n \"key\": \"Goods and Services Name\",\n \"value\": \"*Electronic Computer*Microcomputer Host\",\n \"position\": [\n {\n \"page\": 0,\n \"vertices\": [\n 0,\n 0,\n 100,\n 0,\n 100,\n 100,\n 0,\n 100\n ]\n }\n ]\n },\n {\n \"key\": \"Specification Model\",\n \"value\": \"DMS-SC68\",\n \"position\": [\n {\n \"page\": 0,\n \"vertices\": [\n 0,\n 0,\n 100,\n 0,\n 100,\n 100,\n 0,\n 100\n ]\n }\n ]\n }\n ],\n [\n {\n \"key\": \"Goods and Services Name\",\n \"value\": \"*Mechanical Computer*Supercomputer Host\",\n \"position\": [\n {\n \"page\": 0,\n \"vertices\": [\n 0,\n 0,\n 100,\n 0,\n 100,\n 100,\n 0,\n 100\n ]\n }\n ]\n },\n {\n \"key\": \"Specification Model\",\n \"value\": \"AN/FSQ-7\",\n \"position\": [\n {\n \"page\": 0,\n \"vertices\": [\n 0,\n 0,\n 100,\n 0,\n 100,\n 100,\n 0,\n 100\n ]\n }\n ]\n }\n ]\n ]\n }\n }\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.ai/api/app-api/sip/platform/v2/file/update")
.header("x-ti-app-id", "<api-key>")
.header("x-ti-secret-code", "<api-key>")
.header("Content-Type", "application/json")
.body("[\n {\n \"workspace_id\": 1234567890,\n \"file_id\": 202412190001,\n \"data\": {\n \"fields\": [\n {\n \"key\": \"Invoice Code\",\n \"value\": \"3100231130\",\n \"position\": [\n {\n \"page\": 0,\n \"vertices\": [\n 0,\n 0,\n 100,\n 0,\n 100,\n 100,\n 0,\n 100\n ]\n }\n ]\n },\n {\n \"key\": \"Invoice Number\",\n \"value\": \"28737000\",\n \"position\": [\n {\n \"page\": 0,\n \"vertices\": [\n 0,\n 0,\n 100,\n 0,\n 100,\n 100,\n 0,\n 100\n ]\n }\n ]\n }\n ],\n \"items\": [\n [\n {\n \"key\": \"Goods and Services Name\",\n \"value\": \"*Electronic Computer*Microcomputer Host\",\n \"position\": [\n {\n \"page\": 0,\n \"vertices\": [\n 0,\n 0,\n 100,\n 0,\n 100,\n 100,\n 0,\n 100\n ]\n }\n ]\n },\n {\n \"key\": \"Specification Model\",\n \"value\": \"DMS-SC68\",\n \"position\": [\n {\n \"page\": 0,\n \"vertices\": [\n 0,\n 0,\n 100,\n 0,\n 100,\n 100,\n 0,\n 100\n ]\n }\n ]\n }\n ],\n [\n {\n \"key\": \"Goods and Services Name\",\n \"value\": \"*Mechanical Computer*Supercomputer Host\",\n \"position\": [\n {\n \"page\": 0,\n \"vertices\": [\n 0,\n 0,\n 100,\n 0,\n 100,\n 100,\n 0,\n 100\n ]\n }\n ]\n },\n {\n \"key\": \"Specification Model\",\n \"value\": \"AN/FSQ-7\",\n \"position\": [\n {\n \"page\": 0,\n \"vertices\": [\n 0,\n 0,\n 100,\n 0,\n 100,\n 100,\n 0,\n 100\n ]\n }\n ]\n }\n ]\n ]\n }\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://docflow.textin.ai/api/app-api/sip/platform/v2/file/update")
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 {\n \"workspace_id\": 1234567890,\n \"file_id\": 202412190001,\n \"data\": {\n \"fields\": [\n {\n \"key\": \"Invoice Code\",\n \"value\": \"3100231130\",\n \"position\": [\n {\n \"page\": 0,\n \"vertices\": [\n 0,\n 0,\n 100,\n 0,\n 100,\n 100,\n 0,\n 100\n ]\n }\n ]\n },\n {\n \"key\": \"Invoice Number\",\n \"value\": \"28737000\",\n \"position\": [\n {\n \"page\": 0,\n \"vertices\": [\n 0,\n 0,\n 100,\n 0,\n 100,\n 100,\n 0,\n 100\n ]\n }\n ]\n }\n ],\n \"items\": [\n [\n {\n \"key\": \"Goods and Services Name\",\n \"value\": \"*Electronic Computer*Microcomputer Host\",\n \"position\": [\n {\n \"page\": 0,\n \"vertices\": [\n 0,\n 0,\n 100,\n 0,\n 100,\n 100,\n 0,\n 100\n ]\n }\n ]\n },\n {\n \"key\": \"Specification Model\",\n \"value\": \"DMS-SC68\",\n \"position\": [\n {\n \"page\": 0,\n \"vertices\": [\n 0,\n 0,\n 100,\n 0,\n 100,\n 100,\n 0,\n 100\n ]\n }\n ]\n }\n ],\n [\n {\n \"key\": \"Goods and Services Name\",\n \"value\": \"*Mechanical Computer*Supercomputer Host\",\n \"position\": [\n {\n \"page\": 0,\n \"vertices\": [\n 0,\n 0,\n 100,\n 0,\n 100,\n 100,\n 0,\n 100\n ]\n }\n ]\n },\n {\n \"key\": \"Specification Model\",\n \"value\": \"AN/FSQ-7\",\n \"position\": [\n {\n \"page\": 0,\n \"vertices\": [\n 0,\n 0,\n 100,\n 0,\n 100,\n 100,\n 0,\n 100\n ]\n }\n ]\n }\n ]\n ]\n }\n }\n]"
response = http.request(request)
puts response.read_body{
"code": 200,
"msg": "<string>",
"result": {
"files": [
{
"workspace_id": 1234567890,
"id": 202412190001
}
]
}
}API Reference
Update File Processing Result
Update file processing result. Usually used after manual review and proofreading to upload modified key-value pairs, overriding automatically recognized results.
POST
/
api
/
app-api
/
sip
/
platform
/
v2
/
file
/
update
Update File Processing Result
curl --request POST \
--url https://docflow.textin.ai/api/app-api/sip/platform/v2/file/update \
--header 'Content-Type: application/json' \
--header 'x-ti-app-id: <api-key>' \
--header 'x-ti-secret-code: <api-key>' \
--data '
[
{
"workspace_id": 1234567890,
"file_id": 202412190001,
"data": {
"fields": [
{
"key": "Invoice Code",
"value": "3100231130",
"position": [
{
"page": 0,
"vertices": [
0,
0,
100,
0,
100,
100,
0,
100
]
}
]
},
{
"key": "Invoice Number",
"value": "28737000",
"position": [
{
"page": 0,
"vertices": [
0,
0,
100,
0,
100,
100,
0,
100
]
}
]
}
],
"items": [
[
{
"key": "Goods and Services Name",
"value": "*Electronic Computer*Microcomputer Host",
"position": [
{
"page": 0,
"vertices": [
0,
0,
100,
0,
100,
100,
0,
100
]
}
]
},
{
"key": "Specification Model",
"value": "DMS-SC68",
"position": [
{
"page": 0,
"vertices": [
0,
0,
100,
0,
100,
100,
0,
100
]
}
]
}
],
[
{
"key": "Goods and Services Name",
"value": "*Mechanical Computer*Supercomputer Host",
"position": [
{
"page": 0,
"vertices": [
0,
0,
100,
0,
100,
100,
0,
100
]
}
]
},
{
"key": "Specification Model",
"value": "AN/FSQ-7",
"position": [
{
"page": 0,
"vertices": [
0,
0,
100,
0,
100,
100,
0,
100
]
}
]
}
]
]
}
}
]
'import requests
url = "https://docflow.textin.ai/api/app-api/sip/platform/v2/file/update"
payload = [
{
"workspace_id": 1234567890,
"file_id": 202412190001,
"data": {
"fields": [
{
"key": "Invoice Code",
"value": "3100231130",
"position": [
{
"page": 0,
"vertices": [0, 0, 100, 0, 100, 100, 0, 100]
}
]
},
{
"key": "Invoice Number",
"value": "28737000",
"position": [
{
"page": 0,
"vertices": [0, 0, 100, 0, 100, 100, 0, 100]
}
]
}
],
"items": [[
{
"key": "Goods and Services Name",
"value": "*Electronic Computer*Microcomputer Host",
"position": [
{
"page": 0,
"vertices": [0, 0, 100, 0, 100, 100, 0, 100]
}
]
},
{
"key": "Specification Model",
"value": "DMS-SC68",
"position": [
{
"page": 0,
"vertices": [0, 0, 100, 0, 100, 100, 0, 100]
}
]
}
], [
{
"key": "Goods and Services Name",
"value": "*Mechanical Computer*Supercomputer Host",
"position": [
{
"page": 0,
"vertices": [0, 0, 100, 0, 100, 100, 0, 100]
}
]
},
{
"key": "Specification Model",
"value": "AN/FSQ-7",
"position": [
{
"page": 0,
"vertices": [0, 0, 100, 0, 100, 100, 0, 100]
}
]
}
]]
}
}
]
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([
{
workspace_id: 1234567890,
file_id: 202412190001,
data: {
fields: [
{
key: 'Invoice Code',
value: '3100231130',
position: [{page: 0, vertices: [0, 0, 100, 0, 100, 100, 0, 100]}]
},
{
key: 'Invoice Number',
value: '28737000',
position: [{page: 0, vertices: [0, 0, 100, 0, 100, 100, 0, 100]}]
}
],
items: [
[
{
key: 'Goods and Services Name',
value: '*Electronic Computer*Microcomputer Host',
position: [{page: 0, vertices: [0, 0, 100, 0, 100, 100, 0, 100]}]
},
{
key: 'Specification Model',
value: 'DMS-SC68',
position: [{page: 0, vertices: [0, 0, 100, 0, 100, 100, 0, 100]}]
}
],
[
{
key: 'Goods and Services Name',
value: '*Mechanical Computer*Supercomputer Host',
position: [{page: 0, vertices: [0, 0, 100, 0, 100, 100, 0, 100]}]
},
{
key: 'Specification Model',
value: 'AN/FSQ-7',
position: [{page: 0, vertices: [0, 0, 100, 0, 100, 100, 0, 100]}]
}
]
]
}
}
])
};
fetch('https://docflow.textin.ai/api/app-api/sip/platform/v2/file/update', 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.ai/api/app-api/sip/platform/v2/file/update",
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([
[
'workspace_id' => 1234567890,
'file_id' => 202412190001,
'data' => [
'fields' => [
[
'key' => 'Invoice Code',
'value' => '3100231130',
'position' => [
[
'page' => 0,
'vertices' => [
0,
0,
100,
0,
100,
100,
0,
100
]
]
]
],
[
'key' => 'Invoice Number',
'value' => '28737000',
'position' => [
[
'page' => 0,
'vertices' => [
0,
0,
100,
0,
100,
100,
0,
100
]
]
]
]
],
'items' => [
[
[
'key' => 'Goods and Services Name',
'value' => '*Electronic Computer*Microcomputer Host',
'position' => [
[
'page' => 0,
'vertices' => [
0,
0,
100,
0,
100,
100,
0,
100
]
]
]
],
[
'key' => 'Specification Model',
'value' => 'DMS-SC68',
'position' => [
[
'page' => 0,
'vertices' => [
0,
0,
100,
0,
100,
100,
0,
100
]
]
]
]
],
[
[
'key' => 'Goods and Services Name',
'value' => '*Mechanical Computer*Supercomputer Host',
'position' => [
[
'page' => 0,
'vertices' => [
0,
0,
100,
0,
100,
100,
0,
100
]
]
]
],
[
'key' => 'Specification Model',
'value' => 'AN/FSQ-7',
'position' => [
[
'page' => 0,
'vertices' => [
0,
0,
100,
0,
100,
100,
0,
100
]
]
]
]
]
]
]
]
]),
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.ai/api/app-api/sip/platform/v2/file/update"
payload := strings.NewReader("[\n {\n \"workspace_id\": 1234567890,\n \"file_id\": 202412190001,\n \"data\": {\n \"fields\": [\n {\n \"key\": \"Invoice Code\",\n \"value\": \"3100231130\",\n \"position\": [\n {\n \"page\": 0,\n \"vertices\": [\n 0,\n 0,\n 100,\n 0,\n 100,\n 100,\n 0,\n 100\n ]\n }\n ]\n },\n {\n \"key\": \"Invoice Number\",\n \"value\": \"28737000\",\n \"position\": [\n {\n \"page\": 0,\n \"vertices\": [\n 0,\n 0,\n 100,\n 0,\n 100,\n 100,\n 0,\n 100\n ]\n }\n ]\n }\n ],\n \"items\": [\n [\n {\n \"key\": \"Goods and Services Name\",\n \"value\": \"*Electronic Computer*Microcomputer Host\",\n \"position\": [\n {\n \"page\": 0,\n \"vertices\": [\n 0,\n 0,\n 100,\n 0,\n 100,\n 100,\n 0,\n 100\n ]\n }\n ]\n },\n {\n \"key\": \"Specification Model\",\n \"value\": \"DMS-SC68\",\n \"position\": [\n {\n \"page\": 0,\n \"vertices\": [\n 0,\n 0,\n 100,\n 0,\n 100,\n 100,\n 0,\n 100\n ]\n }\n ]\n }\n ],\n [\n {\n \"key\": \"Goods and Services Name\",\n \"value\": \"*Mechanical Computer*Supercomputer Host\",\n \"position\": [\n {\n \"page\": 0,\n \"vertices\": [\n 0,\n 0,\n 100,\n 0,\n 100,\n 100,\n 0,\n 100\n ]\n }\n ]\n },\n {\n \"key\": \"Specification Model\",\n \"value\": \"AN/FSQ-7\",\n \"position\": [\n {\n \"page\": 0,\n \"vertices\": [\n 0,\n 0,\n 100,\n 0,\n 100,\n 100,\n 0,\n 100\n ]\n }\n ]\n }\n ]\n ]\n }\n }\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.ai/api/app-api/sip/platform/v2/file/update")
.header("x-ti-app-id", "<api-key>")
.header("x-ti-secret-code", "<api-key>")
.header("Content-Type", "application/json")
.body("[\n {\n \"workspace_id\": 1234567890,\n \"file_id\": 202412190001,\n \"data\": {\n \"fields\": [\n {\n \"key\": \"Invoice Code\",\n \"value\": \"3100231130\",\n \"position\": [\n {\n \"page\": 0,\n \"vertices\": [\n 0,\n 0,\n 100,\n 0,\n 100,\n 100,\n 0,\n 100\n ]\n }\n ]\n },\n {\n \"key\": \"Invoice Number\",\n \"value\": \"28737000\",\n \"position\": [\n {\n \"page\": 0,\n \"vertices\": [\n 0,\n 0,\n 100,\n 0,\n 100,\n 100,\n 0,\n 100\n ]\n }\n ]\n }\n ],\n \"items\": [\n [\n {\n \"key\": \"Goods and Services Name\",\n \"value\": \"*Electronic Computer*Microcomputer Host\",\n \"position\": [\n {\n \"page\": 0,\n \"vertices\": [\n 0,\n 0,\n 100,\n 0,\n 100,\n 100,\n 0,\n 100\n ]\n }\n ]\n },\n {\n \"key\": \"Specification Model\",\n \"value\": \"DMS-SC68\",\n \"position\": [\n {\n \"page\": 0,\n \"vertices\": [\n 0,\n 0,\n 100,\n 0,\n 100,\n 100,\n 0,\n 100\n ]\n }\n ]\n }\n ],\n [\n {\n \"key\": \"Goods and Services Name\",\n \"value\": \"*Mechanical Computer*Supercomputer Host\",\n \"position\": [\n {\n \"page\": 0,\n \"vertices\": [\n 0,\n 0,\n 100,\n 0,\n 100,\n 100,\n 0,\n 100\n ]\n }\n ]\n },\n {\n \"key\": \"Specification Model\",\n \"value\": \"AN/FSQ-7\",\n \"position\": [\n {\n \"page\": 0,\n \"vertices\": [\n 0,\n 0,\n 100,\n 0,\n 100,\n 100,\n 0,\n 100\n ]\n }\n ]\n }\n ]\n ]\n }\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://docflow.textin.ai/api/app-api/sip/platform/v2/file/update")
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 {\n \"workspace_id\": 1234567890,\n \"file_id\": 202412190001,\n \"data\": {\n \"fields\": [\n {\n \"key\": \"Invoice Code\",\n \"value\": \"3100231130\",\n \"position\": [\n {\n \"page\": 0,\n \"vertices\": [\n 0,\n 0,\n 100,\n 0,\n 100,\n 100,\n 0,\n 100\n ]\n }\n ]\n },\n {\n \"key\": \"Invoice Number\",\n \"value\": \"28737000\",\n \"position\": [\n {\n \"page\": 0,\n \"vertices\": [\n 0,\n 0,\n 100,\n 0,\n 100,\n 100,\n 0,\n 100\n ]\n }\n ]\n }\n ],\n \"items\": [\n [\n {\n \"key\": \"Goods and Services Name\",\n \"value\": \"*Electronic Computer*Microcomputer Host\",\n \"position\": [\n {\n \"page\": 0,\n \"vertices\": [\n 0,\n 0,\n 100,\n 0,\n 100,\n 100,\n 0,\n 100\n ]\n }\n ]\n },\n {\n \"key\": \"Specification Model\",\n \"value\": \"DMS-SC68\",\n \"position\": [\n {\n \"page\": 0,\n \"vertices\": [\n 0,\n 0,\n 100,\n 0,\n 100,\n 100,\n 0,\n 100\n ]\n }\n ]\n }\n ],\n [\n {\n \"key\": \"Goods and Services Name\",\n \"value\": \"*Mechanical Computer*Supercomputer Host\",\n \"position\": [\n {\n \"page\": 0,\n \"vertices\": [\n 0,\n 0,\n 100,\n 0,\n 100,\n 100,\n 0,\n 100\n ]\n }\n ]\n },\n {\n \"key\": \"Specification Model\",\n \"value\": \"AN/FSQ-7\",\n \"position\": [\n {\n \"page\": 0,\n \"vertices\": [\n 0,\n 0,\n 100,\n 0,\n 100,\n 100,\n 0,\n 100\n ]\n }\n ]\n }\n ]\n ]\n }\n }\n]"
response = http.request(request)
puts response.read_body{
"code": 200,
"msg": "<string>",
"result": {
"files": [
{
"workspace_id": 1234567890,
"id": 202412190001
}
]
}
}Body
application/json
Workspace ID
Example:
1234567890
File ID
Example:
202412190001
Full field update. Note: Even if only updating partial fields, all fields must be included. If the incoming fields are more than the original fields, the additional fields will be added. If the incoming fields are fewer than the original fields, the missing fields will be deleted. If the incoming field values differ from the original field values, the field values will be updated. If the incoming fields are identical to the original fields, the fields will be preserved.
Show child attributes
Show child attributes
⌘I

