data
:
required |
Text
JSON form input data. |
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);
}
}
{ "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" }