Developer

MrVigner API Guide

Documentation on how to use Premium URL Shortener's API system to develop your apps. The new API of MrVigner Short URL is built on the RESTful architecture and it allows you to easily interact with your website using the following endpoints. There were some changes to the API in order facilitate requests from developers.

 

Authentication

As before, an API key is required for requests to be processed by the system. Once a user registers, an API key is automatically generated for this user and it can be found in the /user/tools page. The API key must be sent with each request via the key parameter.

 

Response Handling

All API response are returned in JSON format by default. To convert this into usable data, the appropriate function will need to be used according to the language. In PHP, the function json_decode() can be used to convert the data to either an object (default) or an array (set the second parameter to true). It is very important to check the error key as that provides information on whether there was an error or not.

 

Shorten a Link

To send a request, the user must use the following format where the variables key and url are required. In the example below, the URL of the demo is used but you should use your own domain name. To request a custom alias, simply add &custom= at the end.

Parameter Description
key (required) Your API key.
url (required) Long URL to shorten.
custom (optional) Custom alias instead of random alias.
type (optional) Redirection type [direct, frame, splash]
password (optional) Password protection
format (optional) Output format. Default is json. [json, text]

 

Server response

As before, the response will encoded in JSON format (default). This is done to facilitate cross-language usage. The first element of the response will always tell if an error has occurred (error: 1) or not (error: 0). The second element will change with respect to the first element.

If there is an error, the second element will be named “msg”. which contains the source of error, otherwise it will be named “short” which contains the short URL. (See the example)

Keyword Density Checker