Blog - API

API documentation

API documentation

Account

/campaign_b/list_tasks/<campaign_id> GET

Returns Status & ID for all tasks submitted for this Campaign.

Parameters:

<campaign_id>

Campaign ID

Example values: e7162dd17b83

Return values:

SUCCESS

status=SUCCESS, tasks=[array of array (task ID, rating)]

ERROR

status=ERROR, error=[error message*]

*[NO SUCH CAMPAIGN]

Code:

cURL:

curl -H "MicroworkersApiKey:YOUR_API_KEY" -X GET https://api.microworkers.com/campaign_b/list_tasks/<campaign_id>

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 . "/campaign_b/list_tasks/e7162dd17b83");
$client->setMethod("GET");
$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('GET', '/campaign_b/list_tasks/e7162dd17b83');
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('GET', '/campaign_b/list_tasks/e7162dd17b83')
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");
    string body = MW_API_Client.getRequest("/campaign_b/list_tasks/e7162dd17b83");
    Console.WriteLine (body);
  }
}

Examples:

https://api.microworkers.com/campaign_b/list_tasks/e7162dd17b83

{
  "status": "SUCCESS",
  "campaign_id": "e7162dd17b83",
  "tasks": [
  [
    "6767649",
    "NOK"
  ],
  [
    "6767624",
    "NOTRATED"
  ]
]}

https://api.microworkers.com/campaign_b/list_tasks/abbb2dd17b83

{
  "status": "ERROR",
  "campaign_id": "abbb2dd17b83",
  "error": "NO SUCH CAMPAIGN"
}