Currently the Ez.com API only supports GET calls to all methods. Below is documentation and sample code to use the API. API Keys are available only for registered accounts so Sign Up if you need one. You can obtain your API Key by going to your Profile page. Please report issues or ask questions by visiting our Support site. Thanks for giving the API a try!
http://ez.com/api/v1
It is always best to url encode all your variables especially the long url and notes. See sample code below on how do do this in PHP.
Examples
http://ez.com/api/v1/ezlinks/shrink?api_key=abc&Examples
{success: 1, ezlink: http://ez.com/e92j, hash: e92j}Must supply API Key in GET call
Parameters
Examples
http://ez.com/api/v1/ezlinks/shrink?api_key=abc&long_url=http://liveoak360.comParameters
Examples
http://ez.com/api/v1/ezlinks/shrink?api_key=abc&long_url=http://liveoak360.com¬es=abc&redirect_type=307&alias=abcdJSON Response Values
Examples
{success: 1, ezlink: http://ez.com/e92j, hash: e92j, ezlink_preview: http://ez.com/e92j?}Parameters
Examples
http://ez.com/api/v1/ezlinks/expand?ezlink=http://ez.com/eji9Response Values
Notes
API Key not required
Examples
{success: 1, long_url: http://liveoak360.com}Parameters
Examples (Note: first example will provide total click count for entire history)
http://ez.com/api/v1/clicks/count?api_key=abc&ezlink=http://ez.com/eji9Response Values
Examples
{success: 1, ezlink: http://ez.com/e92j, hash: e92j, count: 1390}
$request = 'http://ez.com/api/v1/ezlinks/shrink?api_key='
. rawurlencode('abc-key') . '&long_url='
. rawurlencode('http://liveoak360.com') . '¬es='
. rawurlencode('abc-notes');
$session = curl_init($request);
curl_setopt($session, CURLOPT_HEADER, false);
curl_setopt($session, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($session);
curl_close($session);
$decode = json_decode($response, true);
//to see array
var_dump($decode);
$request = 'http://ez.com/api/v1/ezlinks/expand?ezlink='
. rawurlencode('http://ez.com/e3ja');
$session = curl_init($request);
curl_setopt($session, CURLOPT_HEADER, false);
curl_setopt($session, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($session);
curl_close($session);
$decode = json_decode($response, true);
//to see array
var_dump($decode);