cURL
curl --request POST \
--url https://agents.textin.com/doc-agent/api/v1/capability/division/lookup \
--header 'Content-Type: application/json' \
--header 'x-ti-app-id: <x-ti-app-id>' \
--header 'x-ti-secret-code: <x-ti-secret-code>' \
--data '{
"name": "成都"
}'import requests
url = "https://agents.textin.com/doc-agent/api/v1/capability/division/lookup"
payload = { "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({name: '成都'})
};
fetch('https://agents.textin.com/doc-agent/api/v1/capability/division/lookup', 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/division/lookup",
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([
'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/division/lookup"
payload := strings.NewReader("{\n \"name\": \"成都\"\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/division/lookup")
.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 \"name\": \"成都\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://agents.textin.com/doc-agent/api/v1/capability/division/lookup")
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 \"name\": \"成都\"\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"data": {
"divisions": [
{
"city_code": "510100",
"city_name": "成都市",
"code": "510100",
"name": "成都市",
"preferred_code": "510100",
"province_code": "510000",
"province_name": "四川省"
}
]
},
"message": "OK"
}医疗数据库
行政区划查询
行政区划查询 根据名称模糊匹配省/市/县三级行政区划,返回的 preferred_code 可作为 SearchSocialInsurance 接口的 zone_code 参数使用。
POST
/
doc-agent
/
api
/
v1
/
capability
/
division
/
lookup
cURL
curl --request POST \
--url https://agents.textin.com/doc-agent/api/v1/capability/division/lookup \
--header 'Content-Type: application/json' \
--header 'x-ti-app-id: <x-ti-app-id>' \
--header 'x-ti-secret-code: <x-ti-secret-code>' \
--data '{
"name": "成都"
}'import requests
url = "https://agents.textin.com/doc-agent/api/v1/capability/division/lookup"
payload = { "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({name: '成都'})
};
fetch('https://agents.textin.com/doc-agent/api/v1/capability/division/lookup', 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/division/lookup",
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([
'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/division/lookup"
payload := strings.NewReader("{\n \"name\": \"成都\"\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/division/lookup")
.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 \"name\": \"成都\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://agents.textin.com/doc-agent/api/v1/capability/division/lookup")
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 \"name\": \"成都\"\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"data": {
"divisions": [
{
"city_code": "510100",
"city_name": "成都市",
"code": "510100",
"name": "成都市",
"preferred_code": "510100",
"province_code": "510000",
"province_name": "四川省"
}
]
},
"message": "OK"
}⌘I