确认文件上传并入队
curl --request POST \
--url https://revor.ai/api/v2/imports/{runId}/complete \
--header 'Content-Type: application/json' \
--data '
{
"source_kind": "<string>",
"file_name": "<string>",
"declared_size_bytes": 123
}
'import requests
url = "https://revor.ai/api/v2/imports/{runId}/complete"
payload = {
"source_kind": "<string>",
"file_name": "<string>",
"declared_size_bytes": 123
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({source_kind: '<string>', file_name: '<string>', declared_size_bytes: 123})
};
fetch('https://revor.ai/api/v2/imports/{runId}/complete', 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://revor.ai/api/v2/imports/{runId}/complete",
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([
'source_kind' => '<string>',
'file_name' => '<string>',
'declared_size_bytes' => 123
]),
CURLOPT_HTTPHEADER => [
"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://revor.ai/api/v2/imports/{runId}/complete"
payload := strings.NewReader("{\n \"source_kind\": \"<string>\",\n \"file_name\": \"<string>\",\n \"declared_size_bytes\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
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://revor.ai/api/v2/imports/{runId}/complete")
.header("Content-Type", "application/json")
.body("{\n \"source_kind\": \"<string>\",\n \"file_name\": \"<string>\",\n \"declared_size_bytes\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://revor.ai/api/v2/imports/{runId}/complete")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"source_kind\": \"<string>\",\n \"file_name\": \"<string>\",\n \"declared_size_bytes\": 123\n}"
response = http.request(request)
puts response.read_body表格导入
确认文件上传并入队
通知系统文件已上传完毕,开始处理导入任务。
POST
/
api
/
v2
/
imports
/
{runId}
/
complete
确认文件上传并入队
curl --request POST \
--url https://revor.ai/api/v2/imports/{runId}/complete \
--header 'Content-Type: application/json' \
--data '
{
"source_kind": "<string>",
"file_name": "<string>",
"declared_size_bytes": 123
}
'import requests
url = "https://revor.ai/api/v2/imports/{runId}/complete"
payload = {
"source_kind": "<string>",
"file_name": "<string>",
"declared_size_bytes": 123
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({source_kind: '<string>', file_name: '<string>', declared_size_bytes: 123})
};
fetch('https://revor.ai/api/v2/imports/{runId}/complete', 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://revor.ai/api/v2/imports/{runId}/complete",
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([
'source_kind' => '<string>',
'file_name' => '<string>',
'declared_size_bytes' => 123
]),
CURLOPT_HTTPHEADER => [
"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://revor.ai/api/v2/imports/{runId}/complete"
payload := strings.NewReader("{\n \"source_kind\": \"<string>\",\n \"file_name\": \"<string>\",\n \"declared_size_bytes\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
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://revor.ai/api/v2/imports/{runId}/complete")
.header("Content-Type", "application/json")
.body("{\n \"source_kind\": \"<string>\",\n \"file_name\": \"<string>\",\n \"declared_size_bytes\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://revor.ai/api/v2/imports/{runId}/complete")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"source_kind\": \"<string>\",\n \"file_name\": \"<string>\",\n \"declared_size_bytes\": 123\n}"
response = http.request(request)
puts response.read_body文件上传完成后,调用此接口通知系统开始处理。需要提供
source_kind、file_name 和 declared_size_bytes。
接口概览
| 方法 | POST |
| 路径 | /api/v2/imports/{runId}/complete |
| 权限 | prospects.imports:write |
| 幂等性 | 通过 Idempotency-Key 请求头实现 |
路径参数
请求体
确认上传
{
"source_kind": "csv",
"file_name": "prospects.csv",
"declared_size_bytes": 1048576
}
请求示例
cURL
curl -X POST "https://revor.ai/api/v2/imports/import-uuid/complete" \
-H "Authorization: Bearer sk-revor-REPLACE_ME" \
-H "Idempotency-Key: import-complete-001" \
-H "Content-Type: application/json" \
-d '{
"source_kind": "csv",
"file_name": "prospects.csv",
"declared_size_bytes": 1048576
}'
行为说明
- 调用此接口后,系统开始处理导入任务
- 使用
Idempotency-Key防止重复处理 - 每个步骤使用不同键,同一步骤重试保留原键
- 不要跨步骤复用同一个幂等键
- 确认后调用
GET /imports/{runId}查询进度
响应
200
{
"item": {
"id": "import-uuid",
"webset_id": "webset-uuid",
"status": "processing",
"source_kind": "csv"
}
}
init 和 complete 均使用 Idempotency-Key;每个步骤使用不同键,同一步骤重试保留原键。不要跨步骤复用同一个幂等键。
