My account : API documentation

API documentation

Account

/worker/hg_tasks GET

Returns submitted tasks list.

Parameters:

GET data

 

 

rating

(Optional) Task Rating

Example values: [OK|NOK|NOTRATED|NOTREVIEWED|REVISE]

finished_from

(Optional) Finished from datetime

Example value: 2014-12-02 00:00:00

finished_to

(Optional) Finished to datetime

Example value: 2014-12-31 23:59:59

page

(Optional) Page #

Example value: 2. Default: 1

entries_per_page

(Optional) Entries per page #

Example value: 100. Default/Max: 200

Return values:

SUCCESS

status=SUCCESS, tasks=[array of array], pager=[pagination]

ERROR

status=ERROR, error=[error message*], errors_list=[errors list]

*[INPUT_DATA]

**[Rating has invalid value|Finished From is invalid datetime|Finished To is invalid datetime|Page is invalid|Entries Per Page is invalid|Page must be bigger than zero|Entries Per Page must be bigger than zero|Entries Per Page must be less or equal to 200]

Code:

cURL:

curl -H "MicroworkersApiKey:YOUR_API_KEY" -X GET "https://api.microworkers.com/worker/hg_tasks?entries_per_page=2"

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/hg_tasks");
$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', '/worker/hg_tasks');
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', '/worker/hg_tasks')
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("/worker/hg_tasks");
    Console.WriteLine (body);
  }
}

Examples:

https://api.microworkers.com/worker/hg_tasks?entries_per_page=2

{
  "status": "SUCCESS",
  "pager": {
    "current_page": 1,
    "entries_on_this_page": 2,
    "entries_per_page": 2,
    "first": 1,
    "first_page": 1,
    "last": 2,
    "last_page": 76,
    "next_page": 2,
    "previous_page": null,
    "total_entries": 151
  },
  "tasks": [
    {
      "bonus_worker_earned": "0.00000",
      "campaign_id": "564444828eec",
      "campaign_title": "Facebook like",
      "csv_record_nr": "0",
      "employer_comment": "test",
      "finished_datetime": "2015-02-20 11:04:14",
      "has_file": "0",
      "id": "2207859",
      "ip": "182.27.13.82",
      "proof_1": "1",
      "proof_2": "2",
      "proof_3": "3",
      "task_rating": "OK",
      "worker_earned": "0.06000",
      "worker_id": "1354174c"
    },
    {
      "bonus_worker_earned": "0.00000",
      "campaign_id": "ebed73fbb8cc",
      "campaign_title": "Blog moderation",
      "csv_record_nr": "0",
      "employer_comment": "",
      "finished_datetime": "2015-02-20 11:04:27",
      "has_file": "0",
      "id": "2207860",
      "ip": "182.27.13.82",
      "proof_1": "page #12",
      "proof_2": "",
      "proof_3": "",
      "task_rating": "OK",
      "worker_earned": "0.06000",
      "worker_id": "1354174c"
    }
  ]
}

https://api.microworkers.com/worker/hg_tasks?finished_from=123

{
  "status": "ERROR",
  "errors_list": ["Finished From is invalid datetime"],
  "error": "INPUT_DATA"
}