Thursday, 28 May 2009

Public beta of our new API service is now live

As work continues on our API service, we've just launched a beta version for you to try.

While this is the 'Basic API' (the 'Advanced API' will follow soon after), it is fully functional and requires no authentication. You can provide authentication if you wish your API-created URLs to appear on your profile and be manageable at a later date, but it's not a requirement.

Below are some rough instructions, let us know how you get on!

Our 'Basic API' is accessed via simple HTTP GET requests.

Send your HTTP GET request to our API service, along with your long url and we will instantly supply you with a short URL. Your request needs to include 'url=' for us to be able to process your request.

Supplying:
http://api.fwd4.me/?url=http://www.twitter.com/Fwd4Me
Will return:
http://fwd4.me/tn
If you wish your short URLs to appear in your profile page (and therefore be manageable at a later date) you can also supply your API Key. An example of using our 'Basic API' with your API Key:

Supplying:
http://api.fwd4.me/?key=5e234ba69ca3f5fc4498&url=http://www.twitter.com/Fwd4Me
Will return:
http://fwd4.me/tn
(but with you now being able to manage your short url at a later date from your profile)

If for any reason we are unable to shorten your long URL, you will be presented with the following result:
ERROR:x

Where 'x' will be a number relating to the error code in question. Rather than supplying error messages, our 'Basic API' supplies error numbers instead. This is to allow you to customize your own error messages based on our error number for better integration in to your own web site or application.

Error numbers from our 'Basic API' can be translated as:
ERROR:1 - An invalid long URL was supplied. Ensure your long URL starts with either http:// or https:// and ensure that your long url doesn't contain any foreign characters.

ERROR:2 - An invalid API Key has been supplied. Check your API Key and try again.

ERROR:3 - Based on your API Key, your account has either been suspended or revoked - please contact us to discuss this further.

ERROR:4
- Internal System Error - Unable to shorten your long URL.

Well, hopefully that'll all make sense, do let us know how you get on and check back soon for more updates on the 'Advanced API' that we'll also be launching in a couple of weeks time!



0 comments:

Post a Comment