My account : API documentation

API documentation

Account

/worker/include_list DELETE

Remove employers from include list.

Parameters:

DELETE data
employer[]

Employer's User ID or "all" if you want to remove all employers from Include list

 

Return values:

SUCCESS

status=SUCCESS, message=NN employers have been removed

ERROR

status=ERROR, error=[error message*]

*[employers were not found in include list]

Code:

cURL:

curl -H "MicroworkersApiKey:YOUR_API_KEY" -X DELETE https://api.microworkers.com/worker/include_list -d "employer[]=<employer_id>" -d "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("DELETE");
$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('DELETE', '/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('DELETE', '/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.deleteRequest("/worker/include_list", postData);
    Console.WriteLine (body);
  }
}

Examples:

Output (Success):

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

Output (Error):

{
  "status": "ERROR",
  "error": "employers were not found in include list"
}