PUT /tasks/:id/reject (拒绝指定工作)

介绍

本 API 让请求者拒绝一个已提交的指定工作。请求者不用支付费用给被拒绝的工作者。 拒绝后,系统会把该任务再让其他的工作者接受。你也可以选择提供一段简短的反馈给完成工作的工作者。让被拒绝的工作者知道被拒绝的原因可以帮助他们进步,让他们在下一次做任务时有更好的表现。

HTTP Request

URL

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

HTTP Method

PUT

HTTP Header

Content-Type: application/json
Authorization: YOUR_ACCESS_TOKEN

参数

URL

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

名称 描述 Type Default Required
id 欲拒绝的指定工作的专属识别号 String None Yes


Body

名称 描述 Type Default Required
feedback 给工作者的反馈 String None No

回复

若 http request 成功拒绝指定工作,则将返回 status code : 200。
若没成功,系统则会返回错误的代码及原因。

示例

请求

1
2
3
4
5
6
7
8
# -*- encoding: utf-8 -*-
import requests

API_URL = 'https://api.crowdsdom.com/v1/tasks/5639c1dc831c7b22009b71ef/approve'

headers = {'Authorization': 'YOUR_ACCESS_TOKEN'}

response = requests.post(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
53
54
{
"job": {
"updatedAt": "2015-11-04T09:44:33.434Z",
"keywords": [],
"lifetime": 86400,
"id": "5639c1dc831c7b22009b71ef",
"numberOfTasksReturned": 0,
"taskDuration": 300,
"title": "判断微博内容有无地域歧视",
"numberOfTasksAvailable": 0,
"jobTypeId": "56385ed9831c7b22009b712d",
"autoApprovalDelay": 3600,
"createdAt": "2015-11-04T08:29:16.744Z",
"maxTasks": 1,
"expirationTime": "2015-11-05T08:29:16.744Z",
"status": "completed",
"description": "根据微博回答问题",
"reviewStatus": "NotReviewed",
"numberOfTasksSubmitted": 0,
"numberOfTasksRejected": 0,
"externalQuestionsForm": {
"url": "http://wb_region/survey",
"frameHeight": 500
},
"numberOfTasksApproved": 1,
"assignable": false,
"questionsType": "externalQuestionsForm",
"numberOfTasksPending": 0,
"ownerId": "56309424f1524a2b002310d5",
"reward": {
"amount": 0.1,
"formattedPrice": "0.10元"
}
},
"task": {
"status": "rejected",
"approvalTime": "2015-11-04T09:44:33.420Z",
"submitTime": null,
"answers": [
{
"status": "success"
}
],
"jobId": "5639c1dc831c7b22009b71ef",
"acceptTime": "2015-11-04T09:21:51.274Z",
"requesterId": "56309424f1524a2b002310d5",
"updatedAt": "2015-11-04T09:44:33.420Z",
"contributorId": "563172bc9b7dbf2b00612c31",
"expirationTime": "2015-11-04T09:26:51.274Z",
"id": "5639ce2f831c7b22009b7253",
"createdAt": "2015-11-04T09:21:51.274Z",
"rejectionTime": null
}
}