My account : API documentation

API documentation

Account

/campaign_hg/get_info/<campaign_id> GET

Returns data for selected campaign.

Parameters:

<campaign_id>

Campaign ID

Example values: e7162dd17b83

Return values:

SUCCESS

status=SUCCESS,... other campaign data (see example)

ERROR

status=ERROR, error=[error message*]

[NO SUCH CAMPAIGN]

Code:

cURL:

curl -H "MicroworkersApiKey:YOUR_API_KEY" -X GET https://api.microworkers.com/campaign_hg/get_info/<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_hg/get_info/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_hg/get_info/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_hg/get_info/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_hg/get_info/e7162dd17b83");
    Console.WriteLine (body);
  }
}

Examples:

Output (Success):

https://api.microworkers.com/campaign_hg/get_info/137956568899

{
  "status": "SUCCESS",
  "approved_datetime9": "2013-12-15 21:59:02",
  "available_positions": "100",
  "blocked_datetime9": "0000-00-00 00:00:00",
  "blocked_reason": "",
  "campaign_id": "137956568899",
  "campaign_status": "FINISHED",
  "created_datetime9": "2013-12-15 21:57:15",
  "description_type": "SAME",
  "finished_datetime9": "2014-04-09 16:23:18",
  "group_of_workers_id": "18f4c27e5770",
  "group_of_workers_name": "MW: Top Earners",
  "max_pos_per_worker": "1",
  "minutes_to_finish": "3",
  "nr_of_required_proofs": "1",
  "payment_per_task": "0.05000",
  "qt_required": false,
  "required_proof": [
    "1. Your Username",
    "",
    "",
    "",
    ""
  ],
  "required_work": "1. Go to www.mylittlewebsite.com 2. Sign up 3. Confirm account",
  "title": "My Little Website: Sign up"
  "tasks_nok": 0,
  "tasks_not_rated": 0,
  "tasks_not_reviewed": 0,
  "tasks_ok": "100",
  "category_details": {
    "category": "Sign up",
    "id": "05"
  }
}

Output (Error):

https://api.microworkers.com/campaign_hg/get_info/137956568899

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