curl -XPOST -d '' -k -u "key":"secret" "https://192.168.15.1/api/wol/wol/wakeall"
curl -XPOST -d '{"wake": {"interface": "opt2","mac": "E0:D5:5E:00:63:1C"}}' -k -u "key":"secret" "https://192.168.15.1/api/wol/wol/set"
curl: (3) unmatched brace in URL position 1:{interface: ^
curl -XPOST -d '{"wake":"interface":"opt2","mac":"E0:D5:5E:00:63:1C"}' -k -u "key":"secret" "https://192.168.15.1/api/wol/wol/set"
curl -s -k -d '{"wake":{"interface":"opt2", "mac":"E0:D5:5E:00:63:1C"}}' --user "key":"secret" -H 'Content-Type: application/json' https://192.168.15.1/api/wol/wol/set
curl -X POST \ -d '{"wake":{"interface":"opt2","mac":"E0:D5:5E:00:63:1C"}}' \ -k \ -u "$API_KEY:$API_SECRET" \ -H "Content-Type: application/json" \ "https://192.168.15.1/api/wol/wol/set"
{"status":"OK"}
curl -X POST -d '{"wake":{"interface":"opt2","mac":"E0:D5:5E:00:63:1C"}}' -k -u "$API_KEY:$API_SECRET" -H "Content-Type: application/json" "https://192.168.15.1/api/wol/wol/set"
{"errorMessage":"/usr/local/opnsense/mvc/app/controllers/OPNsense/Base/ApiControllerBase.php:197: Syntax error","errorTrace":"#0 [internal function]: Phalcon\\Support\\Helper\\Json\\Decode->__invoke(''{wake:{interfa...', true)\n#1 /usr/local/opnsense/mvc/app/controllers/OPNsense/Base/ApiControllerBase.php(197): Phalcon\\Http\\Request->getJsonRawBody(true)\n#2 /usr/local/opnsense/mvc/app/controllers/OPNsense/Base/ApiControllerBase.php(313): OPNsense\\Base\\ApiControllerBase->parseJsonBodyData()\n#3 [internal function]: OPNsense\\Base\\ApiControllerBase->beforeExecuteRoute(Object(Phalcon\\Mvc\\Dispatcher))\n#4 [internal function]: Phalcon\\Dispatcher\\AbstractDispatcher->dispatch()\n#5 /usr/local/opnsense/www/api.php(24): Phalcon\\Mvc\\Application->handle('/api/wol/wol/se...')\n#6 {main}","errorTitle":"An API exception occurred"}
import http.clientimport jsonimport sslconn = http.client.HTTPSConnection('$OPNsenseIP:$Port', context=ssl._create_unverified_context())headers = { 'Content-Type': 'application/json', 'Authorization': 'Basic %Base64 Coded API and Secret Key%',}json_data = { 'wake': { 'interface': 'opt1', 'mac': '00:00:00:00:00:00', },}conn.request( 'POST', '/api/wol/wol/set', json.dumps(json_data), # '{"wake":{"interface":"opt1","mac":"00:00:00:00:00:00"}}', headers)response = conn.getresponse()
curl -X POST -H 'Content-Type:application/json' -d '{"wake":{"interface":"opt1","mac":"00:00:00:00:00:00"}}' -k -u "$API-Key:$API-Secret" https://$OPNsenseIP:$Port/api/wol/wol/set
@echo offpython C:\pathtopythonscriptfile\wol.pypause
Are you trying to wake an OPN machine or one running another OS, which one?