API documentation

API documentation

Account

/worker/include_list POST

Add employers to include list.

Parameters:

POST data
employer[]

Employer's User ID

Return values:

SUCCESS

status=SUCCESS, message=NN employers have been added

ERROR

status=ERROR, error=[error message*]

*[No employers were added to include list]

Code:

cURL:

curl -H "MicroworkersApiKey:YOUR_API_KEY" -X POST https://api.microworkers.com/worker/include_list -F "employer[]=<employer_id>" -F "employer[]=<employer_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 . "/worker/include_list");
$client->setMethod("POST");
$client->setData(
  array(
    'employer'=>["1234567","2345679"]
  )
);
$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('POST', '/worker/include_list', {
  'employer[]' => ["1234567", "2345678"]
});
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('POST', '/worker/include_list', {
  'employer[]': ["1234567", "2345678"]
})
pprint(res)

C#:

using System;
using MWAPI;
using System.Collections.Specialized;

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

Examples:

Output (Success):

{
  "status": "SUCCESS",
  "message": "2 employers have been added"
}

Output (Error):

{
  "status": "ERROR",
  "error": "No employers were added to include list"
}