Latest news from Xavier Media
It is currently Thu May 17, 2012 4:17 am

All times are UTC




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: 2ve.org API - Make long URLs much shorter
PostPosted: Sat Feb 07, 2009 3:14 pm 
Offline
XavierForum.com Admin
XavierForum.com Admin
Super VIP Member
Super VIP Member
User avatar

Joined: Tue Mar 15, 2005 4:37 pm
Posts: 1032
Location: Sweden
Points: 1000
At the moment this API is only open for people developing services for Xavier Media.

To make a URL shorter via this API you need to send a request to api.2ve.org/api.php with the following parameters:
api = The unique API ID you got from Xavier Media
key = Your API key you got from Xavier Media
longlink = The link you want to make shorter
action = To make a link shorter you should set this to makeshorter
fileformat = Format of the response. You can select between xml or json (always lower case). If not provided or left blank xml will be used as the standard output.

The response you get back from the API will look something like this:
Code:
<veresponse responsecode="200">
  <title>2ve.org - Short URL API</title>
  <link>http://2ve.org/</link>
  <shortlink>http://a3a.2ve.org/</shortlink>
  <longlink>http://blog.xaviermedia.com/cumulus/</longlink>
  <numcharshorter>17</numcharshorter>
</veresponse>


The shorter URL is found in the shortlink tag. The tag numcharshorter will tell you how much shorter your short link is then your long link :D , in this case 17 characters shorter.

Error messages

If something goes wrong with the API request for example if you miss-spell your API key you will get an error message with a response code other then 200.

The error message contains a message describing the problem and may look like this:
Code:
<veresponse responsecode="404">
  <title>2ve.org - Invalid API key</title>
  <errormessage>The combination of <strong>API key</strong> and <strong>API ID</strong> you used is not valid. Please make sure you've spelled everything correct.</errormessage>
</veresponse>

_________________
Xavier Media®
PHP Password Protection | Get your latest blog post in your signature you too
Latest Blog Post: New feature for XavierForum.com members


Report this post
Top
 Profile Send private message  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC


Who is online

Registered users: No registered users


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron

Portal » Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
[
SEO MOD © 2007 StarTrekGuide ]