task_id
:
required |
Text
Task id of the Campaign. |
rating
:
required |
Text
Possible value for rating field is OK or NOK. |
comment
:
optional |
Text
Comment field is mendatory when rating is NOK. |
bonus
:
optional |
Integer
Bonus field is applicable only when Rating is OK. |
favorite
:
optional |
Text
Favorite field is applicable only when Rating is OK. Allowed values are [add|remove]. |
curl -H "MicroworkersApiKey:YOUR_API_KEY" -X PUT "https://ttv.microworkers.com/api/campaign/rate_task/B/2168e3b09815/format/json" -d "task_id=1111&rating=OK&comment=comment&bonus=2.4&favorite=add"
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_task/B/2168e3b09815/format/json', {"task_id" : "1111", "rating" : "OK", "comment" : "comment", "bonus" : 2.4, "favorite" : "add"}, {})
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_task/B/2168e3b09815/format/json', {
"task_id" => "1111", "rating" => "OK", "comment" => "comment", "bonus" => 2.4, "favorite" => "add"
});
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_task/B/2168e3b09815/format/json");
$client->setMethod("PUT");
$client->setData(array("task_id" => "1111", "rating" => "OK", "comment" => "comment", "bonus" => 2.4, "favorite" => "add"));
$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("task_id", "1111");
postData.Add("rating", "OK");
postData.Add("comment", "comment");
postData.Add("bonus", 2.4);
postData.Add("favorite", "add");
string body = MW_API_Client.putRequest("/campaign/rate_task/B/2168e3b09815/format/json", postData);
Console.WriteLine (body);
}
}
{ "status": "SUCCESS", "response": "Task Successfully rated." }
{ "status": "ERROR", "message": "You don't have permission to access this page. Please check given parameters or contact Administrator for more details." }