Finnish translation here.
Create an account to get the API key.
Prior to requests for a server, the API key is mandatory. The API key will find your account settings from the page.
When a user registers an API key is created automatically. The API key is mandatory to add the request to the api parameter (See example below).
Sending a request
When submitting the request, the parameters api and url are mandatory. See the example below. To use a custom alias, simply add & custom = end.
The server response will be in the encoded JSON format (default). This is done to work in many different programming languages. The first element of the answer tells you whether there were any errors (error: 1) or (error: 0). The next element changes according to the errors. However, if an error occurs, the name of the next element changes to "msg": contains the original error message, otherwise the name remains "short" containing the abbreviated URL. (See example below.)
Use text format
You can now also send a request to get the answer as text, simply add &format=text to the end of the request. For example: https://los.fi/DkZOb from JSON's farm. Please note that if a request fails, the server will not respond.
Using API in PHP
To use API in your php program you need to send a request through file_get_contents or cURL. Both are fully functional options.
Using API with C #
In this example, we use Newtonsoft's "Json.NET" library to parse the JSON response.
Use the API with jQuery