Blog - API

API documentation

API documentation

Account

/worker/b_delete_task/<task_id> PUT

Delete revised task.

Parameters:

task_id

Task ID

Return values:

SUCCESS

status=SUCCESS, task_id=[Task ID], message=Task has been removed

ERROR

status=ERROR, error=[error message*], task_id=[Task ID]

*[UNKNOWN TASK|ONLY REVISE TASK CAN BE DELETED]

Code:

cURL:

curl -H "MicroworkersApiKey:YOUR_API_KEY" -X PUT "https://api.microworkers.com/worker/b_delete_task/1234567" -d ""

PHP:

<?php

include "includes/RESTClient.php";
define("cAPI_KEY", "YOUR_API_KEY");
define("cAPI_URL", "https://api.microworkers.com");
$client = new RESTClient();
$client->setApiKey(cAPI_KEY);
$client->setUrl(cAPI_URL . "/worker/b_delete_task/1234567");
$client->setMethod("PUT");
$client->execute();
$response = $client->getLastResponse();
$client->resetClient();
echo $response;

?>

Perl:

use MW_API;
use Data::Dumper qw(Dumper);
my $mw_api = MW_API->new('api_key' => 'YOUR_API_KEY');
my $res = $mw_api->do_request('PUT', '/worker/b_delete_task/1234567');
print Dumper($res);

Python:

from pprint import pprint
from MW_API import MW_API
mw_api = MW_API('YOUR_API_KEY')
res = mw_api.do_request('PUT', '/worker/b_delete_task/1234567')
pprint(res)

C#:

using System;
using MWAPI;

public class Test
{
  public static void Main (string[] args)
  {
    MW_API MW_API_Client = new MW_API ("YOUR_API_KEY");
    NameValueCollection postData = new NameValueCollection();
    string body = MW_API_Client.putRequest("/worker/b_delete_task/1234567", postData);
    Console.WriteLine (body);
  }
}

Examples:

https://api.microworkers.com/worker/b_delete_task/1234567

{
  "status": "SUCCESS",
  "task_id": "1234567",
  "message": "Task has been removed"
}

https://api.microworkers.com/worker/b_delete_task/12345678

{
  "status": "ERROR",
  "task_id": "12345678",
  "error": "UNKNOWN TASK"
}