ulvis.paste.net

Paste Search Dynamic
Recent pastes
URL Shortener api
  1. OVERVIEW
  2.  API allows you to provide short url functionality to any of your existing websites. When you register for an account, you're generated a unique API key which should be used in the API calls listed below.
  3.  
  4. The examples below generate responses in json but you can also use xml by replacing the end of the url call with .xml.
  5.  
  6. CREATE
  7. Create a new short url providing a base64 encoded version of the original long url.
  8.  
  9. PARAMETERS:
  10. Name:   Type:   Description:
  11. key     string  Your API access key. Login to view.
  12. url     string  Base64 encoded version of your long url. base64_encode() in PHP.
  13. RETURN VALUES:
  14. Name:   Type:   Description:
  15. url_id  integer Unique url id.
  16. short_url       string  Short url including domain name.
  17. short_url_part  string  Short url part. (excluding domain name)
  18. original_url    string  The original decoded long url.
  19. date_time       string  Date and time of the API call. In the format yyyy-mm-dd hh:mm:ss.
  20. EXAMPLE REQUEST:
  21. API Address: http://zxc.lu
  22. GET //api/v1/d2d841906dbd80dc15003c6d4eda34c8/shorturl/create/url/BASE64_ENCODED_LONG_URL.json
  23. EXAMPLE RESPONSE:
  24. {
  25.    "code":200,
  26.    "data":{
  27.       "url_id":"1388597",
  28.       "short_url":"http://zxc.lu/srt",
  29.       "short_url_part":"srt",
  30.       "original_url":"http://www.bbc.co.uk",
  31.       "date_time":"2013-04-04 16:18:05"
  32.    }
  33. }
  34. CREATE (ADDITIONAL OPTIONS)
  35. Create a new short url including some additional settings such as a custom short url, password to access and an expiry date.
  36.  
  37. PARAMETERS:
  38. Name:   Type:   Description:
  39. key     string  Your API access key. Login to view.
  40. url     string  Base64 encoded version of your long url. base64_encode() in PHP.
  41. custom_url (optional)   string  Custom short url part.
  42. password (optional)     string  Password to access url.
  43. expiry_date (optional)  string  Date to expire the url. In the format yyyy-mm-dd.
  44. base_domain (optional)  string  Url to use for the short url. Must already exist on the site. No http or trailing forward slash. i.e. domain.com
  45. RETURN VALUES:
  46. Name:   Type:   Description:
  47. url_id  integer Unique url id.
  48. short_url       string  Short url including domain name.
  49. short_url_part  string  Short url part. (excluding domain name)
  50. original_url    string  The original decoded long url.
  51. date_time       string  Date and time of the API call. In the format yyyy-mm-dd hh:mm:ss.
  52. EXAMPLE REQUEST:
  53. API Address: http://zxc.lu
  54. GET //api/v1/d2d841906dbd80dc15003c6d4eda34c8/shorturl/create/custom_url/CUSTOM_SHORT_URL/password/PASSWORD_TO_ACCESS/expiry_date/URL_EXPIRY_DATE/url/BASE64_ENCODED_LONG_URL.json
  55. EXAMPLE RESPONSE:
  56. {
  57.    "code":200,
  58.    "data":{
  59.       "url_id":"1388598",
  60.       "short_url":"http://zxc.lu/bbc",
  61.       "short_url_part":"bbc",
  62.       "original_url":"http://www.bbc.co.uk",
  63.       "date_time":"2013-04-04 16:18:08"
  64.    }
  65. }
  66. DISABLE
  67. Disable an active short url within your account.
  68.  
  69. PARAMETERS:
  70. Name:   Type:   Description:
  71. key     string  Your API access key. Login to view.
  72. short_url       string  Base64 encoded version of your short url. base64_encode() in PHP.
  73. RETURN VALUES:
  74. Name:   Type:   Description:
  75. url_id  integer Unique url id.
  76. status  string  Short url status.
  77. short_url       string  Short url including domain name.
  78. date_time       string  Date and time of the API call. In the format yyyy-mm-dd hh:mm:ss.
  79. EXAMPLE REQUEST:
  80. API Address: http://zxc.lu
  81. GET //api/v1/d2d841906dbd80dc15003c6d4eda34c8/shorturl/disable/short_url/BASE64_ENCODED_SHORT_URL.json
  82. EXAMPLE RESPONSE:
  83. {
  84.    "code":200,
  85.    "data":{
  86.       "url_id":"1388598",
  87.       "status":"disabled",
  88.       "short_url":"http://zxc.lu/bbc",
  89.       "date_time":"2013-04-04 17:01:42"
  90.    }
  91. }
  92. ACTIVATE
  93. Activate a disabled short url within your account.
  94.  
  95. PARAMETERS:
  96. Name:   Type:   Description:
  97. key     string  Your API access key. Login to view.
  98. short_url       string  Base64 encoded version of your short url. base64_encode() in PHP.
  99. RETURN VALUES:
  100. Name:   Type:   Description:
  101. url_id  integer Unique url id.
  102. status  string  Short url status.
  103. short_url       string  Short url including domain name.
  104. date_time       string  Date and time of the API call. In the format yyyy-mm-dd hh:mm:ss.
  105. EXAMPLE REQUEST:
  106. API Address: http://zxc.lu
  107. GET //api/v1/d2d841906dbd80dc15003c6d4eda34c8/shorturl/enable/short_url/BASE64_ENCODED_SHORT_URL.json
  108. EXAMPLE RESPONSE:
  109. {
  110.    "code":200,
  111.    "data":{
  112.       "url_id":"1388598",
  113.       "status":"active",
  114.       "short_url":"http://zxc.lu/bbc",
  115.       "date_time":"2013-04-04 17:01:42"
  116.    }
  117. }
  118. INFO
  119. Get detailed information for any short url within your account.
  120.  
  121. PARAMETERS:
  122. Name:   Type:   Description:
  123. key     string  Your API access key. Login to view.
  124. short_url       string  Base64 encoded version of your short url. base64_encode() in PHP.
  125. RETURN VALUES:
  126. Name:   Type:   Description:
  127. url_id  integer Unique url id.
  128. short_url       string  Short url including domain name.
  129. short_url_part  string  Short url part. (excluding domain name)
  130. original_url    string  The original decoded long url.
  131. date_created    string  The date/time the short url was create.
  132. last_accessed   string  The date/time the short url was last accessed.
  133. total_visits    integer Total visits
  134. has_password    bool    Whether the url needs a password to access.
  135. expiry_date     string  The date/time the short url will expire.
  136. status  string  Short url status.
  137. date_time       string  Date and time of the API call. In the format yyyy-mm-dd hh:mm:ss.
  138. EXAMPLE REQUEST:
  139. API Address: http://zxc.lu
  140. GET //api/v1/d2d841906dbd80dc15003c6d4eda34c8/shorturl/info/short_url/BASE64_ENCODED_SHORT_URL.json
  141. EXAMPLE RESPONSE:
  142. {
  143.    "code":200,
  144.    "data":{
  145.       "url_id":"13423436",
  146.       "short_url":"http://zxc.lu/bbc",
  147.       "short_url_part":"bbc",
  148.       "original_url":"http://www.bbc.co.uk",
  149.       "date_created":"2013-04-04 12:36:09",
  150.       "last_accessed":"2013-05-02 12:32:05",
  151.       "total_visits":"3452",
  152.       "has_password":true,
  153.       "expiry_date":"2019-03-02 23:59:59",
  154.       "status":"active",
  155.       "date_time":"2013-04-04 17:10:14"
  156.    }
  157. }
  158. LIST
  159. List all active urls within your account.
  160.  
  161. PARAMETERS:
  162. Name:   Type:   Description:
  163. key     string  Your API access key. Login to view.
  164. RETURN VALUES:
  165. Name:   Type:   Description:
  166. urls    array   List of short urls within the account.
  167. date_time       string  Date and time of the API call. In the format yyyy-mm-dd hh:mm:ss.
  168. EXAMPLE REQUEST:
  169. API Address: http://zxc.lu
  170. GET //api/v1/d2d841906dbd80dc15003c6d4eda34c8/shorturl/list_active_urls.json
  171. EXAMPLE RESPONSE:
  172. {
  173.    "code":200,
  174.    "data":{
  175.       "urls":[
  176.          {
  177.             "short_url":"http://zxc.lu/2F"
  178.          },
  179.          {
  180.             "short_url":"http://zxc.lu/2q"
  181.          }
  182.       ],
  183.       "date_time":"2013-04-09 09:48:05"
  184.    }
  185. }
  186.  
Parsed in 0.015 seconds