API Documentation

MakeSomeTime uses a REST API to allow you to interact with the system when developing external applications.

API Authentication

MakeSomeTime authentication is performed via HTTP (only “Basic” is supported), and you’ll need to transmit your username and password along with your request.

URL Structure

API requests are made by using a certain URL structure. Generally the structure is as follows:

http://makesometime.com/api/ {function} / {parameter pairs} / {format}
  • {function} is the type of request you are making (see the sidebar for possible options).
  • {parameter pairs} are used when making GET requests and you need to pass in data (e.g. http://makesometine.com/api/task/id/4 would get the task with an ID of 4).
  • {format} is used to specify the format of the response (e.g. http://makesometine.com/api/tasks/format/json would return the response in JSON format). Supported formats include xml, json, php, html and serialize (serialized PHP).

GET Example

In this example we demonstrate how to use PHP and cURL to GET information from MakeSomeTime:

$username = 'myemail';
$password = 'mypassword';
 
$ch = curl_init('http://makesometime.com/api/tasks');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($ch, CURLOPT_USERPWD, $username.':'.$password);
$response = curl_exec($ch);
curl_close($ch);
 
echo $response;

The PHP variable $response now holds the returned information. All successful requests will return HTTP response codes in the 200 range while failed requests will return codes in the 400 range.

POST Example

In this example we demonstrate how to use PHP and cURL to POST information to MakeSomeTime:

$username = 'myemail';
$password = 'mypassword';
 
$ch = curl_init('http://makesometime.com/api/create_task');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($ch, CURLOPT_USERPWD, $username.':'.$password);
curl_setopt($ch, CURLOPT_POSTFIELDS, array(
    'name' => 'New Task',
    'project_id' => 1
));
$response = curl_exec($ch);
curl_close($ch);