These are all the 1.0 APIs that have been deprecated since 23-Jan-2019. Please use the latest version of API 2.0.

/campaign/rate_tasks/<type>/<campaign_id>

You can rate multiple tasks with using this api method.
The value of 'type' (Campaign type) can be 'B' or 'HG'.

data :

required

Text

JSON form input data.

For Qualification campaign:
[{"taskId":{task_id},stars:{"{subtaskid}_{questionid}":4,"{subtaskid}_{questionid}":5}}]

For Non-qualification campaign:
[{"taskId":{taskId},"comment":"{comment}","rate":"{rate}","bonus":"{bonus}","favorite":"add"},{"taskId":{taskId},"comment":"{comment}","rate":"{rate}","bonus":"{bonus}","favorite":"remove"}]

Field details:
taskId: Task id field is required.
rate: This field is required. Posible values are OK, NOK, REVISE.
comment: Explanation to Worker why task wasn't accepted.This field is mandatory when rating NOK or REVISE.
bonus: Optional bonus you wish to give to worker.
Bonus amount must be in range ("payment per task" x 0.1 .. "payment per task" x 2).
favorite: Optional field [add|remove]
stars: Rating star field is mandatory for Qualification Campaign. For example: Subtaskid is 12345 and questionId is Q4524f4563d5 then key of stars field will be "12345_Q4524f4563d5"

curl -H "MicroworkersApiKey:YOUR_API_KEY" -X PUT "https://ttv.microworkers.com/api/campaign/rate_tasks/B/2168e3b09815/format/json" -d "data=[{\"taskId\":12345,\"comment\":\"Good Job\",\"rate\":\"OK\",\"bonus\":\"1.01\",\"favorite\":\"add\"},{\"taskId\":12346,\"comment\":\"Wrong Answer\",\"rate\":\"NOK\",\"favorite\":\"remove\"}]"
curl -H "MicroworkersApiKey:YOUR_API_KEY" -X PUT "https://ttv.microworkers.com/api/campaign/rate_tasks/B/2168e3b09815/format/json" -d "data=[{\"taskId\":12345,\"stars\":{\"{subtask1id}_{question1id}\":4,\"{subtask2id}_{question1id}\":5}}]"
from pprint import pprint
from MW_API import MW_API
mw_api = MW_API('YOUR_API_KEY')
res = mw_api.do_request('PUT','/campaign/rate_tasks/B/2168e3b09815/format/json', {"data" : "[{\"taskId\":12345,\"comment\":\"Good Job\",\"rate\":\"OK\",\"bonus\":\"1.01\",\"favorite\":\"add\"},{\"taskId\":12346,\"comment\":\"Wrong Answer\",\"rate\":\"NOK\",\"favorite\":\"remove\"}]"}, {})
pprint(res)
from pprint import pprint
from MW_API import MW_API
mw_api = MW_API('YOUR_API_KEY')
res = mw_api.do_request('PUT','/campaign/rate_tasks/B/2168e3b09815/format/json', {"data" : "[{\"taskId\":12345,\"stars\":{\"{subtask1id}_{question1id}\":4,\"{subtask2id}_{question1id}\":5}}]"}, {})
pprint(res)
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('PUT', '/campaign/rate_tasks/B/2168e3b09815/format/json', {
  "data" => "[{\"taskId\":12345,\"comment\":\"Good Job\",\"rate\":\"OK\",\"bonus\":\"1.01\",\"favorite\":\"add\"},{\"taskId\":12346,\"comment\":\"Wrong Answer\",\"rate\":\"NOK\",\"favorite\":\"remove\"}]"
});
print Dumper($res);
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('PUT', '/campaign/rate_tasks/B/2168e3b09815/format/json', {
  "data" => "[{\"taskId\":12345,\"stars\":{\"{subtask1id}_{question1id}\":4,\"{subtask2id}_{question1id}\":5}}]"
});
print Dumper($res);
<?php

include "includes/RESTClient.php";
define("cAPI_KEY", "YOUR_API_KEY");
define("cAPI_URL", "https://ttv.microworkers.com/api");
$client = new RESTClient();
$client->setApiKey(cAPI_KEY);
$client->setUrl(cAPI_URL . "/campaign/rate_tasks/B/2168e3b09815/format/json");
$client->setMethod("PUT");
$client->setData(array("data" => "[{\"taskId\":12345,\"comment\":\"Good Job\",\"rate\":\"OK\",\"bonus\":\"1.01\",\"favorite\":\"add\"},{\"taskId\":12346,\"comment\":\"Wrong Answer\",\"rate\":\"NOK\",\"favorite\":\"remove\"}]"));
$client->execute();
$response = $client->getLastResponse();
$client->resetClient();
echo $response;
?>
<?php

include "includes/RESTClient.php";
define("cAPI_KEY", "YOUR_API_KEY");
define("cAPI_URL", "https://ttv.microworkers.com/api");
$client = new RESTClient();
$client->setApiKey(cAPI_KEY);
$client->setUrl(cAPI_URL . "/campaign/rate_tasks/B/2168e3b09815/format/json");
$client->setMethod("PUT");
$client->setData(array("data" => "[{\"taskId\":12345,\"stars\":{\"{subtask1id}_{question1id}\":4,\"{subtask2id}_{question1id}\":5}}]"));
$client->execute();
$response = $client->getLastResponse();
$client->resetClient();
echo $response;
?>
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("data", "[{\"taskId\":12345,\"comment\":\"Good Job\",\"rate\":\"OK\",\"bonus\":\"1.01\",\"favorite\":\"add\"},{\"taskId\":12346,\"comment\":\"Wrong Answer\",\"rate\":\"NOK\",\"favorite\":\"remove\"}]");
    
    string body = MW_API_Client.putRequest("/campaign/rate_tasks/B/2168e3b09815/format/json", postData);
    Console.WriteLine (body);
  }
}
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("data", "[{\"taskId\":12345,\"stars\":{\"{subtask1id}_{question1id}\":4,\"{subtask2id}_{question1id}\":5}}]");
    
    string body = MW_API_Client.putRequest("/campaign/rate_tasks/B/2168e3b09815/format/json", postData);
    Console.WriteLine (body);
  }
}

Definition


Result Format

{
  "status": "SUCCESS",
  "response": "Tasks successfully rated."
}
{
  "status": "ERROR",
  "message": "TTVCampaign-E0000:Campaign does not exists with id 'c3829c63330_HG'"
}
{
  "status": "ERROR",
  "message": "1234569:comment IS MANDATORY
1234570:Bonus you entered is outside allowed values
1234568:id_task IS NOT UNIQUE
1234571:Your account balance is too low to add bonus" }
{
  "status": "ERROR",
  "message": "TTVAPI-E0004:Error-E0001:Invalid JSON format given. Please provide valid JSON data"
}