The term "REST API" generally refers to an API accessed via HTTP protocol at a predefined set of resource oriented URLs.
In RouterOS it is implemented a JSON wrapper interface of the console API. It allows to create, read, update and delete resources and call arbitrary console commands.
To start to use REST API, the www-ssl
service [link to IP services] must be configured and running. When the ssl service is enabled the REST service can be accessed by connecting to https://<routers_IP>/rest
.
The easiest way to start is to use cUrl, wget or any other HTTP client.
$ curl -k -u admin: https://10.155.101.214/rest/system/resource [{"architecture-name":"tile","board-name":"CCR1016-12S-1S+","build-time":"Dec/04/2020 14:19:51","cpu":"tilegx","cpu-count":"16","cpu-frequency":"1200","cpu-load":"1","free-hdd-space":"83439616","free-memory":"1503133696","platform":"MikroTik","total-hdd-space":"134217728","total-memory":"2046820352","uptime":"2d20h12m20s","version":"7.1beta4 (development)"}] |
Authentication to the REST API is performed via HTTP Basic Auth. Provide your Username and password are the same as for the console user (by default "admin" with no password).