1
Development and Code Review / Re: API Wireguard "result": "failed"
« on: January 04, 2023, 12:19:10 pm »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": ... }