campaign_type
:
required |
Text
Possible value for campaign type is HG or B. |
title
:
required |
Text
Title of campaign |
qt_required
:
optional |
Boolean
Required Qualification Test. Values: true(Default)/false |
category_id
:
required |
Text
Category ID |
minutes_to_finish
:
required |
Text
How many minutes will this job take |
available_positions
:
required |
Integer
Available Position must be a positive integer. Minimum positions under Basic type campaign is 30. |
number_of_subtasks
:
required |
Text
Each position can have more then one subtasks. You need to specify total Number of Subtasks which Must be greater than 0 and multiple of available_positions. For example, 30 available positions and each position 3 subtask then number_of_subtasks = 90. |
paymentPerTask
:
required |
Text
Cost per task (example: 0.10, 0.13, 0.56,...) |
job_instructions
:
required |
Text
Instructions on Job URL Page |
admin_instructions
:
required |
Text
Instructions for Admin to review tasks. |
ttr
:
required |
Text
Time to rate in days (1-30) |
rating_method
:
required |
Integer
Possible value for rating method is 1 or 2 or 3. |
template_id
:
required |
Text
Template Id must be starts with "T". |
zone
:
required |
Text
Zone you want to target [asia1|caribbean1|europe1|europe2|int|west1] |
selected_country
:
required |
Text
String of countries targetted (IN CN US...) |
speed
:
required |
Integer
Speed of campaign (1-1000) where 1000 is fastest |
group_id
:
required |
Text
Group ID |
number_of_worker_on_same_position
:
optional |
Integer
To allow multiple worker work on same csv task. This field is only for HG type campaign. |
maxPositionsPerWorker
:
required |
Integer
Maximum number of positions (tasks) each worker can participate in |
isMaximumJobLimitEnabled
:
required |
Boolean
Is Maximum Job Limit Enabled. By default value is false. |
maximumJobFinishPerDay
:
optional |
Integer
Maximum Job Finish Per Day. This field is required if Maximum Job Limit Enabled. |
csv_file
:
optional |
File
File type must be *.csv |
csv_order
:
optional |
Integer
Possible value is 1 or 2. |
curl -H "MicroworkersApiKey:YOUR_API_KEY" -X POST "https://ttv.microworkers.com/api/campaign/create/format/json" -F "campaign_type=B" -F "title=title" -F "qt_required=1" -F "category_id=9900" -F "minutes_to_finish=30" -F "available_positions=30" -F "number_of_subtasks=30" -F "paymentPerTask=0.5" -F "job_instructions=job instructions" -F "admin_instructions=admin instructions" -F "ttr=7" -F "rating_method=1" -F "template_id=T54f9518a418e2" -F "zone=int" -F "selected_country=IN CN" -F "speed=1000" -F "[email protected]" -F "csv_order=1"
from pprint import pprint
from MW_API import MW_API
mw_api = MW_API('YOUR_API_KEY')
res = mw_api.do_request('POST','/campaign/create/format/json', {"campaign_type" : "B", "title" : "title", "qt_required" : , "category_id" : "9900", "minutes_to_finish" : "30", "available_positions" : 30, "number_of_subtasks" : "30", "paymentPerTask" : "0.5", "job_instructions" : "job instructions", "admin_instructions" : "admin instructions", "ttr" : "7", "rating_method" : 1, "template_id" : "T54f9518a418e2", "zone" : "int", "selected_country" : "IN CN", "speed" : 1000, "csv_order" : 1}, {"csv_file" : open("Sample.csv","rb")})
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('POST', '/campaign/create/format/json', {
"campaign_type" => "B", "title" => "title", "qt_required" => , "category_id" => "9900", "minutes_to_finish" => "30", "available_positions" => 30, "number_of_subtasks" => "30", "paymentPerTask" => "0.5", "job_instructions" => "job instructions", "admin_instructions" => "admin instructions", "ttr" => "7", "rating_method" => 1, "template_id" => "T54f9518a418e2", "zone" => "int", "selected_country" => "IN CN", "speed" => 1000, "csv_file" => {"file" =>"Sample.csv", "csv_order" => 1
});
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/create/format/json");
$client->setMethod("POST");
$client->setData(array("campaign_type" => "B", "title" => "title", "qt_required" => , "category_id" => "9900", "minutes_to_finish" => "30", "available_positions" => 30, "number_of_subtasks" => "30", "paymentPerTask" => "0.5", "job_instructions" => "job instructions", "admin_instructions" => "admin instructions", "ttr" => "7", "rating_method" => 1, "template_id" => "T54f9518a418e2", "zone" => "int", "selected_country" => "IN CN", "speed" => 1000, "csv_file" => new CURLFile("Sample.csv"), "csv_order" => 1));
$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("campaign_type", "B");
postData.Add("title", "title");
postData.Add("qt_required", );
postData.Add("category_id", "9900");
postData.Add("minutes_to_finish", "30");
postData.Add("available_positions", 30);
postData.Add("number_of_subtasks", "30");
postData.Add("paymentPerTask", "0.5");
postData.Add("job_instructions", "job instructions");
postData.Add("admin_instructions", "admin instructions");
postData.Add("ttr", "7");
postData.Add("rating_method", 1);
postData.Add("template_id", "T54f9518a418e2");
postData.Add("zone", "int");
postData.Add("selected_country", "IN CN");
postData.Add("speed", 1000);
postData.Add("csv_file", "Sample.csv");
postData.Add("csv_order", 1);
string body = MW_API_Client.postRequest("/campaign/create/format/json", postData);
Console.WriteLine (body);
}
}
{ "status": "SUCCESS", "response": { "campaign_id": "94c23ca0bbf4", "campaign_type": "HG", "campaign_cost": 52.30 } }
{ "status": "ERROR", "message": "TTVAPI-E0004:TTVCampaign-E0011:The 'title' field is required." }