短期有効トークンを生成
curl --request GET \
--url https://docflow.textin.ai/api/app-api/sip/platform/v2/auth/token \
--header 'x-ti-app-id: <api-key>' \
--header 'x-ti-secret-code: <api-key>'import requests
url = "https://docflow.textin.ai/api/app-api/sip/platform/v2/auth/token"
headers = {
"x-ti-app-id": "<api-key>",
"x-ti-secret-code": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'x-ti-app-id': '<api-key>', 'x-ti-secret-code': '<api-key>'}
};
fetch('https://docflow.textin.ai/api/app-api/sip/platform/v2/auth/token', 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/auth/token",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://docflow.textin.ai/api/app-api/sip/platform/v2/auth/token"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-ti-app-id", "<api-key>")
req.Header.Add("x-ti-secret-code", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://docflow.textin.ai/api/app-api/sip/platform/v2/auth/token")
.header("x-ti-app-id", "<api-key>")
.header("x-ti-secret-code", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://docflow.textin.ai/api/app-api/sip/platform/v2/auth/token")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-ti-app-id"] = '<api-key>'
request["x-ti-secret-code"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"code": 200,
"msg": "<string>",
"result": {
"token": "abcd",
"expiry": 1700000000
}
}API Reference
短期有効トークンを生成
短期有効トークンを生成します(iframe シナリオ用)
GET
/
api
/
app-api
/
sip
/
platform
/
v2
/
auth
/
token
短期有効トークンを生成
curl --request GET \
--url https://docflow.textin.ai/api/app-api/sip/platform/v2/auth/token \
--header 'x-ti-app-id: <api-key>' \
--header 'x-ti-secret-code: <api-key>'import requests
url = "https://docflow.textin.ai/api/app-api/sip/platform/v2/auth/token"
headers = {
"x-ti-app-id": "<api-key>",
"x-ti-secret-code": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'x-ti-app-id': '<api-key>', 'x-ti-secret-code': '<api-key>'}
};
fetch('https://docflow.textin.ai/api/app-api/sip/platform/v2/auth/token', 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/auth/token",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://docflow.textin.ai/api/app-api/sip/platform/v2/auth/token"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-ti-app-id", "<api-key>")
req.Header.Add("x-ti-secret-code", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://docflow.textin.ai/api/app-api/sip/platform/v2/auth/token")
.header("x-ti-app-id", "<api-key>")
.header("x-ti-secret-code", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://docflow.textin.ai/api/app-api/sip/platform/v2/auth/token")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-ti-app-id"] = '<api-key>'
request["x-ti-secret-code"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"code": 200,
"msg": "<string>",
"result": {
"token": "abcd",
"expiry": 1700000000
}
}⌘I

