Community discussions

MikroTik App
 
JDF
just joined
Topic Author
Posts: 12
Joined: Wed Aug 16, 2023 1:40 pm

Rest API port reset

Wed Aug 16, 2023 1:56 pm

Hey,

I've made some templates for Comfortclick bOS so its able to get general info from MikroTik and to control ports with REST API. I got the general info and PoE reset to work but now im stuck at disabling/enabling the interface - all i get is bad request.
Does anyone know what is the correct Post data for port disable/enable? I tried to send POST to interface/ethernet post data {"disable":"ether":"*3"} after some searching but this is also incorrect.
 
JDF
just joined
Topic Author
Posts: 12
Joined: Wed Aug 16, 2023 1:40 pm

Re: Rest API port reset  [SOLVED]

Tue Aug 22, 2023 10:44 am

I found my mistake by trial and error - correct post data to disable/enable ports is:
 {".id": "*7"} 
for port 6 for example.
 
fabio
just joined
Posts: 14
Joined: Tue Oct 10, 2023 10:16 pm

Re: Rest API port reset

Mon Oct 30, 2023 11:20 pm

I found my mistake by trial and error - correct post data to disable/enable ports is:
 {".id": "*7"} 
for port 6 for example.
Hi JDF, can you post the entire request? URL, body, etc.....
 
JDF
just joined
Topic Author
Posts: 12
Joined: Wed Aug 16, 2023 1:40 pm

Re: Rest API port reset

Tue Oct 31, 2023 8:59 am

I found my mistake by trial and error - correct post data to disable/enable ports is:
 {".id": "*7"} 
for port 6 for example.
Hi JDF, can you post the entire request? URL, body, etc.....
url: http://IP/rest/interface/disable and if you need to enable it then use: interface/enable with same post data.

If you need to cycle poe power: interface/ethernet/poe/power-cycle data:
{
".id": "*B",
"duration": "5"
}

Who is online

Users browsing this forum: No registered users and 4 guests