hello, I have read the different articles on the subject but still I can't figure it out. I simply want to disable / enable a rule with the API.
ex :
curl -XPOST -k -u "mykey":"mysecret" https://myfirewall:4443/api/firewall/filter/toggleRule/86833879d5f092ffefd6c7ea13224c43/1
result :
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>411 Length Required</title>
</head>
<body>
<h1>411 Length Required</h1>
</body>
</html>
with postman :
{
"result": "failed"
}
I tried several syntax found on the forum, docs, tutorials, but no positive results. However when I make API requests on the aliases it works.
thank you in advance for your help
I am looking at these docs (https://docs.opnsense.org/development/api/core/firewall.html) and it is unclear if the API works on the built-in firewall rules based upon this statement:
Although the plugin does contains a basic user interface (in Firewall ‣ Automation), it's mirely intended as a reference and testbed. There's no relation to any of the rules being managed via the core system.
Either the docs are broken or those API endpoints are not for the built-in firewall. I am trying to figure out the same thing (https://forum.opnsense.org/index.php?topic=40977.msg200885#msg200885).