| <<< |
getShortUrl |
Method Description |
Return a short URL for a long URL. Visiting the short URL will show the page
linked by the long URL in an iFrame and an ad may be shown at the top of the iFrame.
Valid clicks on the ads will be credited to your account.
|
Arguments |
data[user] (Required)
Your RevTwt API user id. This is used to
credit the clicks to your account.
|
data[key] (Required)
KEY for your user id
Apply for API license to get your user ID and key
|
data[lurl] (Required)
The long URL to be shortened
|
Response |
The response is an XML file containing the short URL
<?xml version="1.0" encoding="UTF-8" ?>
<shorturl>
http://tinyurl.com/ldduj6
</shorturl>
|
Example Response:
<shorturl>
http://tinyurl.com/ldduj6
</shorturl> |
Error Code |
| 105:Database error |
| 115:Service currently unavailable |
| 300:Invalid Parameters, e.g., USER ID or USER KEY is empty |
| 400:Invalid USER ID |
404:Invalid USER KEY
|
Request URL |
| http://revtwt.com/api/urls/getShortUrl.xml |
Usage Example |
| curl -H "Accept: text/xml" -d data[lurl]=www.example.com -d data[user]=2 -d data[key]='your key' http://revtwt.com/api/urls/getShortUrl.xml |