Quantcast
Channel: MikroTik
Viewing all articles
Browse latest Browse all 21283

Scripting • How can i use rest api to run a script?

$
0
0
routers ip is 192.168.20.1
i followed the documentation about rest api I have also watched the video where he sets up the certificate and firewall rule.
I made a user just for using the api i gave it permisions like read api rest api and web
I tested with this curl payload and it worked for me
Code:
curl -k -u admin:pass https://192.168.20.1/rest/system/resource
The script i want to run is a wake on lan script for my computer and i would like to run it from my home assistant server so i can power on my laptop from it

Now before you say that this is posible from home assistant yes it is but since im running it on a docker container on a bridged network (tried changing to host but it didnt work).I also tried to use a custom integration that currently doesnt work with 7.13

The docker container is running on a raspberry pi 4 and not on the router it self

Statistics: Posted by GiannisD — Fri Mar 08, 2024 8:22 pm



Viewing all articles
Browse latest Browse all 21283

Trending Articles