POST /jobs/:id/cancel (取消任务)

介绍

本 API 让请求者取消一个集智任务。取消后,集智任务会视为直接过期。没有工作者可以再接受此任务,但已接受任务的工作者仍能将工作做完。

HTTP Request

URL

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

HTTP Method

POST

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。
若没成功,系统则会返回错误的代码及原因。

1
2
3
{
"result": true
}

示例

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

请求

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

API_URL = 'https://api.crowdsdom.com/v1/jobs/507f191e810c19729devxbbx/cancel'

headers = {'Authorization': 'YOUR_ACCESS_TOKEN'}

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

回复

1
2
3
{
"result": true
}