ADVERTISEMENTS

EasyUri API

Api Parameters

- link [Required]

- alias [Optional]

Example API Call

http://easyuri.com/api.php?link=cnn.com
Or
http://easyuri.com/api.php?link=cnn.com&alias=cnn

API Return Values
1) Found (If alias is passed and an existing link already took the alias)
2) An EasyUri link (ex: http://easyuri.com/242.htm)

Sample PHP API Call

$link_url="http://www.google.com";
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, "http://easyuri.com/api.php?link=". urlencode($link_url));
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, 10);
$buffer = curl_exec($ch);
if("found" == $buffer){
print "Sorry, Alias already in use";
}else{
print $buffer;
}
curl_close($ch);

Why is Easy URI Better?