MENU
Skip menuxit.co.za API
xit.co.za has a similar API to most URL shortening services that currently exist. In addition, xit.co.za provides some extra output options when using the API.
The xit.co.za API is GET-driven, and all API calls start with http://xit.co.za/url/create, and have an optional output modifier.
Web output
Doing an API call with the /web modifier will create the shortened URL and redirect the browser to the preview page for the shortened URL.Example
http://xit.co.za/url/create/web?url=http%3A%2F%2Fxit.co.za%2F
will redirect to:
http://xit.co.za/1/p
Text output
Doing an API call with no modifier will create the shortened URL and merely output the shortened URL as text.Example
http://xit.co.za/url/create?url=http%3A%2F%2Fxit.co.za%2F
will output:
http://xit.co.za/1
XML output
Doing an API call with the /xml modifier will create the shortened URL and return XML.Example
http://xit.co.za/url/create/xml?url=http%3A%2F%2Fxit.co.za%2F
will output:
<?xml version="1.0" encoding="UTF-8"?> <urlset> <url>http://xit.co.za/1</url> </urlset>
JSON output
Doing an API call with the /json modifier will create the shortened URL and return JSON.Example
http://xit.co.za/url/create/json?url=http%3A%2F%2Fxit.co.za%2F
will return:
{"urlset":{"url":"http:\/\/xit.co.za\/1"}}
with an application/json content-type response header.Twitter redirect
Doing an API call with the /twitter modifier, currently used in the easy TwiXit! bookmarklet, will auto-redirect the browser to the user's Twitter webpage with the shortened URL already filled in the status update for easy editing and tweeting.Example
http://xit.co.za/url/create/twitter?url=http%3A%2F%2Fxit.co.za%2F
will redirect to:
http://twitter.com/home?status=http%3A%2F%2Fxit.co.za%2F1
which allows the user to edit the status update before tweeting it.