Blog - API

API documentation

API documentation

Account

/campaign_b/categories_list GET

Categories list.

Parameters:

none

 

 

Return values:

SUCCESS

status=SUCCESS, count=[nr of parent categories], parent_categories=[array of fields]

ERROR

status=ERROR, error=[error message*]

*[NO CATEGORIES]

Code:

cURL:

curl -H "MicroworkersApiKey:YOUR_API_KEY" -X GET https://api.microworkers.com/campaign_b/categories_list

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

Examples:

Output (Success):

https://api.microworkers.com/campaign_b/categories_list

{
  "status": "SUCCESS",
  "count": 2,
  "parent_categories": [
    {
      "categories": [
        {
          "id": "7500",
          "min_payment_per_task": [
            {
              "payment_per_task": "0.32000",
              "zone": "caribbean1"
            },
            {
              "payment_per_task": "0.40000",
              "zone": "int"
            },
            {
              "payment_per_task": "0.75000",
              "zone": "west1"
            },
            {
              "payment_per_task": "0.50000",
              "zone": "europe1"
            },
            {
              "payment_per_task": "0.45000",
              "zone": "europe2"
            },
            {
              "payment_per_task": "0.32000",
              "zone": "asia1"
            }
          ],
          "title": "PR0 50 words Review/Post + Link"
        },
        {
          "id": "7501",
          "min_payment_per_task": [
            {
              "payment_per_task": "0.48000",
              "zone": "caribbean1"
            },
            {
              "payment_per_task": "0.60000",
              "zone": "int"
            },
            {
              "payment_per_task": "1.20000",
              "zone": "west1"
            },
            {
              "payment_per_task": "0.80000",
              "zone": "europe1"
            },
            {
              "payment_per_task": "0.70000",
              "zone": "europe2"
            },
            {
              "payment_per_task": "0.48000",
              "zone": "asia1"
            }
          ],
          "title": "PR0 100 words Review/Post + Link"
        }
      ],
      "title": "Blog/Website Owners"
    },
    {
      "categories": [
        {
          "id": "2000",
          "min_payment_per_task": [
            {
              "payment_per_task": "0.08000",
              "zone": "caribbean1"
            },
            {
              "payment_per_task": "0.10000",
              "zone": "int"
            },
            {
              "payment_per_task": "0.30000",
              "zone": "west1"
            },
            {
              "payment_per_task": "0.20000",
              "zone": "europe1"
            },
            {
              "payment_per_task": "0.15000",
              "zone": "europe2"
            },
            {
              "payment_per_task": "0.08000",
              "zone": "asia1"
            }
          ],
          "title": "Add to Favorites"
        }
      ],
      "title": "Youtube"
    }
  ]
}

Output (Error):

https://api.microworkers.com/campaign_b/categories_list

{
  "status": "ERROR",
  "error": "NO CATEGORIES"
}