Upload Docs Async
curl --request POST \
--url https://api.reportify.cn/v1/docs/upload/async \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"docs": [
{
"url": "<string>",
"name": "<string>",
"metadatas": {
"period": "2023Q4",
"entities": [
"公司A",
"公司B"
]
},
"published_at": 123,
"tags": {}
}
],
"folder_id": "<string>",
"pdf_parsing_mode": 1
}
'import requests
url = "https://api.reportify.cn/v1/docs/upload/async"
payload = {
"docs": [
{
"url": "<string>",
"name": "<string>",
"metadatas": {
"period": "2023Q4",
"entities": ["公司A", "公司B"]
},
"published_at": 123,
"tags": {}
}
],
"folder_id": "<string>",
"pdf_parsing_mode": 1
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
docs: [
{
url: '<string>',
name: '<string>',
metadatas: {period: '2023Q4', entities: ['公司A', '公司B']},
published_at: 123,
tags: {}
}
],
folder_id: '<string>',
pdf_parsing_mode: 1
})
};
fetch('https://api.reportify.cn/v1/docs/upload/async', 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://api.reportify.cn/v1/docs/upload/async",
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([
'docs' => [
[
'url' => '<string>',
'name' => '<string>',
'metadatas' => [
'period' => '2023Q4',
'entities' => [
'公司A',
'公司B'
]
],
'published_at' => 123,
'tags' => [
]
]
],
'folder_id' => '<string>',
'pdf_parsing_mode' => 1
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://api.reportify.cn/v1/docs/upload/async"
payload := strings.NewReader("{\n \"docs\": [\n {\n \"url\": \"<string>\",\n \"name\": \"<string>\",\n \"metadatas\": {\n \"period\": \"2023Q4\",\n \"entities\": [\n \"公司A\",\n \"公司B\"\n ]\n },\n \"published_at\": 123,\n \"tags\": {}\n }\n ],\n \"folder_id\": \"<string>\",\n \"pdf_parsing_mode\": 1\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.reportify.cn/v1/docs/upload/async")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"docs\": [\n {\n \"url\": \"<string>\",\n \"name\": \"<string>\",\n \"metadatas\": {\n \"period\": \"2023Q4\",\n \"entities\": [\n \"公司A\",\n \"公司B\"\n ]\n },\n \"published_at\": 123,\n \"tags\": {}\n }\n ],\n \"folder_id\": \"<string>\",\n \"pdf_parsing_mode\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.reportify.cn/v1/docs/upload/async")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"docs\": [\n {\n \"url\": \"<string>\",\n \"name\": \"<string>\",\n \"metadatas\": {\n \"period\": \"2023Q4\",\n \"entities\": [\n \"公司A\",\n \"公司B\"\n ]\n },\n \"published_at\": 123,\n \"tags\": {}\n }\n ],\n \"folder_id\": \"<string>\",\n \"pdf_parsing_mode\": 1\n}"
response = http.request(request)
puts response.read_body{
"docs": [
{
"id": "<string>",
"title": "<string>",
"original_url": "<string>"
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}知识库和文件管理
Docs Upload Async
OAI docs upload async
POST
/
v1
/
docs
/
upload
/
async
Upload Docs Async
curl --request POST \
--url https://api.reportify.cn/v1/docs/upload/async \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"docs": [
{
"url": "<string>",
"name": "<string>",
"metadatas": {
"period": "2023Q4",
"entities": [
"公司A",
"公司B"
]
},
"published_at": 123,
"tags": {}
}
],
"folder_id": "<string>",
"pdf_parsing_mode": 1
}
'import requests
url = "https://api.reportify.cn/v1/docs/upload/async"
payload = {
"docs": [
{
"url": "<string>",
"name": "<string>",
"metadatas": {
"period": "2023Q4",
"entities": ["公司A", "公司B"]
},
"published_at": 123,
"tags": {}
}
],
"folder_id": "<string>",
"pdf_parsing_mode": 1
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
docs: [
{
url: '<string>',
name: '<string>',
metadatas: {period: '2023Q4', entities: ['公司A', '公司B']},
published_at: 123,
tags: {}
}
],
folder_id: '<string>',
pdf_parsing_mode: 1
})
};
fetch('https://api.reportify.cn/v1/docs/upload/async', 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://api.reportify.cn/v1/docs/upload/async",
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([
'docs' => [
[
'url' => '<string>',
'name' => '<string>',
'metadatas' => [
'period' => '2023Q4',
'entities' => [
'公司A',
'公司B'
]
],
'published_at' => 123,
'tags' => [
]
]
],
'folder_id' => '<string>',
'pdf_parsing_mode' => 1
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://api.reportify.cn/v1/docs/upload/async"
payload := strings.NewReader("{\n \"docs\": [\n {\n \"url\": \"<string>\",\n \"name\": \"<string>\",\n \"metadatas\": {\n \"period\": \"2023Q4\",\n \"entities\": [\n \"公司A\",\n \"公司B\"\n ]\n },\n \"published_at\": 123,\n \"tags\": {}\n }\n ],\n \"folder_id\": \"<string>\",\n \"pdf_parsing_mode\": 1\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.reportify.cn/v1/docs/upload/async")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"docs\": [\n {\n \"url\": \"<string>\",\n \"name\": \"<string>\",\n \"metadatas\": {\n \"period\": \"2023Q4\",\n \"entities\": [\n \"公司A\",\n \"公司B\"\n ]\n },\n \"published_at\": 123,\n \"tags\": {}\n }\n ],\n \"folder_id\": \"<string>\",\n \"pdf_parsing_mode\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.reportify.cn/v1/docs/upload/async")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"docs\": [\n {\n \"url\": \"<string>\",\n \"name\": \"<string>\",\n \"metadatas\": {\n \"period\": \"2023Q4\",\n \"entities\": [\n \"公司A\",\n \"公司B\"\n ]\n },\n \"published_at\": 123,\n \"tags\": {}\n }\n ],\n \"folder_id\": \"<string>\",\n \"pdf_parsing_mode\": 1\n}"
response = http.request(request)
puts response.read_body{
"docs": [
{
"id": "<string>",
"title": "<string>",
"original_url": "<string>"
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}同步上传文档
URL:/v1/docs/upload/async方法:
POST描述: 同步上传单篇报告文档至指定文件夹。
请求参数
| 参数名 | 类型 | 描述 |
|---|---|---|
| folder_id | str | 目标文件夹 ID。 |
| docs | array | 文档数组,每个文档包含以下字段: |
| name | str | 文档名称。 |
| url | str | 文档的互联网 URL 路径。 |
| published_at | str | 发布时间,格式为 millisecond timestamp 1712832000000。 |
| tags | dict | 标签数组。 |
| key | str | 标签类型(如 industry, company, person, event)。 |
| value | array | 标签内容数组。 |
| metadatas | dict | 元数据字典,包含以下字段: |
| key | str | 元数据类型(如 periods, entities)。 |
| value | array | 元数据内容数组。 |
响应参数
| 参数名 | 类型 | 描述 |
|---|---|---|
| docs | array | 文档数组,每个文档包含以下字段: |
| id | str | 文档唯一 ID |
| title | str | 文档标题 |
| original_url | str | 文档原始URL |
请求示例
cURLcurl -X POST https://api.reportify.cn/v1/docs/upload/async \
-H "Authorization: Bearer 447460****09c9" \
-H "Content-Type: application/json" \
-d '{
"folder_id": "folder_12345",
"name": "Tesla AI Report",
"url": "https://files.reportify.cn/tesla_report.pdf",
"metadatas": {
"periods": "Q4 2023",
"entities": [
"Tesla Inc.",
"TSLA"
]
}
}'
import requests
url = "https://api.reportify.cn/v1/docs/upload/async"
headers = {
"Authorization": "Bearer 447460****09c9",
"Content-Type": "application/json"
}
payload = {
"folder_id": "folder_12345",
"docs": [
{
"name": "Tesla AI Report",
"url": "https://files.reportify.cn/tesla_report.pdf",
"metadatas": {
"periods": "Q4 2023",
"entities": [
"Tesla Inc.",
"TSLA"
]
}
}
]
}
response = requests.post(url, headers=headers, json=payload)
print(response.json())
响应示例
{
"docs": [
{
"id": "doc_67890",
"title": "Tesla AI Report",
"original_url": "https://files.reportify.cn/tesla_report_uploaded.pdf"
}
]
}
Authorizations
Enter your Bearer token
Body
application/json
Response
Successful Response
Show child attributes
Show child attributes
⌘I
