Welcome to the Monit24.pl API!
This document contains basic information about calling the API methods. It is meant to provide a relatively painless introduction to the API.
API methods can be called in two ways:
Both ways provide the same functionality; the only difference is the message serialization format. The first way (POSTing JSONs) is recommended and most examples will use it. WSDL files for the SOAP webservices are available at https://api.cloudmonit.pl/2.0.0/wsdl/.
A very simple request to the API:
{"module":"Location","method":"Find"}
POSTing this to https://api.cloudmonit.pl/2.0.0/json_api will return a list of available monitoring stations (locations).
Keep in mind that the Content-Type header of JSON API requests has to be set to application/json
.
Doing this with curl:
curl -X POST -i -H "Content-Type: application/json" -d '{"module":"Location","method":"Find"}' https://api.cloudmonit.pl/2.0.0/json_api
The only mandatory elements of the request are module
and method
. These specify the method to call. A list of API modules is available here.
Other arguments that may be specified include:
Authentication data. Most API methods require authentication. To authenticate to the API, pass an auth
object with fields:
Your Monit24.pl login.
Your Monit24.pl password.
The session id, if you started an API session. This is optional, see Sessions for more information.
Example: to list your services, do:
{"module":"Service","method":"Find","auth":{"login":"LOGIN","password":"PASSWORD"}}
The input to the method. Each method specifies its arguments, you pass them in this field.
For example, to fetch information about a service with a specified ID you can do:
{"module":"Service","method":"Read","auth":{"login":"LOGIN","password":"PASSWORD"},"data":{"id":123456}}
The API language. This determines the language of error messages and other things depending on method (see each module's documentation for details).
Currently there are 2 languages available: English (lang="en"
) and Polish (lang="pl"
). If you do not specify the language, the default one (English) is used.
The API version that you want to use. This parameter is optional, see Versions for more information.
API responds to each call with a JSON object containing the fields:
The response content if the method was successful or NULL if there was an error (though some methods may return NULL). Each method's documentation contains a description of the returned value.
The error description if there was an method call error or NULL if there were no errors (a good practice is to always check if this field is NULL).
See Errors for the error description's format and a list of possible errors.
This field is not present in SOAP responses, SOAP Faults are used to handle API errors (see Errors).
The API version used. See Versions for more information about versions.
The authentication data. Currently it may only contain a session_id
field if you are using sessions. See Sessions for more information.
If you are a Monit24.pl partner, you can read an introduction for partners at README_Distributors.
If you are a Monit24.pl user, move on to README_Users (partners should read it too).