Short URL API

If you need short URL service integration with your site - this service provides API which works with GET and POST methods.

Simpliest method is GET: all you need is to send query string with URL encoded like

http://newhotlink.comShortURL/Add/?url=http%3A%2F%2Fbrowsei.com%2FPictures%2F%3Fshow%3Dnew

or http://newhotlink.comShortURL/Add/?mode=API&url=http://link-to-short.com/here/

By default you'll have plain text output string/s with shorten URL/s (one URL per string) - something like
3f84cb
short-tag-here

GET variables allowed:
url - URL to short in encoded form (like this: &url=http%3A%2F%2Fbrowsei.com%2FPictures%2F%3Fshow%3Dnew);
output - either 'plain' or 'xml' or 'json' (see output examples below);
go - either "twitter", "facebook" or "display" - redirects user to post forms on Twitter.com or FaceBook.com with new short link filled in forms automatically. If URL posted with "display" it will be displayed immediately in frame or with redirect page. Link example:
http://newhotlink.comShortURL/Add/?mode=API&go=twitter&url=http://link-to-short.com/here/
to_user - assign new URL to certain user. Use your login in this parameter:
http://newhotlink.comShortURL/Add/?mode=API&to_user=YourLogin&key=yourAPIkey&url=http://link-to-short.com/here/
key - API key for your account - find it on "Edit Profile" page (note: API key linked to your password - don't forget to replace key if your password changed);
adscode
- this option as GET variable may contain only one value: repeat (this will add latest ads code from link added by you) - like this: &adscode=repeat Note: this parameter work only with "to_user" variable (for registered users only);
adsmode - this variable works only with advertisement code being added to URL - may be either empty or 1 (ads will be visible in frame): &adsmode=1

Also you can use POST method with link http://newhotlink.comShortURL/Add/?mode=API

POST variables:
url - single URL submission;
tag - custom tag to use with URL/s (note: if tag is taken - you'll have error message instead of new address);
pass - password (numbers and english letters allowed - but no special symbols);
validTill - link expiration date - format is 2008-12-05 (YYYY-MM-DD = year-month-day);
bulk - bulk URLs (start each from new line symbol);
adscode - advertisement code for your link. Use 'repeat' word to use last ads block you added to site's database. 'Repeat' option work only with "to_user" parameter (for registered users only). Example: you can add one URL with advertisement block manually and then add your URLs with '&adscode=repeat' parameter;
adsmode - either empty (means ads will be shown on middle page) or 1 (ads will be visible in frame);
title - title for your link (if you want to share it);
description - description for your link (if you want to share it).

Output examples and codes.

By default site output just plain text string with shortened tag - something like 'short-tag' (without quotes) - but with "output" variable it can be either XML or JSON string.

Example output for JSON:

{{'status':'200','message':'ok', 'tag':'output-short-tag-here'},{'status':'200','message':'ok', 'tag':'another-short-tag-here'}}

Example output for XML:

< ?xml version="1.0" encoding="UTF-8"?>
< results>
  < url>
    < code>200< /code>
    < message>ok< /message>
    < tag>output-short-tag< /tag>
  < /url>
  < url>
    < code>200< /code>
    < message>ok< /message>
    < tag>another-short-tag< /tag>
  < /url>
< /results>

Output codes:

200 - everything is fine;
401 - bad login or IP address is blocked;
403 - forbidden domain/URL;
404 - URL not accessible (site not online or page returned 404 error);
500 - all other errors (see messages for description).

Loading ...