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.xvr.me/api.php (or
api.2ve.org/api.php as before) 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
makeshorterfileformat = Format of the response. You can select between
txt,
xml or
json (always lower case). If not provided or left blank
xml will be used as the standard output.
shortpath =
Optional! Is the part after the standard API domain and can be provided is the user would like to select something easy-to-remember. For example
avier would return a short link as
http://2ve.org/xavier if that is available, otherwise a 500 error is supplied.
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

, in this case 17 characters shorter.
Standard API DomainEach API key have a standard domain used for the short links and this domain can be any of the domain names available (at the moment xvr.me, 2ve.org and ryqn.com). To check which the standard API domain is, just send a request to the API server with the following:
api = The unique API ID you got from Xavier Media
key = Your API key you got from Xavier Media
action = To get the standard domain action would be
requestsitefileformat = Format of the response (see above for file formats)
If you make a link shorter, you also get the standard API domain in the short link response as "link".
Error messagesIf 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>
Updated 2012-05-20: Added new format, new short links domains, new action (request standard API domain).