Summary
User Api Key
Get projects list
Get project
Get tickets list
Get ticket
Update ticket
Create new ticket
Create new release
Get a release note
User Api Key
To communicate with uBugtrack API you need an API key. This Key is unique for your account.

You must be logged in to get or create a key

Get projects list
Get projects list.

Url


Result
{
	"success":true | false,
	"message":"Success",
	"projects":
	[
		{
			"id":"Long",
			"name":"String",
			"user_owner_id":"Long"
		}
		,
		...
	]
}

Php sample code
<?php
	$url = 'https://ubugtrack.com/api/{User_Api_Key}/projects/';
		
	$ch = curl_init(); 
	curl_setopt($ch, CURLOPT_URL, $url); 
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
	$response = curl_exec($ch);
	$result = json_decode($response);
	
	if ($result->success)
	{
		foreach ($result->projects as $project)
			echo $project->id.' - '.$project->name;
	}
?>
Get project
Get project info.

Url


Result
{
	"success":true | false,
	"message":"Success",
	"project":
		{
			"id":"Long",
			"name":"String",
			"user_owner_id":"Long"
		}
}

Php sample code
<?php
	$url = 'https://ubugtrack.com/api/{User_Api_Key}/project/{Project_Id}';
		
	$ch = curl_init(); 
	curl_setopt($ch, CURLOPT_URL, $url); 
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
	$response = curl_exec($ch);
	$result = json_decode($response);
	
	if ($result->success)
	{
		echo $result->project->id.' - '.$result->project->name;
	}
?>
Get tickets list
Get project tickets list.

Url


Parameter in url
filter_status = (Optional) empty : all
0: waiting
1: open
2: in_progress
3: Fixed/Done
4: Ready for Testing
5: Closed
6: won't do
filter_release = (Optional) Get all tickets for with a specific release version name
result_start = (Optional) Number indicates which item should be used as the first item in the page of results.
result_limit = (Optional) Number indicates how many results to return per page.

Result
{
	"success":true | false,
	"message":"Success",
	"tickets":
	[
		{
			"id":"Long",
			"date_created":"YYYMMDD",
			"time_updated":"Unix Time",
			"title":"String",
			"description":"String",
			"markdown":true | false,
			"labels": [String...],
			"status":"0|1|2|3|4|5",
			"priority":"0|1|2|3|4",
			"external_id":"String",
			"assigned_displayname":"String"
		}
		,
		...
	]
}

Php sample code
<?php
	$url = 'https://ubugtrack.com/api/{User_Api_Key}/project/{Project_Id}/tickets/';
	$url .= '?filter_status=1';
	$url .= '&result_start=0';
	$url .= '&result_limit=10';	
	$ch = curl_init(); 
	curl_setopt($ch, CURLOPT_URL, $url); 
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
	$response = curl_exec($ch);
	$result = json_decode($response);
	
	if ($result->success)
	{
		foreach ($result->tickets as $ticket)
			echo $ticket->id.' - '.$ticket->title;
	}
?>
Get ticket
Get ticket info.

Url


Result
{
	"success":true | false,
	"message":"Success",
	"ticket":
		{
			"id":"Long",
			"date_created":"YYYMMDD",
			"time_updated":"Unix Time",
			"title":"String",
			"description":"String",
			"markdown":true | false,
			"labels": [String...],
			"status":"0|1|2|3|4|5",
			"priority":"0|1|2|3|4",
			"external_id":"String",
			"assigned_displayname":"String"
		}
}

Php sample code
<?php
	$url = 'https://ubugtrack.com/api/{User_Api_Key}/project/{Project_Id}/ticket/{Ticket_Id}';
		
	$ch = curl_init(); 
	curl_setopt($ch, CURLOPT_URL, $url); 
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
	$response = curl_exec($ch);
	$result = json_decode($response);
	
	if ($result->success)
	{
		echo $result->ticket->id.' - '.$result->ticket->title;
	}
?>
Update ticket
Update ticket info.

Url


Post data
{
	"title":"String",
	"description":"String",
	"markdown": true | false,
	"status":"0|1|2|3|4|5",
	"priority":"0|1|2|3|4",
	"external_id":"String"
}

Result
{
	"success": true | false,
	"message":"Success"
}

Php sample code
<?php
	$url = 'https://ubugtrack.com/api/{User_Api_Key}/project/{Project_Id}/ticket/{Ticket_Id}/update/';
		
	$ticket = new stdClass();
	$ticket->title = "New Title";
	$ticket->description = "New Description";
	$ticket->markdown = false;
	$ticket->status = 1;
	$ticket->priority = 1;
	$ticket->external_id = "";
	$postData = json_encode($ticket);
	
	$ch = curl_init(); 
	curl_setopt($ch, CURLOPT_URL, $url); 
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
	curl_setopt($ch, CURLOPT_POSTFIELDS, $postData);
	curl_setopt($ch, CURLOPT_HTTPHEADER, array(                                                                          
		'Content-Type: application/json',                                                                                
		'Content-Length: ' . strlen($postData))                                                                       
	);      
	$response = curl_exec($ch);
?>
Create new ticket
Create a new ticket.

Url


Post data
{
	"title":"String",
	"description":"String",
	"markdown": true | false,
	"status":"0|1|2|3|4|5",
	"priority":"0|1|2|3|4",
	"external_id":"String"
}

Result
{
	"success": true | false,
	"message":"Success"
}

Php sample code
<?php
	$url = 'https://ubugtrack.com/api/{User_Api_Key}/project/{Project_Id}/newticket/';
		
	$ticket = new stdClass();
	$ticket->title = "New Title";
	$ticket->description = "New Description";
	$ticket->markdown = false;
	$ticket->status = 0;
	$ticket->priority = 1;
	$ticket->external_id = "";
	$postData = json_encode($ticket);
	
	$ch = curl_init(); 
	curl_setopt($ch, CURLOPT_URL, $url); 
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
	curl_setopt($ch, CURLOPT_POSTFIELDS, $postData);
	curl_setopt($ch, CURLOPT_HTTPHEADER, array(                                                                          
		'Content-Type: application/json',                                                                                
		'Content-Length: ' . strlen($postData))                                                                       
	);      
	$response = curl_exec($ch);
?>
Create new release
Create new release.

Url


Post data
{
	"version":"String",
	"include_mode": 0 | 1 | 2    // 0:include none  1:include closed ticket  2:include to be tested and closed ticket
}

Result
{
	"success": true | false,
	"message":"Success"
}

Php sample code
<?php
	$url = 'https://ubugtrack.com/api/{User_Api_Key}/project/{Project_Id}/newrelease/';
		
	$release = new stdClass();
	$release->version = "1.2.4";
	$release->include_mode = 2;
	$postData = json_encode($release);
	
	$ch = curl_init(); 
	curl_setopt($ch, CURLOPT_URL, $url); 
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
	curl_setopt($ch, CURLOPT_POSTFIELDS, $postData);
	curl_setopt($ch, CURLOPT_HTTPHEADER, array(                                                                          
		'Content-Type: application/json',                                                                                
		'Content-Length: ' . strlen($postData))                                                                       
	);      
	$response = curl_exec($ch);
?>
Get release note
Get a release note.

Url


If you want a release note in text format than json format you can replace in url releasenote by releasenotetext

Result
{
	"success": true | false,
	"message":"Success",
	"releasenote":"Release note text content with all tasks"
}

Php sample code
<?php
	$url = 'https://ubugtrack.com/api/{User_Api_Key}/project/{Project_Id}/releasenote/{Version_or_ReleaseID}';
		
	$ch = curl_init(); 
	curl_setopt($ch, CURLOPT_URL, $url); 
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
	curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json');      
	$response = curl_exec($ch);
?>
uBugtrack - Built with ♥ by a passionate small team located in Nice, France.
Plans & pricing - News & Changelog - uBugtrack API - Simple Agile Methodology - Privacy - Status
Follow on twitter