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/stop/<type>/<campaign_id>

Stop created campaign using this API method.
The value of 'type' (Campaign type) can be 'B' or 'HG'.

This API method is use for stop campaign.
  1. curl -H "MicroworkersApiKey:YOUR_API_KEY" -X PUT "https://ttv.microworkers.com/api/campaign/stop/B/2168e3b09815/format/json"
  1. from pprint import pprint
  2. from MW_API import MW_API
  3. mw_api = MW_API('YOUR_API_KEY')
  4. res = mw_api.do_request('PUT','/campaign/stop/B/2168e3b09815/format/json', {}, {})
  5. pprint(res)
  1. use MW_API;
  2. use Data::Dumper qw(Dumper);
  3. my $mw_api = MW_API->new('api_key' => 'YOUR_API_KEY');
  4. my $res = $mw_api->do_request('PUT', '/campaign/stop/B/2168e3b09815/format/json');
  5. print Dumper($res);
  1. <?php
  2. include "includes/RESTClient.php";
  3. define("cAPI_KEY", "YOUR_API_KEY");
  4. define("cAPI_URL", "https://ttv.microworkers.com/api");
  5. $client = new RESTClient();
  6. $client->setApiKey(cAPI_KEY);
  7. $client->setUrl(cAPI_URL . "/campaign/stop/B/2168e3b09815/format/json");
  8. $client->setMethod("PUT");
  9. $client->execute();
  10. $response = $client->getLastResponse();
  11. $client->resetClient();
  12. echo $response;
  13. ?>
  1. using System;
  2. using MWAPI;
  3. using System.Collections.Specialized;
  4. public class Test{
  5. public static void Main (string[] args){
  6. MW_API MW_API_Client = new MW_API ("YOUR_API_KEY");
  7. NameValueCollection postData = new NameValueCollection();
  8. string body = MW_API_Client.putRequest("/campaign/stop/B/2168e3b09815/format/json", postData);
  9. Console.WriteLine (body);
  10. }
  11. }

Definition


Result Format

{
  • "status": "SUCCESS",
  • "response": "Campaign successfully stopped"
}
{
  • "status": "ERROR",
  • "message": "This campaign is not RUNNING or PENDING_REVIEW now. So you can't stop it."
}