/v1/shorten.php
Parameters
* format (optional) indicates the requested response format. supported formats: json (default), xml.
* long_url is a long URL to be shortened (example: http://itkeepsgoingandgoing.com/).
* display_inter display interstitial ad: 1 to enable, 0 or not present to disable.
* x_login (optional) is the end-user's login when make requests on behalf of another ity.im user. This allows application developers to pass along an end user's ity.im login.
* x_apikey (optional) is the end-user's apiKey when making requests on behalf of another ity.im user. This allows application developers to pass along an end user's ity.im apiKey.
Notes
* Long URLs should be URL-encoded. You can not include a long_url in the request that has '&', '?', '#', ' ', or other reserved parameters without first encoding it.
* Long URLs should not contain spaces: any long_url with spaces will be rejected. All spaces should be either percent encoded (%20) or plus encoded (+). Note that tabs, newlines and trailing spaces are all indications of errors. Please remember to strip leading and trailing whitespace from any user input before shortening.
* Long URLs must have a slash between the domain and the path component. For example, http://example.com?query=parameter is invalid, and instead should be formatted as http://example.com/?query=parameter * When including x_login and x_apiKey, the shortened URL will be inserted into the history for the user specified by x_login. it will not be inserted into the history for the user specified by login.
Output
* url is the actual link that should be used, and is a unique value for the given ity.im account.
* hash is a ity.im identifier for long_url which is unique to the given account.
* long_url is an echo back of the long_url request parameter. This may not always be equal to the URL requested. That's because some URL normalization may occur (e.g., due to encoding differences, or case differences in the domain). This long_url will always be functionally identical the the request parameter.
Examples
* json format http://api.ity.im/v1/shorten.php?login=apidemp&apikey=23423411234768&long_url=http%3A%2F%2Fitkeepsgoingandgoing.com%2F&format=json
{
"status_code": 200,
"data": {
"url": "http://ity.im/Xgd5",
"hash": "Xgd5",
"long_url": "http://itkeepsgoingandgoing.com/"
},
"status_txt": "OK"
}
"status_code": 200,
"data": {
"url": "http://ity.im/Xgd5",
"hash": "Xgd5",
"long_url": "http://itkeepsgoingandgoing.com/"
},
"status_txt": "OK"
}
* xml format http://api.ity.im/v1/shorten.php?login=apidemo&apikey=23423411234768&long_url=http%3A%2F%2Fitkeepsgoingandgoing.com%2F&format=xml
<?xml version="1.0" encoding="UTF-8"?>
<response>
<status_code>200</status_code>
<status_txt>OK</status_txt>
<data>
<url>http://ity.im/Xgd5</url>
<hash>Xgd5</hash>
<long_url>http://itkeepsgoingandgoing.com/</long_url>
</data>
</response>









