Hello Fortinet Community,
I’m currently working on automating firewall address object updates in FortiManager via the JSON RPC API. My goal is to programmatically add entries to the dynamic_mapping array of a firewall address object.
Here is the structure of the dynamic_mapping entry I am trying to add (simplified example):
{
"_scope": [
{
"name": "DeviceName",
"vdom": "root"
}
],
"allow-routing": 0,
"associated-interface": "any",
"clearpass-spt": 0,
"color": 0,
"dirty": 1,
"fabric-object": 0,
"node-ip-only": 0,
"obj-type": 9,
"route-tag": 0,
"subnet": [
"10.164.110.0",
"255.255.255.0"
],
"type": 0
}
Error i get:
{'code': -10, 'message': 'The data is invalid for selected url'}
Could anyone please advise what might be missing or incorrect in the payload format for dynamic_mapping? Are there any known quirks or additional required fields? Any examples of a working dynamic_mapping update via API would be greatly appreciated.
Thanks in advance for your help!
Its part of a script what checks automatic interfaces on fortigates and when a dynamic adress not exist he must add it to the object.
The solution was to use “add” instead of “update” when adding dynamic mappings to the address object via the API.
User | Count |
---|---|
2642 | |
1405 | |
810 | |
685 | |
455 |
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.