This is the programmatic side of the web site at goolnk.com. The examples in this guide all use a REST-style JSON protocol.
Shorten a long URL
POST request to: /api/v1/shorten
- url - a long URL to be shortened (example: http://google.com/).
- Long URLs should be URL-encoded. You can not include a longUrl in the request that has &, ?, #, or other reserved parameters without first encoding it.
- Long URLs should not contain spaces: any longUrl 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.
- Return Values
- result_url - short link
- error - information about the error, if it occurred
3 concurrent calls per second.
For example, to shorten the URL https://www.google.com/, send the following request:
curl -XPOST -d 'url=https%3A%2F%2Fgoogle.com%2F' 'https://goolnk.com/api/v1/shorten'
If successful, the response will look like: