Hello,
Could someone give me one help?
Made this request to my fortinet, gives 200 but looking at console, not works.
curl -k -X PUT --location "https://*****/api/v2/cmdb/firewall/addrgrp/OFF" \
--insecure \
-H "Authorization: Bearer ****" \
--header 'Content-Type: application/json' \
--request PUT \
--data-raw '
{
"method": "PUT",
"url": "/api/v2/cmdb/firewall/addrgrp/OFF",
"params": {
"datasource": true,
"with_meta": true,
"vdom": "root"
},
"data": {
"member": [
{
"name": "X.X.X.1"
}
]
}
}'
{
"http_method":"PUT",
"revision":"519**",
"revision_changed":false,
"mkey":"TAOFF",
"status":"success",
"http_status":200,
"vdom":"root",
"path":"firewall",
"name":"addrgrp",
"serial":"FG*",
"version":"v7.4.3",
"build":2573
}%
Solved! Go to Solution.
This worked for me, thx
curl --location "https://***.***.***.***/api/v2/cmdb/firewall/addrgrp/GROUPNAME/member" --insecure -H "Authorization: Bearer **********" --header 'Content-Type: application/json' --request POST --data-raw '
{"name":"10.10.10.10"}
'
curl --location "https://***.***.***.***/api/v2/cmdb/firewall/addrgrp/GROUPNAME/member/10.10.10.10" --insecure -H "Authorization: Bearer ****" --header 'Content-Type: application/json' --request DELETE
curl --location "hhttps://***.***.***.***/api/v2/cmdb/firewall/addrgrp/GROUPNAME/member/" --insecure -H "Authorization: Bearer ****" --header 'Content-Type: application/json' --request GET
Hi @GeorgeFLopes - can you try this CURL command?
curl -k --location "https://******/api/v2/cmdb/firewall/addrgrp/OFF" \
--insecure \
-H "Authorization: Bearer ***" \
-H "Content-Type: application/json" \
--data-raw '{
"method": "PUT",
"params": {
"datasource": true,
"with_meta": true,
"vdom": "root"
},
"data": {
"member": [
{
"name": "X.X.X.1"
}
]
}
}'
just replace ****** with your actual URL and *** with your actual Authorization token.
Hey, Sure,
Created on 03-26-2024 07:36 AM Edited on 03-26-2024 07:38 AM
Hi @GeorgeFLopes - Before you run the commands again, did you remove the existing members of your OFF address group?
You can check by using 'show firewall addrgrp | grep OFF'.
The PUT method is used to update or modify an existing address group. If you want to create a new one, use POST. To better understand the behavior of modifying an existing address group, try clicking on API Preview or inspecting your browser before clicking the OK button. You can also use 'httpsd -1' to see its behavior.
Here, maybe this link would help you: https://community.fortinet.com/t5/Support-Forum/Fortigate-API-Remove-address-from-group-address/m-p/...
Hello @GeorgeFLopes ,
Can you try like this.Without "data"
{ "member": [ { "name": "xxx_user_name" } ] } }
This worked for me, thx
curl --location "https://***.***.***.***/api/v2/cmdb/firewall/addrgrp/GROUPNAME/member" --insecure -H "Authorization: Bearer **********" --header 'Content-Type: application/json' --request POST --data-raw '
{"name":"10.10.10.10"}
'
curl --location "https://***.***.***.***/api/v2/cmdb/firewall/addrgrp/GROUPNAME/member/10.10.10.10" --insecure -H "Authorization: Bearer ****" --header 'Content-Type: application/json' --request DELETE
curl --location "hhttps://***.***.***.***/api/v2/cmdb/firewall/addrgrp/GROUPNAME/member/" --insecure -H "Authorization: Bearer ****" --header 'Content-Type: application/json' --request GET
Select Forum Responses to become Knowledge Articles!
Select the “Nominate to Knowledge Base” button to recommend a forum post to become a knowledge article.
User | Count |
---|---|
1751 | |
1114 | |
766 | |
447 | |
241 |
The Fortinet Security Fabric brings together the concepts of convergence and consolidation to provide comprehensive cybersecurity protection for all users, devices, and applications and across all network edges.
Copyright 2025 Fortinet, Inc. All Rights Reserved.