主题
获取脚本执行状态
将创建并执行脚本接口返回的 task_id 进行 encodeURIComponent 编码之后,通过轮循该接口可以实时获取执行情况,已经获取过的日志信息不会重复获取
基本信息
请求方法:GET
请求路径:/api/v1/openapi/personal/personal/script/status
请求主机:developer.kdocs.cn
限流频次
应用类型 | 限额 |
---|---|
测试应用 | 10,000 次/天 |
正式应用 | 1,000,000 次/天 |
权限范围
权限值 | 显示名称 | 权限说明 |
---|---|---|
access_personal_files | 访问个人文档 | 访问用户个人文档 |
Query 参数
参数 | 必须 | 类型 | 说明 |
---|---|---|---|
access_token | 是 | string | |
task_id | 是 | string | 脚本任务执行 ID |
返回参数
参数 | 类型 | 说明 |
---|---|---|
code | integer | 错误码 |
data | object {} | 响应数据 |
示例
请求示例(log 的使用)
log 是脚本在执行过程中打印的日志信息,已经获取过的 log 不会重复获取
- 启动一个简单的脚本,打印一个 foo,过一秒后打印 bar
curl --request POST \
--url 'https://developer.kdocs.cn/api/v1/openapi/personal/files/G_xvUrobayOMXvA4IJFVq19n6epm0T7PjYphWo-N3cE/script?access_token=kvqxrspxjctdojjqdildjhonzwusaquc' \
--data '{"script":"console.log(\"foo\")\r\nTime.sleep(1000)\r\nconsole.log(\"bar\")","script_name":"test"}'
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"script\":\"console.log(\\\"foo\\\")\\r\\nTime.sleep(1000)\\r\\nconsole.log(\\\"bar\\\")\",\"script_name\":\"test\"}");
Request request = new Request.Builder()
.url("https://developer.kdocs.cn/api/v1/openapi/personal/files/G_xvUrobayOMXvA4IJFVq19n6epm0T7PjYphWo-N3cE/script?access_token=kvqxrspxjctdojjqdildjhonzwusaquc")
.post(body)
.build();
Response response = client.newCall(request).execute();
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://developer.kdocs.cn/api/v1/openapi/personal/files/G_xvUrobayOMXvA4IJFVq19n6epm0T7PjYphWo-N3cE/script?access_token=kvqxrspxjctdojjqdildjhonzwusaquc"
payload := strings.NewReader("{\"script\":\"console.log(\\\"foo\\\")\\r\\nTime.sleep(1000)\\r\\nconsole.log(\\\"bar\\\")\",\"script_name\":\"test\"}")
req, _ := http.NewRequest("POST", url, payload)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
import http.client
conn = http.client.HTTPSConnection("developer.kdocs.cn")
payload = "{\"script\":\"console.log(\\\"foo\\\")\\r\\nTime.sleep(1000)\\r\\nconsole.log(\\\"bar\\\")\",\"script_name\":\"test\"}"
conn.request("POST", "/api/v1/openapi/personal/files/G_xvUrobayOMXvA4IJFVq19n6epm0T7PjYphWo-N3cE/script?access_token=kvqxrspxjctdojjqdildjhonzwusaquc", payload)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://developer.kdocs.cn/api/v1/openapi/personal/files/G_xvUrobayOMXvA4IJFVq19n6epm0T7PjYphWo-N3cE/script?access_token=kvqxrspxjctdojjqdildjhonzwusaquc",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\"script\":\"console.log(\\\"foo\\\")\\r\\nTime.sleep(1000)\\r\\nconsole.log(\\\"bar\\\")\",\"script_name\":\"test\"}",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
const data = JSON.stringify({
"script": "console.log(\"foo\")\r\nTime.sleep(1000)\r\nconsole.log(\"bar\")",
"script_name": "test"
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://developer.kdocs.cn/api/v1/openapi/personal/files/G_xvUrobayOMXvA4IJFVq19n6epm0T7PjYphWo-N3cE/script?access_token=kvqxrspxjctdojjqdildjhonzwusaquc");
xhr.send(data);
const http = require("https");
const options = {
"method": "POST",
"hostname": "developer.kdocs.cn",
"port": null,
"path": "/api/v1/openapi/personal/files/G_xvUrobayOMXvA4IJFVq19n6epm0T7PjYphWo-N3cE/script?access_token=kvqxrspxjctdojjqdildjhonzwusaquc",
"headers": {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
script: 'console.log("foo")\r\nTime.sleep(1000)\r\nconsole.log("bar")',
script_name: 'test'
}));
req.end();
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "https://developer.kdocs.cn/api/v1/openapi/personal/files/G_xvUrobayOMXvA4IJFVq19n6epm0T7PjYphWo-N3cE/script?access_token=kvqxrspxjctdojjqdildjhonzwusaquc");
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\"script\":\"console.log(\\\"foo\\\")\\r\\nTime.sleep(1000)\\r\\nconsole.log(\\\"bar\\\")\",\"script_name\":\"test\"}");
CURLcode ret = curl_easy_perform(hnd);
var client = new RestClient("https://developer.kdocs.cn/api/v1/openapi/personal/files/G_xvUrobayOMXvA4IJFVq19n6epm0T7PjYphWo-N3cE/script?access_token=kvqxrspxjctdojjqdildjhonzwusaquc");
var request = new RestRequest(Method.POST);
request.AddParameter("undefined", "{\"script\":\"console.log(\\\"foo\\\")\\r\\nTime.sleep(1000)\\r\\nconsole.log(\\\"bar\\\")\",\"script_name\":\"test\"}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
- 利用该 taskid 获取执行情况,(已忽略脚本日志内容)
curl --request GET \
--url 'https://developer.kdocs.cn/api/v1/openapi/personal/script/status?access_token=kvqxrspxjctdojjqdildjhonzwusaquc&task_id=ID7HWqZ3dheDcYlOF1PdBVCFNM9I5nCmnWwgJqCkX3tSIx6XL3kswKpqqKdgh1YhZ1AOp1GiVgTu42iHLB9mfy2A9KZdAP%252FdLIGRAbCkc7vNzXU92RuPdCs44LDZdmn1NvisgBMcXIcseg%253D%253D'
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://developer.kdocs.cn/api/v1/openapi/personal/script/status?access_token=kvqxrspxjctdojjqdildjhonzwusaquc&task_id=ID7HWqZ3dheDcYlOF1PdBVCFNM9I5nCmnWwgJqCkX3tSIx6XL3kswKpqqKdgh1YhZ1AOp1GiVgTu42iHLB9mfy2A9KZdAP%252FdLIGRAbCkc7vNzXU92RuPdCs44LDZdmn1NvisgBMcXIcseg%253D%253D")
.get()
.build();
Response response = client.newCall(request).execute();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://developer.kdocs.cn/api/v1/openapi/personal/script/status?access_token=kvqxrspxjctdojjqdildjhonzwusaquc&task_id=ID7HWqZ3dheDcYlOF1PdBVCFNM9I5nCmnWwgJqCkX3tSIx6XL3kswKpqqKdgh1YhZ1AOp1GiVgTu42iHLB9mfy2A9KZdAP%252FdLIGRAbCkc7vNzXU92RuPdCs44LDZdmn1NvisgBMcXIcseg%253D%253D"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
import http.client
conn = http.client.HTTPSConnection("developer.kdocs.cn")
conn.request("GET", "/api/v1/openapi/personal/script/status?access_token=kvqxrspxjctdojjqdildjhonzwusaquc&task_id=ID7HWqZ3dheDcYlOF1PdBVCFNM9I5nCmnWwgJqCkX3tSIx6XL3kswKpqqKdgh1YhZ1AOp1GiVgTu42iHLB9mfy2A9KZdAP%252FdLIGRAbCkc7vNzXU92RuPdCs44LDZdmn1NvisgBMcXIcseg%253D%253D")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://developer.kdocs.cn/api/v1/openapi/personal/script/status?access_token=kvqxrspxjctdojjqdildjhonzwusaquc&task_id=ID7HWqZ3dheDcYlOF1PdBVCFNM9I5nCmnWwgJqCkX3tSIx6XL3kswKpqqKdgh1YhZ1AOp1GiVgTu42iHLB9mfy2A9KZdAP%252FdLIGRAbCkc7vNzXU92RuPdCs44LDZdmn1NvisgBMcXIcseg%253D%253D",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://developer.kdocs.cn/api/v1/openapi/personal/script/status?access_token=kvqxrspxjctdojjqdildjhonzwusaquc&task_id=ID7HWqZ3dheDcYlOF1PdBVCFNM9I5nCmnWwgJqCkX3tSIx6XL3kswKpqqKdgh1YhZ1AOp1GiVgTu42iHLB9mfy2A9KZdAP%252FdLIGRAbCkc7vNzXU92RuPdCs44LDZdmn1NvisgBMcXIcseg%253D%253D");
xhr.send(data);
const http = require("https");
const options = {
"method": "GET",
"hostname": "developer.kdocs.cn",
"port": null,
"path": "/api/v1/openapi/personal/script/status?access_token=kvqxrspxjctdojjqdildjhonzwusaquc&task_id=ID7HWqZ3dheDcYlOF1PdBVCFNM9I5nCmnWwgJqCkX3tSIx6XL3kswKpqqKdgh1YhZ1AOp1GiVgTu42iHLB9mfy2A9KZdAP%252FdLIGRAbCkc7vNzXU92RuPdCs44LDZdmn1NvisgBMcXIcseg%253D%253D",
"headers": {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "https://developer.kdocs.cn/api/v1/openapi/personal/script/status?access_token=kvqxrspxjctdojjqdildjhonzwusaquc&task_id=ID7HWqZ3dheDcYlOF1PdBVCFNM9I5nCmnWwgJqCkX3tSIx6XL3kswKpqqKdgh1YhZ1AOp1GiVgTu42iHLB9mfy2A9KZdAP%252FdLIGRAbCkc7vNzXU92RuPdCs44LDZdmn1NvisgBMcXIcseg%253D%253D");
CURLcode ret = curl_easy_perform(hnd);
var client = new RestClient("https://developer.kdocs.cn/api/v1/openapi/personal/script/status?access_token=kvqxrspxjctdojjqdildjhonzwusaquc&task_id=ID7HWqZ3dheDcYlOF1PdBVCFNM9I5nCmnWwgJqCkX3tSIx6XL3kswKpqqKdgh1YhZ1AOp1GiVgTu42iHLB9mfy2A9KZdAP%252FdLIGRAbCkc7vNzXU92RuPdCs44LDZdmn1NvisgBMcXIcseg%253D%253D");
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
返回示例
- 获取 foo 的 log
{
"error": "",
"status": "running",
"data": {
"logs": [
{
"args": ["已开始执行"],
"filename": "system",
"level": "info",
"unix_time": 1667462203,
"timestamp": "17:29:58.114"
},
{
"args": ["foo"],
"filename": "test.ks:1:1",
"level": "info",
"unix_time": 1667462203,
"timestamp": "17:29:58.114"
}
],
"result": ""
}
}
- 一秒后再调用该接口获取 bar 的 log
{
"error": "",
"status": "finish",
"data": {
"logs": [
{
"args": ["bar"],
"filename": "test.ks:3:1",
"level": "info",
"unix_time": 1667462203,
"timestamp": "17:29:59.114"
},
{
"args": ["执行完毕"],
"filename": "system",
"level": "info",
"unix_time": 1667462203,
"timestamp": "17:29:59.114"
}
],
"result": "[Undefined]"
}
}
请求示例(result 的使用)
一系列的指令串联构成脚本,result 代表脚本最后一条指令的执行返回值
- 启动一个简单的脚本,Application.Range("A1").Text,获取 A1 单元格的值
curl --request POST \
--url 'https://developer.kdocs.cn/api/v1/openapi/personal/files/G_xvUrobayOMXvA4IJFVq19n6epm0T7PjYphWo-N3cE/script?access_token=kvqxrspxjctdojjqdildjhonzwusaquc' \
--data '{"script":"Application.Range(\"A1\").Text"}'
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"script\":\"Application.Range(\\\"A1\\\").Text\"}");
Request request = new Request.Builder()
.url("https://developer.kdocs.cn/api/v1/openapi/personal/files/G_xvUrobayOMXvA4IJFVq19n6epm0T7PjYphWo-N3cE/script?access_token=kvqxrspxjctdojjqdildjhonzwusaquc")
.post(body)
.build();
Response response = client.newCall(request).execute();
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://developer.kdocs.cn/api/v1/openapi/personal/files/G_xvUrobayOMXvA4IJFVq19n6epm0T7PjYphWo-N3cE/script?access_token=kvqxrspxjctdojjqdildjhonzwusaquc"
payload := strings.NewReader("{\"script\":\"Application.Range(\\\"A1\\\").Text\"}")
req, _ := http.NewRequest("POST", url, payload)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
import http.client
conn = http.client.HTTPSConnection("developer.kdocs.cn")
payload = "{\"script\":\"Application.Range(\\\"A1\\\").Text\"}"
conn.request("POST", "/api/v1/openapi/personal/files/G_xvUrobayOMXvA4IJFVq19n6epm0T7PjYphWo-N3cE/script?access_token=kvqxrspxjctdojjqdildjhonzwusaquc", payload)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://developer.kdocs.cn/api/v1/openapi/personal/files/G_xvUrobayOMXvA4IJFVq19n6epm0T7PjYphWo-N3cE/script?access_token=kvqxrspxjctdojjqdildjhonzwusaquc",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\"script\":\"Application.Range(\\\"A1\\\").Text\"}",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
const data = JSON.stringify({
"script": "Application.Range(\"A1\").Text"
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://developer.kdocs.cn/api/v1/openapi/personal/files/G_xvUrobayOMXvA4IJFVq19n6epm0T7PjYphWo-N3cE/script?access_token=kvqxrspxjctdojjqdildjhonzwusaquc");
xhr.send(data);
const http = require("https");
const options = {
"method": "POST",
"hostname": "developer.kdocs.cn",
"port": null,
"path": "/api/v1/openapi/personal/files/G_xvUrobayOMXvA4IJFVq19n6epm0T7PjYphWo-N3cE/script?access_token=kvqxrspxjctdojjqdildjhonzwusaquc",
"headers": {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({script: 'Application.Range("A1").Text'}));
req.end();
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "https://developer.kdocs.cn/api/v1/openapi/personal/files/G_xvUrobayOMXvA4IJFVq19n6epm0T7PjYphWo-N3cE/script?access_token=kvqxrspxjctdojjqdildjhonzwusaquc");
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\"script\":\"Application.Range(\\\"A1\\\").Text\"}");
CURLcode ret = curl_easy_perform(hnd);
var client = new RestClient("https://developer.kdocs.cn/api/v1/openapi/personal/files/G_xvUrobayOMXvA4IJFVq19n6epm0T7PjYphWo-N3cE/script?access_token=kvqxrspxjctdojjqdildjhonzwusaquc");
var request = new RestRequest(Method.POST);
request.AddParameter("undefined", "{\"script\":\"Application.Range(\\\"A1\\\").Text\"}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
- 利用该 taskid 获取执行情况(已忽略脚本日志内容)
curl --request GET \
--url 'https://developer.kdocs.cn/api/v1/openapi/personal/script/status?access_token=kvqxrspxjctdojjqdildjhonzwusaquc&task_id=ID7HWqZ3dheDcYlOF1PdBVCFNM9I5nCmnWwgJqCkX3tSIx6XL3kswKpqqKdgh1YhZ1AOp1GiVgTu42iHLB9mfy2A9KZdAP%252FdLIGRAbCkc7vNzXU92RuPdCs44LDZdmn1NvisgBMcXIcseg%253D%253D'
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://developer.kdocs.cn/api/v1/openapi/personal/script/status?access_token=kvqxrspxjctdojjqdildjhonzwusaquc&task_id=ID7HWqZ3dheDcYlOF1PdBVCFNM9I5nCmnWwgJqCkX3tSIx6XL3kswKpqqKdgh1YhZ1AOp1GiVgTu42iHLB9mfy2A9KZdAP%252FdLIGRAbCkc7vNzXU92RuPdCs44LDZdmn1NvisgBMcXIcseg%253D%253D")
.get()
.build();
Response response = client.newCall(request).execute();
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://developer.kdocs.cn/api/v1/openapi/personal/script/status?access_token=kvqxrspxjctdojjqdildjhonzwusaquc&task_id=ID7HWqZ3dheDcYlOF1PdBVCFNM9I5nCmnWwgJqCkX3tSIx6XL3kswKpqqKdgh1YhZ1AOp1GiVgTu42iHLB9mfy2A9KZdAP%252FdLIGRAbCkc7vNzXU92RuPdCs44LDZdmn1NvisgBMcXIcseg%253D%253D"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
import http.client
conn = http.client.HTTPSConnection("developer.kdocs.cn")
conn.request("GET", "/api/v1/openapi/personal/script/status?access_token=kvqxrspxjctdojjqdildjhonzwusaquc&task_id=ID7HWqZ3dheDcYlOF1PdBVCFNM9I5nCmnWwgJqCkX3tSIx6XL3kswKpqqKdgh1YhZ1AOp1GiVgTu42iHLB9mfy2A9KZdAP%252FdLIGRAbCkc7vNzXU92RuPdCs44LDZdmn1NvisgBMcXIcseg%253D%253D")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://developer.kdocs.cn/api/v1/openapi/personal/script/status?access_token=kvqxrspxjctdojjqdildjhonzwusaquc&task_id=ID7HWqZ3dheDcYlOF1PdBVCFNM9I5nCmnWwgJqCkX3tSIx6XL3kswKpqqKdgh1YhZ1AOp1GiVgTu42iHLB9mfy2A9KZdAP%252FdLIGRAbCkc7vNzXU92RuPdCs44LDZdmn1NvisgBMcXIcseg%253D%253D",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://developer.kdocs.cn/api/v1/openapi/personal/script/status?access_token=kvqxrspxjctdojjqdildjhonzwusaquc&task_id=ID7HWqZ3dheDcYlOF1PdBVCFNM9I5nCmnWwgJqCkX3tSIx6XL3kswKpqqKdgh1YhZ1AOp1GiVgTu42iHLB9mfy2A9KZdAP%252FdLIGRAbCkc7vNzXU92RuPdCs44LDZdmn1NvisgBMcXIcseg%253D%253D");
xhr.send(data);
const http = require("https");
const options = {
"method": "GET",
"hostname": "developer.kdocs.cn",
"port": null,
"path": "/api/v1/openapi/personal/script/status?access_token=kvqxrspxjctdojjqdildjhonzwusaquc&task_id=ID7HWqZ3dheDcYlOF1PdBVCFNM9I5nCmnWwgJqCkX3tSIx6XL3kswKpqqKdgh1YhZ1AOp1GiVgTu42iHLB9mfy2A9KZdAP%252FdLIGRAbCkc7vNzXU92RuPdCs44LDZdmn1NvisgBMcXIcseg%253D%253D",
"headers": {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "https://developer.kdocs.cn/api/v1/openapi/personal/script/status?access_token=kvqxrspxjctdojjqdildjhonzwusaquc&task_id=ID7HWqZ3dheDcYlOF1PdBVCFNM9I5nCmnWwgJqCkX3tSIx6XL3kswKpqqKdgh1YhZ1AOp1GiVgTu42iHLB9mfy2A9KZdAP%252FdLIGRAbCkc7vNzXU92RuPdCs44LDZdmn1NvisgBMcXIcseg%253D%253D");
CURLcode ret = curl_easy_perform(hnd);
var client = new RestClient("https://developer.kdocs.cn/api/v1/openapi/personal/script/status?access_token=kvqxrspxjctdojjqdildjhonzwusaquc&task_id=ID7HWqZ3dheDcYlOF1PdBVCFNM9I5nCmnWwgJqCkX3tSIx6XL3kswKpqqKdgh1YhZ1AOp1GiVgTu42iHLB9mfy2A9KZdAP%252FdLIGRAbCkc7vNzXU92RuPdCs44LDZdmn1NvisgBMcXIcseg%253D%253D");
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
返回示例
{
"error": "",
"status": "finish",
"data": {
"result": "bar"
}
}
错误码
请参考错误码说明