Blog - API

API documentation

API documentation

Account

/account/get_info GET

Returns detailed info for your account (API user).

Parameters:

none

 

 

Return values:

SUCCESS

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

ERROR

status=ERROR, error=[error message*]

*[UNKNOWN ERROR]

Code:

cURL:

curl -H "MicroworkersApiKey:YOUR_API_KEY" -X GET https://api.microworkers.com/account/get_info

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

Examples:

Output (Success):

{
  "status": "SUCCESS",
  "id": "18f4174c",
  "email": "[email protected]",
  "signup_ip": "82.102.28.66",
  "signup_datetime9": "2013-05-09 17:40:23",
  "fullname": "Josh Worker",
  "blocked_datetime9": "0000-00-00 00:00:00",
  "money_balance": "473.91500",
  "money_earned": "106.05000",
  "last_ip": "82.102.28.61",
  "last_refresh_datetime9": "2014-04-15 17:39:59",
  "nickname": "JoshHere",
  "lastproof_datetime9": "2014-02-07 20:46:24",
  "phone_number": "+38641002871",
  "phone_number_verified": "0",
  "hg_jobs_available": "10",
  "revise_b": "10",
  "revise_hg": "5",
  "unread_messages": "64"
}

Output (Error):

{
  "status": "ERROR",
  "error": "UNKNOWN ERROR"
}