批量获取任务状态 V2
curl --request POST \
--url https://openapi.bazhuayu.com/cloudextraction/statuses/v2 \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"taskIds": [
"<string>"
]
}
'import requests
url = "https://openapi.bazhuayu.com/cloudextraction/statuses/v2"
payload = { "taskIds": ["<string>"] }
headers = {
"Authorization": "<authorization>",
"Content-Type": "<content-type>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': '<content-type>'},
body: JSON.stringify({taskIds: ['<string>']})
};
fetch('https://openapi.bazhuayu.com/cloudextraction/statuses/v2', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': '<content-type>'},
body: JSON.stringify({taskIds: ['<string>']})
};
fetch('https://openapi.bazhuayu.com/cloudextraction/statuses/v2', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://openapi.bazhuayu.com/cloudextraction/statuses/v2"
payload := strings.NewReader("{\n \"taskIds\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("Content-Type", "<content-type>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://openapi.bazhuayu.com/cloudextraction/statuses/v2")
.header("Authorization", "<authorization>")
.header("Content-Type", "<content-type>")
.body("{\n \"taskIds\": [\n \"<string>\"\n ]\n}")
.asString();<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://openapi.bazhuayu.com/cloudextraction/statuses/v2",
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([
'taskIds' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <content-type>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}require 'uri'
require 'net/http'
url = URI("https://openapi.bazhuayu.com/cloudextraction/statuses/v2")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = '<content-type>'
request.body = "{\n \"taskIds\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_bodyusing RestSharp;
var options = new RestClientOptions("https://openapi.bazhuayu.com/cloudextraction/statuses/v2");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "<authorization>");
request.AddJsonBody("{\n \"taskIds\": [\n \"<string>\"\n ]\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"taskIds\": [\n \"<string>\"\n ]\n}")
val request = Request.Builder()
.url("https://openapi.bazhuayu.com/cloudextraction/statuses/v2")
.post(body)
.addHeader("Authorization", "<authorization>")
.addHeader("Content-Type", "<content-type>")
.build()
val response = client.newCall(request).execute()false云采集
批量获取任务状态 V2
POST
/
cloudextraction
/
statuses
/
v2
批量获取任务状态 V2
curl --request POST \
--url https://openapi.bazhuayu.com/cloudextraction/statuses/v2 \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"taskIds": [
"<string>"
]
}
'import requests
url = "https://openapi.bazhuayu.com/cloudextraction/statuses/v2"
payload = { "taskIds": ["<string>"] }
headers = {
"Authorization": "<authorization>",
"Content-Type": "<content-type>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': '<content-type>'},
body: JSON.stringify({taskIds: ['<string>']})
};
fetch('https://openapi.bazhuayu.com/cloudextraction/statuses/v2', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': '<content-type>'},
body: JSON.stringify({taskIds: ['<string>']})
};
fetch('https://openapi.bazhuayu.com/cloudextraction/statuses/v2', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://openapi.bazhuayu.com/cloudextraction/statuses/v2"
payload := strings.NewReader("{\n \"taskIds\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("Content-Type", "<content-type>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://openapi.bazhuayu.com/cloudextraction/statuses/v2")
.header("Authorization", "<authorization>")
.header("Content-Type", "<content-type>")
.body("{\n \"taskIds\": [\n \"<string>\"\n ]\n}")
.asString();<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://openapi.bazhuayu.com/cloudextraction/statuses/v2",
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([
'taskIds' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <content-type>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}require 'uri'
require 'net/http'
url = URI("https://openapi.bazhuayu.com/cloudextraction/statuses/v2")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = '<content-type>'
request.body = "{\n \"taskIds\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_bodyusing RestSharp;
var options = new RestClientOptions("https://openapi.bazhuayu.com/cloudextraction/statuses/v2");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "<authorization>");
request.AddJsonBody("{\n \"taskIds\": [\n \"<string>\"\n ]\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"taskIds\": [\n \"<string>\"\n ]\n}")
val request = Request.Builder()
.url("https://openapi.bazhuayu.com/cloudextraction/statuses/v2")
.post(body)
.addHeader("Authorization", "<authorization>")
.addHeader("Content-Type", "<content-type>")
.build()
val response = client.newCall(request).execute()false所需套餐: 旗舰+、企业版、团队版
端点
POST https://openapi.bazhuayu.com/cloudextraction/statuses/v2
描述
此接口接收用户传入的一批任务ID,返回相应的任务状态列表。调用频率:1秒5次请求。请求头
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
Authorization | String | 是 | 身份令牌 |
Content-Type | String | 是 | application/json |
{
"Authorization":"Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6ImdXS3hWc0F4SHhaMDlDcWh6NkNJb3ciLCJ0eXAiOiJhdCtqd3QifQ.eyJuYmYiOjE2MzY0NjIyNzAsImV4cCI6MTYzNjU0ODY2OSwiaXNzIjoiaHR0cDovL3Rlc3QuaWRlbnRpdHkuYmF6aHVheXUuY29tIiwiY2xpZW50X2lkIjoiT2N0b3B1cyIsInN1YiI6IjllOGJiM2VhLWUwMWQtNGFlZC05ODM3LTVhMWUyODg0NWI5ZSIsImF1dGhfdGltZSI6MTYzNjQ2MjI3MCwiaWRwIjoibG9jYWwiLC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D-9tpztFwB54sd0D4CyOBnESkKrUwjxchYYZo4l1O7auiZVGV48YhZYMw"
"Content-Type":"application/json"
}
请求体
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
taskIds | String[] | 是 | 任务Id列表 |
{
"taskIds": [
"a3b9bdf7-9aaa-22f6-9ccf-b32790f6df8f",
"86b9bdf7-9aaa-22236-9ccf-b3279469df01"
]
}
响应
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
data | Object[] | 是 | 响应数据 |
taskId | String | 是 | 任务Id |
status | String | 是 | 任务状态:Unexecuted - 未执行,Waiting - 等待分配,Extracting - 采集中,Stopped - 已停止,Finished - 已完成 |
currentTotalExtractCount | Int | 是 | 此次采集数据量 |
executedTimes | Int | 是 | 执行次数 |
subTaskCount | Int | 是 | 子任务数 |
nextExecuteTime | String | 是 | 下次执行时间 |
startExecuteTime | String | 是 | 任务启动时间 |
ExecutingTime | String | 是 | 任务开始执行时间 |
endExecuteTime | String | 是 | 任务结束时间 |
startExecuteTimeSeconds | String | 是 | 任务采集花费时间(秒) |
requestId | String | 是 | 请求Id |
{
"data": [
{
"taskId": "a3b9bdf7-9aaa-22f6-9ccf-b32790f6df8f",
"status": "Extracting",
"currentTotalExtractCount": 0,
"executedTimes": 1,
"subTaskCount": 1,
"nextExecuteTime": "2018-04-04T20:34:20.973",
"endExecuteTime": "2018-04-04T18:34:20.973",
"startExecuteTime": "2018-04-04T18:34:20.973"
}
],
"requestId": "0HMD469L0I8R0:00000001"
}
错误响应
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
requestId | String | 是 | 请求Id |
error | Object | 是 | 错误信息,参考错误码 |
code | String | 是 | 错误码 |
message | String | 是 | 错误描述 |
{
"error": {
"code": "ServerError",
"message": "Internal Server Error"
},
"requestId": "0HMD469L0I8R0:00000001"
}
⌘I
