My account : API documentation

API documentation

Account

/campaign_hg/download_file_proof/<task_id>_<index> GET

Download proof file.

Parameters:

<task_id>

Task ID

Example values: 6767648

<index>

Index # of proof file

Example values: 1

Return values:

SUCCESS

Proof file

ERROR

status=ERROR, task_id=[task_id], index=[index], error=[error message*]

*[NO SUCH TASK|NOT A CAMPAIGN OWNER|DOWNLOAD ERROR|NO FILE PROOF]

Code:

cURL:

curl -J -O -H "MicroworkersApiKey:YOUR_API_KEY" -X GET https://api.microworkers.com/campaign_hg/download_file_proof/<task_id>_<index>

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/download_file_proof/123_1");
$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/download_file_proof/123_1');
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/download_file_proof/123_1')
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/download_file_proof/123_1");
    Console.WriteLine (body);
  }
}

Examples:

Output (Success):

curl: Saved to filename 'letterlegal5.doc'

Output (Error):

{
  "status": "ERROR",
  "task_id": "123456",
  "index": "1",
  "error": "NO FILE PROOF"
}