barscaret-downcaret-leftcaret-rightcaret-upcheckchevron-leftchevron-rightfile-pdfinfosign-in-altsignin text-widthtimesyoutube

API & Integrations > API

Miradore API v2

Updated on October 18th, 2022

Miradore API (Application Programming Interface) v2 is an HTTPS REST-based interface for integrating Miradore with other applications. API v2 provides access to resources via URL and it is suitable for CRUD (create, read, update and delete) operations in Miradore.


Miradore API v2 uses the authentication key which is sent to the server in the request’s HTTPS header “X-API-Key”.

The authentication key is a random string that can be generated from Miradore web console > System > Infrastructure diagram when the API feature is activated. Please read more about creating an authentication key from the article Getting started with API. See additional instructions about managing authentication keys from Adding API keys and Deleting API keys.

Supported items and methods

The Miradore API v2 is used by sending HTTPS requests to the Miradore server. The API uses standard HTTPS methods GET, PUT, POST, and DELETE. The response format is JSON.
The base URI for API v2 calls:

The technical documentation of Miradore API v2, information about supported items and methods, can be found in the Swagger documentation together with some examples. The documentation is available in: https://<sitename>

It is possible to try out available API v2 operations with the Swagger tool. In the tool, there is a button “Authorize” from where you can authorize a session with the authentication key received from Miradore.

Example 1: Locking a device

  • The device ID is required as a parameter. You can find the device ID from the end of the website URL when the device form is open in the browser. The number 196 is underlined in the example picture below. (Device ID can be also retrieved using Miradore API v1. This is explained in the programmer’s guide of API v1.)

The device number (196) underlined at the end of the website URL.

POST https://<sitename>{id}/Lock

APIv2 view with Try it out-button.

Example 2: Get the device’s locations from a certain time range

  • The device ID is required as a parameter.
  • Optional parameters are startDate and endDate (year-month-day) if you want to define the time range for the results.

GET https://<sitename>{id}/Location

APIv2 parameters view.

  • This field is for validation purposes and should be left unchanged.

Next Article: