Schedules


Create Schedule

This API endpoint is used to create a new schedule. The type paramater should be set as one of the following: 'One_Time', 'Ever_X_Minutes', 'Daily', 'Recurring_Weekly', 'Recurring_Monthly'. Depending on the paramater selected you will supply either Data_1 and Data_2 or just Data_1. One_Time: Data_1 is the date in mm/dd/yyyy format. Data_2 is the time in hh:mm AM/PM format. Ever_X_Minutes: Data_1 is the number of minutes between each iteration. If Data_1 were set to '15', the schedule would launch a browser/script every 15 minutes. Daily: Data_1 is the time in hh:mm AM/PM format. Recurring_Weekly: Data_1 is the day of the week ('Monday', 'Tuesday', etc). Data_2 is the time in hh:mm AM/PM format. Recurring_Monthly: Data_1 is the day of the month to execute the script. For instance, if Data_1 were set to '23', the schedule would launch a browser/script on the 23rd day of every month. Data_2 is the time of day in hh:mm AM/PM format. URL_Type should be set to either 'local' or 'remote.' Local scripts are hosted on BrowserBucket.com, whereas remote scripts are hosted on an external server of your choosing. If you're using a local script URL_Data should be set to the desired script ID. If you're using a remote script URL_Data should be set to the URL Address of the remote script. If Persists is set to true, the script will be reattached everytime the browser reloads, such as when it navigates to a new webpage.

<?php


print_r(sendRequest("GET", "CreateSchedule", "&Type=One_Time&Data_1=09/26/2018&Data_2=".urlencode("2:00 PM")."&URL_Type=remote&CloseAfter=15&Description=&URL_Data=" . urlencode("http://www.browserbucket.com/remote.php")));


function sendRequest($method_is, $urlvar1, $urlvar2)
{
	
$curl = curl_init();

print "https://api.browserbucket.com/" . $urlvar1 . "/?Token=go7Y5ynGOtCgOkmeBZnxg04ShjMHLLW1&UserID=cbb28f187319784cd6be2aa53b053155" . $urlvar2;

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.browserbucket.com/" . $urlvar1 . "/?Token=go7Y5ynGOtCgOkmeBZnxg04ShjMHLLW1&UserID=cbb28f187319784cd6be2aa53b053155" . $urlvar2,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => $method_is,
  CURLOPT_POSTFIELDS => "{}",
));

$response = curl_exec($curl); 
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  print "Curl Error.";
  exit;
} else {
  return json_decode($response, true);
}

}


var authdata = "?token={token}&userid={userid}";
var ajaxdata = authdata + "&type={type}&data_1={data_1}&data_2={data_2}&scriptType={scriptType}&scriptUrl={scriptUrl}&closeIn={closeIn}&description={description}";

var url = 'https://api.browserbucket.com/CreateSchedule/'+ ajaxdata;
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {

console.log('Server Data: ' + this.responseText);
var obj = JSON.parse(this.responseText);

}
};
xmlhttp.open('GET', url);
xmlhttp.send();

Get Schedules

This API endpoint returns a list of schedules associated with your account.

<?php

print_r(sendRequest("GET", "GetSchedules", ""));

function sendRequest($method_is, $urlvar1, $urlvar2)
{
	
$curl = curl_init();

print "https://api.browserbucket.com/" . $urlvar1 . "/?Token=go7Y5ynGOtCgOkmeBZnxg04ShjMHLLW1&UserID=cbb28f187319784cd6be2aa53b053155" . $urlvar2;

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.browserbucket.com/" . $urlvar1 . "/?Token=go7Y5ynGOtCgOkmeBZnxg04ShjMHLLW1&UserID=cbb28f187319784cd6be2aa53b053155" . $urlvar2,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => $method_is,
  CURLOPT_POSTFIELDS => "{}",
));

$response = curl_exec($curl); 
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  print "Curl Error.";
  exit;
} else {
  return json_decode($response, true);
}

}


var authdata = "?token={token}&userid={userid}";

var url = 'https://api.browserbucket.com/GetSchedules/'+ authdata;
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {

console.log('Server Data: ' + this.responseText);
var obj = JSON.parse(this.responseText);

}
};
xmlhttp.open('GET', url);
xmlhttp.send();

Delete Schedule

This API endpoint is used to delete a schedule associated with your account.

<?php

print_r(sendRequest("GET", "DeleteSchedule", "&ScheduleID=05b47edb40c529"));

function sendRequest($method_is, $urlvar1, $urlvar2)
{
	
$curl = curl_init();

print "https://api.browserbucket.com/" . $urlvar1 . "/?Token=go7Y5ynGOtCgOkmeBZnxg04ShjMHLLW1&UserID=cbb28f187319784cd6be2aa53b053155" . $urlvar2;

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.browserbucket.com/" . $urlvar1 . "/?Token=go7Y5ynGOtCgOkmeBZnxg04ShjMHLLW1&UserID=cbb28f187319784cd6be2aa53b053155" . $urlvar2,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => $method_is,
  CURLOPT_POSTFIELDS => "{}",
));

$response = curl_exec($curl); 
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  print "Curl Error.";
  exit;
} else {
  return json_decode($response, true);
}

}
var authdata = "?token={token}&userid={userid}";
var ajaxdata = authdata + "&scheduleID={scheduleID}";

var url = 'https://api.browserbucket.com/DeleteSchedule/'+ ajaxdata;
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {

console.log('Server Data: ' + this.responseText);
var obj = JSON.parse(this.responseText);

}
};
xmlhttp.open('GET', url);
xmlhttp.send();