Menu

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.

Show posts Menu

Messages - stuckoff

#1
Development and Code Review / API result:failed
February 02, 2025, 10:14:48 AM
Hi

I'm trying to automate some simple tasks on OPNSense via the API, but for some reason here is my cURL commnad:
curl -H Accept: application/json -k -u  XXXXXXXXX:XXXXXXXXX https://192.168.100.3/api/interfaces/vlan_settings/addItem  -d '{vlanif:vlan0.777,if: lagg1,tag: 777,pcp:0,proto:,descr:VLAN_777_TEST}'
The result of this is:
{"result":"failed"}
At the same time if I change the request to:
curl -H Accept: application/json -k -u  XXXXXXXXX:XXXXXXXXX https://192.168.100.3/api/interfaces/vlan_settings/get
the system returns correct response.

Do I need to change the data format?