cURL
curl --request POST \
--url https://agents.textin.com/doc-agent/api/v1/capability/field-config/set \
--header 'Content-Type: application/json' \
--header 'x-ti-app-id: <x-ti-app-id>' \
--header 'x-ti-secret-code: <x-ti-secret-code>' \
--data '
{
"classifications": [
{
"classification_name": "医疗门诊收费票据(电子)",
"fields": [
{
"enabled": true,
"field_name": "票据代码"
},
{
"enabled": false,
"field_name": "开票日期"
}
]
},
{
"classification_name": "住院费用明细清单",
"fields": [
{
"enabled": true,
"field_name": "姓名"
},
{
"enabled": false,
"field_name": "住院天数"
}
]
}
]
}
'import requests
url = "https://agents.textin.com/doc-agent/api/v1/capability/field-config/set"
payload = { "classifications": [
{
"classification_name": "医疗门诊收费票据(电子)",
"fields": [
{
"enabled": True,
"field_name": "票据代码"
},
{
"enabled": False,
"field_name": "开票日期"
}
]
},
{
"classification_name": "住院费用明细清单",
"fields": [
{
"enabled": True,
"field_name": "姓名"
},
{
"enabled": False,
"field_name": "住院天数"
}
]
}
] }
headers = {
"x-ti-app-id": "<x-ti-app-id>",
"x-ti-secret-code": "<x-ti-secret-code>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-ti-app-id': '<x-ti-app-id>',
'x-ti-secret-code': '<x-ti-secret-code>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
classifications: [
{
classification_name: '医疗门诊收费票据(电子)',
fields: [{enabled: true, field_name: '票据代码'}, {enabled: false, field_name: '开票日期'}]
},
{
classification_name: '住院费用明细清单',
fields: [{enabled: true, field_name: '姓名'}, {enabled: false, field_name: '住院天数'}]
}
]
})
};
fetch('https://agents.textin.com/doc-agent/api/v1/capability/field-config/set', 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://agents.textin.com/doc-agent/api/v1/capability/field-config/set",
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([
'classifications' => [
[
'classification_name' => '医疗门诊收费票据(电子)',
'fields' => [
[
'enabled' => true,
'field_name' => '票据代码'
],
[
'enabled' => false,
'field_name' => '开票日期'
]
]
],
[
'classification_name' => '住院费用明细清单',
'fields' => [
[
'enabled' => true,
'field_name' => '姓名'
],
[
'enabled' => false,
'field_name' => '住院天数'
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-ti-app-id: <x-ti-app-id>",
"x-ti-secret-code: <x-ti-secret-code>"
],
]);
$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://agents.textin.com/doc-agent/api/v1/capability/field-config/set"
payload := strings.NewReader("{\n \"classifications\": [\n {\n \"classification_name\": \"医疗门诊收费票据(电子)\",\n \"fields\": [\n {\n \"enabled\": true,\n \"field_name\": \"票据代码\"\n },\n {\n \"enabled\": false,\n \"field_name\": \"开票日期\"\n }\n ]\n },\n {\n \"classification_name\": \"住院费用明细清单\",\n \"fields\": [\n {\n \"enabled\": true,\n \"field_name\": \"姓名\"\n },\n {\n \"enabled\": false,\n \"field_name\": \"住院天数\"\n }\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-ti-app-id", "<x-ti-app-id>")
req.Header.Add("x-ti-secret-code", "<x-ti-secret-code>")
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://agents.textin.com/doc-agent/api/v1/capability/field-config/set")
.header("x-ti-app-id", "<x-ti-app-id>")
.header("x-ti-secret-code", "<x-ti-secret-code>")
.header("Content-Type", "application/json")
.body("{\n \"classifications\": [\n {\n \"classification_name\": \"医疗门诊收费票据(电子)\",\n \"fields\": [\n {\n \"enabled\": true,\n \"field_name\": \"票据代码\"\n },\n {\n \"enabled\": false,\n \"field_name\": \"开票日期\"\n }\n ]\n },\n {\n \"classification_name\": \"住院费用明细清单\",\n \"fields\": [\n {\n \"enabled\": true,\n \"field_name\": \"姓名\"\n },\n {\n \"enabled\": false,\n \"field_name\": \"住院天数\"\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://agents.textin.com/doc-agent/api/v1/capability/field-config/set")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-ti-app-id"] = '<x-ti-app-id>'
request["x-ti-secret-code"] = '<x-ti-secret-code>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"classifications\": [\n {\n \"classification_name\": \"医疗门诊收费票据(电子)\",\n \"fields\": [\n {\n \"enabled\": true,\n \"field_name\": \"票据代码\"\n },\n {\n \"enabled\": false,\n \"field_name\": \"开票日期\"\n }\n ]\n },\n {\n \"classification_name\": \"住院费用明细清单\",\n \"fields\": [\n {\n \"enabled\": true,\n \"field_name\": \"姓名\"\n },\n {\n \"enabled\": false,\n \"field_name\": \"住院天数\"\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"data": {},
"message": "OK"
}字段配置
设置字段配置
设置字段配置。批量设置一个或多个分类下抽取字段的启用/禁用状态。 配置按调用方维度持久化存储,后续该调用方的抽取请求自动遵循。
行为说明:
- 只设置明确传入的字段,未提及的字段保持现有配置不变
- 不存在的分类名或字段名静默忽略(不报错)
- 幂等:重复调用相同请求结果一致
POST
/
doc-agent
/
api
/
v1
/
capability
/
field-config
/
set
cURL
curl --request POST \
--url https://agents.textin.com/doc-agent/api/v1/capability/field-config/set \
--header 'Content-Type: application/json' \
--header 'x-ti-app-id: <x-ti-app-id>' \
--header 'x-ti-secret-code: <x-ti-secret-code>' \
--data '
{
"classifications": [
{
"classification_name": "医疗门诊收费票据(电子)",
"fields": [
{
"enabled": true,
"field_name": "票据代码"
},
{
"enabled": false,
"field_name": "开票日期"
}
]
},
{
"classification_name": "住院费用明细清单",
"fields": [
{
"enabled": true,
"field_name": "姓名"
},
{
"enabled": false,
"field_name": "住院天数"
}
]
}
]
}
'import requests
url = "https://agents.textin.com/doc-agent/api/v1/capability/field-config/set"
payload = { "classifications": [
{
"classification_name": "医疗门诊收费票据(电子)",
"fields": [
{
"enabled": True,
"field_name": "票据代码"
},
{
"enabled": False,
"field_name": "开票日期"
}
]
},
{
"classification_name": "住院费用明细清单",
"fields": [
{
"enabled": True,
"field_name": "姓名"
},
{
"enabled": False,
"field_name": "住院天数"
}
]
}
] }
headers = {
"x-ti-app-id": "<x-ti-app-id>",
"x-ti-secret-code": "<x-ti-secret-code>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-ti-app-id': '<x-ti-app-id>',
'x-ti-secret-code': '<x-ti-secret-code>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
classifications: [
{
classification_name: '医疗门诊收费票据(电子)',
fields: [{enabled: true, field_name: '票据代码'}, {enabled: false, field_name: '开票日期'}]
},
{
classification_name: '住院费用明细清单',
fields: [{enabled: true, field_name: '姓名'}, {enabled: false, field_name: '住院天数'}]
}
]
})
};
fetch('https://agents.textin.com/doc-agent/api/v1/capability/field-config/set', 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://agents.textin.com/doc-agent/api/v1/capability/field-config/set",
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([
'classifications' => [
[
'classification_name' => '医疗门诊收费票据(电子)',
'fields' => [
[
'enabled' => true,
'field_name' => '票据代码'
],
[
'enabled' => false,
'field_name' => '开票日期'
]
]
],
[
'classification_name' => '住院费用明细清单',
'fields' => [
[
'enabled' => true,
'field_name' => '姓名'
],
[
'enabled' => false,
'field_name' => '住院天数'
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-ti-app-id: <x-ti-app-id>",
"x-ti-secret-code: <x-ti-secret-code>"
],
]);
$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://agents.textin.com/doc-agent/api/v1/capability/field-config/set"
payload := strings.NewReader("{\n \"classifications\": [\n {\n \"classification_name\": \"医疗门诊收费票据(电子)\",\n \"fields\": [\n {\n \"enabled\": true,\n \"field_name\": \"票据代码\"\n },\n {\n \"enabled\": false,\n \"field_name\": \"开票日期\"\n }\n ]\n },\n {\n \"classification_name\": \"住院费用明细清单\",\n \"fields\": [\n {\n \"enabled\": true,\n \"field_name\": \"姓名\"\n },\n {\n \"enabled\": false,\n \"field_name\": \"住院天数\"\n }\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-ti-app-id", "<x-ti-app-id>")
req.Header.Add("x-ti-secret-code", "<x-ti-secret-code>")
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://agents.textin.com/doc-agent/api/v1/capability/field-config/set")
.header("x-ti-app-id", "<x-ti-app-id>")
.header("x-ti-secret-code", "<x-ti-secret-code>")
.header("Content-Type", "application/json")
.body("{\n \"classifications\": [\n {\n \"classification_name\": \"医疗门诊收费票据(电子)\",\n \"fields\": [\n {\n \"enabled\": true,\n \"field_name\": \"票据代码\"\n },\n {\n \"enabled\": false,\n \"field_name\": \"开票日期\"\n }\n ]\n },\n {\n \"classification_name\": \"住院费用明细清单\",\n \"fields\": [\n {\n \"enabled\": true,\n \"field_name\": \"姓名\"\n },\n {\n \"enabled\": false,\n \"field_name\": \"住院天数\"\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://agents.textin.com/doc-agent/api/v1/capability/field-config/set")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-ti-app-id"] = '<x-ti-app-id>'
request["x-ti-secret-code"] = '<x-ti-secret-code>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"classifications\": [\n {\n \"classification_name\": \"医疗门诊收费票据(电子)\",\n \"fields\": [\n {\n \"enabled\": true,\n \"field_name\": \"票据代码\"\n },\n {\n \"enabled\": false,\n \"field_name\": \"开票日期\"\n }\n ]\n },\n {\n \"classification_name\": \"住院费用明细清单\",\n \"fields\": [\n {\n \"enabled\": true,\n \"field_name\": \"姓名\"\n },\n {\n \"enabled\": false,\n \"field_name\": \"住院天数\"\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"data": {},
"message": "OK"
}Body
application/json
分类字段配置列表(支持同时设置多个分类) fields 控制独立字段,tables 控制表格及其列字段
Show child attributes
Show child attributes
Example:
[
{
"classification_name": "医疗门诊收费票据(电子)",
"fields": [{ "enabled": false, "field_name": "票据代码" }],
"tables": [
{
"enabled": true,
"fields": [{ "enabled": false, "field_name": "项目名称" }],
"table_name": "费用明细"
}
]
}
]
⌘I