GET /jobs/:id/tasks (取得任务的指定工作)

GET /jobs/:id/tasks (取得任务的指定工作)

介绍

发布任务后,本 API 让请求者可以查看该任务所产生的指定工作的状态,获取工作者提交的结果,并根据指定工作的结果决定批准拒绝该指定工作。

HTTP Request

URL

https://api.crowdsdom.com/v1/jobs/:id/tasks

HTTP Method

GET

HTTP Header

Content-Type: application/json
Authorization: YOUR_ACCESS_TOKEN

参数

URL

以下的参数直接放在 http 请求的 URL 中。

名称 描述 Type Default Required
id 欲取得指定工作的任务专属识别号 String None Yes

回复

若 http request 成功取得任务的指定工作列表,则将返回 status code : 200及一个指定工作的阵列。
若没成功,系统则会返回错误的代码及原因。

示例

以Python requests 直接调用 API 接口为例:

请求

1
2
3
4
5
6
7
8

import requests

API_URL = 'https://api.crowdsdom.com/v1/jobs/507f191e810c19729de860ea/tasks'

headers = {'Authorization': 'YOUR_ACCESS_TOKEN'}

response = requests.get(API_URL, headers=headers)

回复

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52

[
{
id: '507f191e810c19729devxbbx',
status: 'submitted',
expirationTime: "Mon Oct 26 2015 07:17:24 GMT+0800 (CST)",
rejectionTime: null,
approvalTime: null,
submitTime: "Mon Oct 26 2015 07:17:24 GMT+0800 (CST)",
acceptTime: "Mon Oct 26 2015 07:17:24 GMT+0800 (CST)",
deadline: ,
answers: [
{
questionId: 'sentiment',
answer: ['neutral']

}
],
jobId: '507f191e810c19729de860ea',
contributorId: '507f191e810c19729de8adfaf'
},
{
id: '507f191e810c19bcvbfghbcv',
status: 'approved',
expirationTime: "Mon Oct 26 2015 07:17:24 GMT+0800 (CST)",
rejectionTime: null,
approvalTime: "Mon Oct 26 2015 07:17:24 GMT+0800 (CST)",
submitTime: "Mon Oct 26 2015 07:17:24 GMT+0800 (CST)",
acceptTime: "Mon Oct 26 2015 07:17:24 GMT+0800 (CST)",
answers: [
{
questionId: 'sentiment',
answer: ['positive']

}
],
jobId: '507f191e810c19729de860ea',
contributorId: '507f191e810c19729dgdfbvb'
},
{
id: '507f191e810c197dgdsfgrthgf',
status: 'init',
expirationTime: "Mon Oct 26 2015 07:17:24 GMT+0800 (CST)",
rejectionTime: null,
approvalTime: null,
submitTime: null,
acceptTime: "Mon Oct 26 2015 07:17:24 GMT+0800 (CST)",
jobId: '507f191e810c19729de860ea',
contributorId: '507f191e810c19729xvbxaf'
}

]

原文:大专栏  GET /jobs/:id/tasks (取得任务的指定工作)


猜你喜欢

转载自www.cnblogs.com/wangziqiang123/p/11618459.html
get