About BudURL

Who we are

BudURL.com API

Currently the BudURL.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!

API Primary Base URL

http://budurl.com/api/v1/budurls

Request Variables in GET call

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://budurl.com/api/v1/budurls/shrink?api_key=abc&long_url=http%3A%2F%2Fwww.liveoak360.com&notes=some%20long%20notes

Responses in JSON format

Examples

{success: 1, budurl: http://budurl.com/e92j, hash: e92j}

Authentication

Must supply API Key in GET call

Parameters

  • api_key As assigned in BudURL.com registered account

Examples

http://budurl.com/api/v1/budurls/shrink?api_key=abc&long_url=http://liveoak360.com

Shrink with /shrink

Parameters

  • long_url A long URL you wish to shrink
  • notes The notes to attach to the newly created BudURL. Note: can be changed later.
  • redirect_type Type of Redirect: 301 or 307. Note: 307 is default
  • alias Custom alias you wish to assign to short link. (optional)

Examples

http://budurl.com/api/v1/budurls/shrink?api_key=abc&long_url=http://liveoak360.com&notes=abc&redirect_type=307&alias=abcd

Response Values

  • budurl Full URL of BudURL
  • hash Hash value of BudURL
  • budurl_preview Full URL of BudURL preview lin

Examples

{success: 1, budurl: http://budurl.com/e92j, hash: e92j, budurl_preview: http://budurl.com/e92j?}
{"success":0,"error_code":400,"error_message":"BudURL Alias is not available! Try another."}
{success: 0, error_code: 100, error_message: "Invalid API key."}

Expand with /expand

Parameters

  • budurl BudURL you wish to expand. Note: will accept full URL of BudURL or just hash

Examples

http://budurl.com/api/v1/budurls/expand?budurl=http://budurl.com/eji9 http://budurl.com/api/v1/budurls/expand?budurl=a29e

Response Values

  • long_url Full URL of expanded BudURL

Notes

API Key not required

Examples

{success: 1, long_url: http://liveoak360.com}
{success: 0, error_code: 100, error_message: "Invalid API key."}

Sample PHP code using curl to shrink a URL

<?

$request =  'http://budurl.com/api/v1/budurls/shrink?api_key='
         . rawurlencode('abc-key') . '&long_url='
         . rawurlencode('http://liveoak360.com') . '&notes='
         . 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);

?>



Sample PHP code using curl to expand a BudURL


<?

$request =  'http://budurl.com/api/v1/budurls/expand?budurl='
         . rawurlencode('http://budurl.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);

?>