1
Development and Code Review / Re: API Wireguard "result": "failed"
« on: January 18, 2023, 07:10:55 am »
Having the same issue when trying to add client to wireguard.
Have tried adding {"client": ...} which also just returns , {"result":"failed"}
Quote
When run the curl commandCode: [Select]curl -X POST -d '{"enabled”:"1",”name”:”test.user”,“pubkey“:“$key“,“tunneladdress“:“xxx.xxx.xxx.xxx/xx“}' -H "Content-Type: application/json" -k -u $key:$secret https://$IP/api/wireguard/client/addClient
I get the same message {"result":"failed"}.
There is nothing to find in any log files, so what am I doing wrong?
Thank you in advance.
I just hit this also; you need the following format:Code: [Select]curl -X POST -d '{"client":{"enabled”:"1",”name”:”test.user”,“pubkey“:“$key“,“tunneladdress“:“xxx.xxx.xxx.xxx/xx“}}' -H "Content-Type: application/json" -k -u $key:$secret https://$IP/api/wireguard/client/addClient
i.e: Wrap your existing code in an outer {"client": ... }
Have tried adding {"client": ...} which also just returns , {"result":"failed"}