Mikrotik Api — Examples
api('/ip/dhcp-server/lease/add', 'address': '192.168.88.50', 'mac-address': '00:11:22:33:44:55', 'server': 'dhcp1', 'comment': 'Printer' )
Harnessing the MikroTik RouterOS API: Integration and Automation mikrotik api examples
B) Using librouteros for binary API (v6/v7) api('/ip/dhcp-server/lease/add', 'address': '192
Before you can send any commands, you must enable the API service on your MikroTik device. By default, the API uses for unencrypted connections and TCP port 8729 for secure connections. To enable the API via the Command Line Interface (CLI): mikrotik api examples