LinksPreadeR beta
Link spreader is a URL morphing/shortening website with a difference. You can include your message/comment about the link in the link itself. Shorter URLs are available as a sidekick for use with Twitter.


REST API

Use the LinksPreadeR REST API gateway to gain programmatic access to the LinksPreadeR website. You can use it to shorten a long URL and do a reverse lookup on "LPRed" short URLs. The results are returned in the widely supported JSON format. Additional formats will be made available soon or sooner upon request.

You will need the API key to interact with our API gateway. To get your API key, email us. All API methods return a consistent set of return fields, error codes and messages




/shorten

Expects a long URL, optionally a comment to go with the link, and returns a short URL

Arguments:

Required

longurl (The url you would like to be shortened. URL encoded)
apikey

Optional

link_comment

Returns:

shorturl
hash (associated with the shortened or "LPRed" URL. You can use this to lookup a shortened URL)

Example:

http:/api.l.pr/shorten?apikey=axbymc46859i685jfk9fk&longurl=http%3A%2F%2Ffoxnews.com&link_comment=this+is+link+for+a+news+site




/expand

Expects a hash or a short URL and returns the associated long URL

Arguments:

Required

hash
OR
shorturl (URL encoded)

apikey

Returns:

longurl
link_comment (the comment associated with the URL, if available)

Example:

http://api.l.pr/expand?apikey=axbymc46859i685jfk9fk&hash=a42f6

http://api.l.pr/expand?apikey=axbymc46859i685jfk9fk&shorturl=http%3A%2F%2Fl.pr%2Fa42f6




Return results, Error Codes and Messages

All API methods return the following fields:

errorCode (Code associated with the error
see below. Please specify which error code you are getting when requesting support)

errorMessage (Short message explaining the error.)

results (contains the returned results)

statusCode (OK if the method was successful in perform the action requested, ERROR otherwise )


List of error Codes

1 - apikey not supplied

2 - invalid api key

3 - longurl not supplied

4 - shorturl/hash not supplied. Supply either one

5 - No url found corresponding to that hash



Still have questions?    
Email us


    L.pr Home    |    API    |    Blog    |   Help    |    About    |    Contact 
 Hosting Server Partner: Atlantic.Net  Dedicated Server  Managed Hosting  Dedicated Hosting  Colocation