OPNsense
  • Home
  • Help
  • Search
  • Login
  • Register

  • OPNsense Forum »
  • Profile of Geitjie »
  • Show Posts »
  • Messages
  • Profile Info
    • Summary
    • Show Stats
    • Show Posts...
      • Messages
      • Topics
      • Attachments

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

  • Messages
  • Topics
  • Attachments

Messages - Geitjie

Pages: [1]
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.

Quote from: PJAU on January 04, 2023, 12:19:10 pm
Quote

When run the curl command
Code: [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/addClientI 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"}

Pages: [1]
OPNsense is an OSS project © Deciso B.V. 2015 - 2023 All rights reserved
  • SMF 2.0.19 | SMF © 2021, Simple Machines
    Privacy Policy
    | XHTML | RSS | WAP2