Technical Tip: How to fetch Interface IP address of managed FortiGates using FortiManager JSON API
- September 22, 2025
- 0 replies
- 1303 views
| Description | This article describes how to fetch IP address of a specific Interface from all managed FortiGates using FortiManager JSON API and Postman. |
| Scope | FortiManager, FortiGate, JSON API, Postman. |
| Solution | The FortiManager proxy API can be used to query interface information from multiple managed FortiGate devices simultaneously. This method is particularly useful in environments with a large number of FortiGates, where manual targeting is impractical.
Step 1: Retrieve Device Names from FortiManager: To obtain the list of all managed devices, the following API request can be used:
{ "method": "get", "params": [ { "url": "/dvmdb/device" } ], "session": "{{session}}", "verbose": 1, "id": 1 }
Using Postman, in the Scripts -> Post-res section of this request, JavaScript can be used to extract the 'name' field from each device in the response. Each name should be formatted as 'device/<Device_Name>' and stored in a collection variable (e.g., device_targets), which will be referenced in the subsequent API call.
Step 2: Fetch Interface Details Using Device List: With the device list prepared, the following API request can be used to query a specific interface (e.g., wan1) from all devices:
{ "id": "2", "method": "exec", "params": [ { "url": "sys/proxy/json", "data": { "target": {{device_targets}},
"action": "get", "resource": "/api/v2/cmdb/system/interface/{{DESIRED_INTERFACE}}" } } ], "session": "{{session}}" }
Notes:
The API response contains interface details for each specified device. To present a clean summary of the results, JavaScript can be used in the Scripts -> Post-res section of the request in Postman to extract and display the following fields under the Visualization tab:
Final output:
Related documents: Technical Tip: Using FortiManager API Fortinet Development Network (FNDN) - FortiGate Fortinet Development Network (FNDN) - FortiManager Technical Tip: How to run a proxy API call from FortiManager to a managed FortiGate |



