Tucia API > API Methods


account/balance     GET

Retrieves account balance in credits. ... View Details

URL: https://api.tucia.com/v1/account/balance
Authentication: Required     Response Format: JSON
Example Call (PHP)
<?php

//Set your API keys here:
define('TUCIA_API_KEY','.....');
define('TUCIA_API_SECRECT','.....');

//download from: http://api.tucia.com/src/tucia_api_v1.phpinc 
require "/path/to/tucia_api_v1.php"; 

$api_res = tuciaGET("account/balance"); 

if ($api_res==false) 
{
    echo "Curl ERROR";
}
else 
{
    $api_res=json_decode($api_res,true); //convert JSON response to Array
    
    if(is_array($api_res))
        print_r($api_res); //do something.....
    else
        echo $api_res; //something wrong...
}
?>
Example Response (JSON)
{
	"response":"ok",
	"balance":"17",
	"totalPurchasedCredits":"37",
	"totalUsedCredits":"20"
}

order/submit     POST

Submits new photo(s) for editing. Credits in your account will be deducted accordingly. ... View Details

URL: https://api.tucia.com/v1/order/submit
Authentication: Required     Response Format: JSON
Example Call (PHP)
<?php

//Set your API keys here:
define('TUCIA_API_KEY','.....');
define('TUCIA_API_SECRECT','.....');

//download from: http://api.tucia.com/src/tucia_api_v1.phpinc 
require "/path/to/tucia_api_v1.php"; 

$api_params = array(
    'project_name'=>'my family',
    'instructions'=>"make overall improvement. see each photo for specific instructions",
    'photo_data'=>array(
        array(
            'service'   =>  'basic', //basic service
            'remark'    =>  "slim the girl's waist", // optional
            'url'   =>  "http://your-website.com/girl.nef", 
            ),

        array(
            'service'   =>  'extensive', // extensive service
            'remark'    =>  "put me to a tropical beach", 
            'url'   =>  "http://your-website.com/me.nef",
            ),

        array(
            'service'   =>  'reference', //reference image, no cost
            'remark'    =>  "this is the tropical beach image", 
            'url'   =>  "http://your-website.com/beach.jpg",
            ),
    )
); 

$api_res = tuciaPOST("order/submit", $api_params); 


if ($api_res==false) 
{
    echo "Curl ERROR";
}
else 
{
    $api_res=json_decode($api_res,true); //convert JSON response to Array
    
    if(is_array($api_res))
        print_r($api_res); //do something.....
    else
        echo $api_res; //something wrong...
}
?>
Example Response (JSON)
{
	"response":"ok",
	"order_id":"123456",
	"order_name":"Test Name",
	"credits":"3",
	"status":"editing",
	"time_zone":"UTC",
	"order_time":"2014-10-21 21:14:09",
	"ETA":"2014-10-22 21:14:09", //estimated delivery time

}

order/cancel     POST

Cancel a new project within 10 min of submission (before an editor starts working on it) ... View Details

URL: https://api.tucia.com/v1/order/cancel
Authentication: Required     Response Format: JSON
Example Call (PHP)
<?php

//Set your API keys here:
define('TUCIA_API_KEY','.....');
define('TUCIA_API_SECRECT','.....');

//download from: http://api.tucia.com/src/tucia_api_v1.phpinc 
require "/path/to/tucia_api_v1.php"; 

$api_params = array(
    'order_id'=>'123456',
    'cancel_reason'=>"optional...",
); 

$api_res = tuciaPOST("order/cancel", $api_params); 

if ($api_res==false) 
{
    echo "Curl ERROR";
}
else 
{
    $api_res=json_decode($api_res,true); //convert JSON response to Array
    
    if(is_array($api_res))
        print_r($api_res); //do something.....
    else
        echo $api_res; //something wrong...
}
?>
Example Response (JSON)
{
	"response":"ok",
	"order_id":"123456",
	"status":"canceled",
	"ordered_at":"2015-09-20 19:21:52",
	"canceled_at":"2015-09-20 19:23:52",
}

order/list     GET

Retrieves a list of all projects and their current status under your account ... View Details

URL: https://api.tucia.com/v1/order/list
Authentication: Required     Response Format: JSON
Example Call (PHP)
<?php

//Set your API keys here:
define('TUCIA_API_KEY','.....');
define('TUCIA_API_SECRECT','.....');

//download from: http://api.tucia.com/src/tucia_api_v1.phpinc 
require "/path/to/tucia_api_v1.php"; 

$api_res = tuciaGET("order/list"); 

if ($api_res==false) 
{
    echo "Curl ERROR";
}
else 
{
    $api_res=json_decode($api_res,true); //convert JSON response to Array
    
    if(is_array($api_res))
        print_r($api_res); //do something.....
    else
        echo $api_res; //something wrong...
}
?>
Example Response (JSON)
{
	"response":"ok",
	"time_zone":"UTC",
	"orders":
	[
		{
			"order_id":"123",
			"credits":"1.0",
			"revisions":"1",
			"ordered_at":"2014-10-23 02:22:32",
			"status":"editing",
			"paused":"0",
			"ETA":"2014-10-25 02:22:32",
		}
	]
}

order/list/running     GET

Retrieves a list of all editing/revising projects and their expected delivery time ... View Details

URL: https://api.tucia.com/v1/order/list/running
Authentication: Required     Response Format: JSON
Example Call (PHP)
<?php

//Set your API keys here:
define('TUCIA_API_KEY','.....');
define('TUCIA_API_SECRECT','.....');

//download from: http://api.tucia.com/src/tucia_api_v1.phpinc 
require "/path/to/tucia_api_v1.php"; 

$api_res = tuciaGET("order/list/running"); 

if ($api_res==false) 
{
    echo "Curl ERROR";
}
else 
{
    $api_res=json_decode($api_res,true); //convert JSON response to Array
    
    if(is_array($api_res))
        print_r($api_res); //do something.....
    else
        echo $api_res; //something wrong...
}
?>
Example Response (JSON)
{
	"response":"ok",
	"time_zone":"UTC",
	"orders":
	[
		{
			"order_id":"123",
			"credits":"1.0",
			"revisions":"1",
			"ordered_at":"2014-10-23 02:22:32",
			"paused":"0",
			"ETA":"2014-10-25 02:22:32",
		}
	]
}

order/list/reviewing     GET

Retrieves a list of all projects which are edited and ready for your review ... View Details

URL: https://api.tucia.com/v1/order/list/reviewing
Authentication: Required     Response Format: JSON
Example Call (PHP)
<?php

//Set your API keys here:
define('TUCIA_API_KEY','.....');
define('TUCIA_API_SECRECT','.....');

//download from: http://api.tucia.com/src/tucia_api_v1.phpinc 
require "/path/to/tucia_api_v1.php"; 

$api_res = tuciaGET("order/list/reviewing"); 
 
if ($api_res==false) 
{
    echo "Curl ERROR";
}
else 
{
    $api_res=json_decode($api_res,true); //convert JSON response to Array
    
    if(is_array($api_res))
        print_r($api_res); //do something.....
    else
        echo $api_res; //something wrong...
}
?>
Example Response (JSON)
{
	"response":"ok",
	"time_zone":"UTC",
	"orders":
	[
		{
			"order_id":"123",
			"credits":"1.0",
			"revisions":"1",
			"ordered_at":"2014-10-23 02:22:32",
			"paused":"0",
		}
	]
}

order/list/closed     GET

Retrieves a list of all closed/approved projects ... View Details

URL: https://api.tucia.com/v1/order/list/closed
Authentication: Required     Response Format: JSON
Example Call (PHP)
<?php

//Set your API keys here:
define('TUCIA_API_KEY','.....');
define('TUCIA_API_SECRECT','.....');

//download from: http://api.tucia.com/src/tucia_api_v1.phpinc 
require "/path/to/tucia_api_v1.php"; 

$api_res = tuciaGET("order/list/closed"); 
  
if ($api_res==false) 
{
    echo "Curl ERROR";
}
else 
{
    $api_res=json_decode($api_res,true); //convert JSON response to Array
    
    if(is_array($api_res))
        print_r($api_res); //do something.....
    else
        echo $api_res; //something wrong...
}
?>
Example Response (JSON)
{
	"response":"ok",
	"time_zone":"UTC",
	"orders":
	[
		{
			"order_id":"123",
			"credits":"1.0",
			"revisions":"1",
			"ordered_at":"2014-10-23 02:22:32",
			"edited_at":"2014-10-24 02:22:32",
		}
	]
}

order/search     POST

Search and retrieves a list of projects based on multiple conditions ... View Details

URL: https://api.tucia.com/v1/order/search
Authentication: Required     Response Format: JSON
Example Call (PHP)
<?php

//Set your API keys here:
define('TUCIA_API_KEY','.....');
define('TUCIA_API_SECRECT','.....');

//download from: http://api.tucia.com/src/tucia_api_v1.phpinc 
require "/path/to/tucia_api_v1.php"; 

//at least one of the 4 conditions below must be set:
$api_params=array(
	'order_name_contains'=>'family portraits', //optional
	'instructions_contains'=>'slim my waist', //optional
	'order_time_after'=>'2014-01-08 00:00:00', //optional
	'order_time_before'=>'2014-01-08 23:59:59', //optional
);

$api_res = tuciaPOST("order/search", $api_params); 


if ($api_res==false) 
{
    echo "Curl ERROR";
}
else 
{
    $api_res=json_decode($api_res,true); //convert JSON response to Array
    
    if(is_array($api_res))
        print_r($api_res); //do something.....
    else
        echo $api_res; //something wrong...
}
?>
Example Response (JSON)
{
	"response":"ok",
	"time_zone":"UTC",
	"orders":
	[
		{
			"order_id":"123456",
			"order_name":"jenna's family portraits",
			"credits":"1.0",
			"revisions":"1",
			"ordered_at":"2014-01-08 12:00:00",
			"edited_at":"2014-01-09 02:22:32",
		}
	]
}

order/details/{id}     GET

Retrieves detailed information of a specific project, including original photos, edited photos, order time, ETA time, list of conversations, etc. ... View Details

URL: https://api.tucia.com/v1/order/details/{id}
Authentication: Required     Response Format: JSON
Example Call (PHP)
<?php

//Set your API keys here:
define('TUCIA_API_KEY','.....');
define('TUCIA_API_SECRECT','.....');

//download from: http://api.tucia.com/src/tucia_api_v1.phpinc 
require "/path/to/tucia_api_v1.php"; 

$order_id='123456'; //your project id (order id)

$api_res = tuciaGET("order/details/".$order_id); 
  
if ($api_res==false) 
{
    echo "Curl ERROR";
}
else 
{
    $api_res=json_decode($api_res,true); //convert JSON response to Array
    
    if(is_array($api_res))
        print_r($api_res); //do something.....
    else
        echo $api_res; //something wrong...
}
?>
Example Response (JSON)
{
	"response":"ok",
	"order_id":"123456",
	"order_name":"Test Name",
	"credits":"3",
	"status":"reviewing",
	"time_zone":"UTC",
	"ordered_at":"2014-10-21 21:14:09",
	"original_photos":
		 [
			{
				"id":"7440114",
				"width":"5796",
				"height":"3870",
				"filesize":"1394059",
				"credits":"1.0",
				"thumb_url":"http:\/\/......\/abc.jpg",
				"medium_url":"http:\/\/......\/abc.jpg",
				"origin_url":"http:\/\/......\/abc.jpg"
			}
		],
	"edited_photos":
		[
			{
				"id":"913606",
				"width":"5760",
				"height":"3840",
				"filesize":"13099328",
				"revision":"1",
				"thumb_url":"http:\/\/......\/abc_edited.jpg",
				"medium_url":"http:\/\/......\/abc_edited.jpg",
				"origin_url":"http:\/\/......\/abc_edited.jpg"
			}
		]
}

order/revise/{id}     POST

Submit a new revision request for a specific project, when this project is in "reviewing" status ... View Details

URL: https://api.tucia.com/v1/order/revise/{id}
Authentication: Required     Response Format: JSON
Example Call (PHP)
<?php

//Set your API keys here:
define('TUCIA_API_KEY','.....');
define('TUCIA_API_SECRECT','.....');

//download from: http://api.tucia.com/src/tucia_api_v1.phpinc 
require "/path/to/tucia_api_v1.php"; 

$order_id='123456'; //your project id (order id)

$api_params = array(
	'instructions'  =>  "slim my waist more",  //this is your instructions for revision
); 

$api_res = tuciaPOST("order/revise/".$order_id, $api_params); 


if ($api_res==false) 
{
    echo "Curl ERROR";
}
else 
{
    $api_res=json_decode($api_res,true); //convert JSON response to Array
    
    if(is_array($api_res))
        print_r($api_res); //do something.....
    else
        echo $api_res; //something wrong...
}
?>
Example Response (JSON)
{
	"response":"ok",
	"error_code":"0"
}

order/comment/{id}     POST

Submit a new comment for any project. This comment will apply to the whole project. If the project has multiple photos and you want to add comment for only 1 photo in this project, please use the "order/addnote/{id}" api instead ... View Details

URL: https://api.tucia.com/v1/order/comment/{id}
Authentication: Required     Response Format: JSON
Example Call (PHP)
<?php

//Set your API keys here:
define('TUCIA_API_KEY','.....');
define('TUCIA_API_SECRECT','.....');

//download from: http://api.tucia.com/src/tucia_api_v1.phpinc 
require "/path/to/tucia_api_v1.php"; 

$order_id='123456'; //your project id (order id)

$api_params = array(
	'comment_body'  =>  "btw: remove the paper behind me",  //this is your instructions for revision
); 

$api_res = tuciaPOST("order/comment/".$order_id, $api_params); 


if ($api_res==false) 
{
    echo "Curl ERROR";
}
else 
{
    $api_res=json_decode($api_res,true); //convert JSON response to Array
    
    if(is_array($api_res))
        print_r($api_res); //do something.....
    else
        echo $api_res; //something wrong...
}
?>
Example Response (JSON)
{
	"response":"ok",
	"error_code":"0"
}

order/addnote/{id}     POST

If you have multiple photos in one project, you can use this API to submit a note/comment for only one image, instead of applying to the whole project. You can also add note to any edited photo with an "image_id". ... View Details

URL: https://api.tucia.com/v1/order/addnote/{id}
Authentication: Required     Response Format: JSON
Example Call (PHP)
<?php

//Set your API keys here:
define('TUCIA_API_KEY','.....');
define('TUCIA_API_SECRECT','.....');

//download from: http://api.tucia.com/src/tucia_api_v1.phpinc 
require "/path/to/tucia_api_v1.php"; 

$order_id='123456'; //your project id (order id)

$api_params = array(
	'image_id'=> '789', //this image must be part of order #123456
	'note_body'  =>  "make this photo sepia", 
); 

$api_res = tuciaPOST("order/addnote/".$order_id, $api_params); 


if ($api_res==false) 
{
    echo "Curl ERROR";
}
else 
{
    $api_res=json_decode($api_res,true); //convert JSON response to Array
    
    if(is_array($api_res))
        print_r($api_res); //do something.....
    else
        echo $api_res; //something wrong...
}
?>
Example Response (JSON)
{
	"response":"ok",
	"error_code":"0"
}

order/addref/{id}     POST

If you have need to add reference images (no cost) for current project, you can use this API. ... View Details

URL: https://api.tucia.com/v1/order/addref/{id}
Authentication: Required     Response Format: JSON
Example Call (PHP)
<?php

//Set your API keys here:
define('TUCIA_API_KEY','.....');
define('TUCIA_API_SECRECT','.....');

//download from: http://api.tucia.com/src/tucia_api_v1.phpinc 
require "/path/to/tucia_api_v1.php"; 

$order_id='123456'; //your project id (order id)

$api_params = array(
	'photo_data'=>array(
		array(
			'url'   =>  "http://your-website.com/eyes.jpg", 
			'remark'    =>  "this is the ref image for eyes", // optional
		),
 
		array(
			'url'   =>  "http://your-website.com/lips.jpg", 
			'remark'    =>  "ref pic for lips", // optional
		)
	)
); 

$api_res = tuciaPOST("order/addref/".$order_id, $api_params); 


if ($api_res==false) 
{
    echo "Curl ERROR";
}
else 
{
    $api_res=json_decode($api_res,true); //convert JSON response to Array
    
    if(is_array($api_res))
        print_r($api_res); //do something.....
    else
        echo $api_res; //something wrong...
}
?>
Example Response (JSON)
{
	"response":"ok",
	"error_code":"0"
}

order/approve/{id}     POST

Approve/Close a specific project ... View Details

URL: https://api.tucia.com/v1/order/approve/{id}
Authentication: Required     Response Format: JSON
Example Call (PHP)
<?php

//Set your API keys here:
define('TUCIA_API_KEY','.....');
define('TUCIA_API_SECRECT','.....');

//download from: http://api.tucia.com/src/tucia_api_v1.phpinc 
require "/path/to/tucia_api_v1.php"; 

$order_id='123456'; //your project id (order id)

$api_params = array(
	'feedback'  =>  "look great!",  //this is your instructions for revision
); 

$api_res = tuciaPOST("order/approve/".$order_id, $api_params); 


if ($api_res==false) 
{
    echo "Curl ERROR";
}
else 
{
    $api_res=json_decode($api_res,true); //convert JSON response to Array
    
    if(is_array($api_res))
        print_r($api_res); //do something.....
    else
        echo $api_res; //something wrong...
}
?>
Example Response (JSON)
{
	"response":"ok",
	"error_code":"0"
}