Skip to main content
MartinJS
New Member
Jul 28, 2025 11:56 AM UTC
Solved

FortiOS API - virtual-wan/member missing interface string

Fortinet made a change to their FortiOS API get /api/v2/monitor/virtual-wan/members call from version 7.4.* onwards which changed the response. We're making this call to a device running 7.4.8 (via the FortiManager proxy but hopefully that shouldn't make a difference) and the response we're getting is missing the Interface string.

{
"result": [
{
"data": [
{
"response": {
"build": 2795,
"http_method": "GET",
"name": "members",
"path": "virtual-wan",
"results": [
{
"link": "up",
"rx_bandwidth": 17698,
"rx_bytes": 10694535825,
"state_changed": 1753381417,
"tx_bandwidth": 19306,
"tx_bytes": 2152017150
},

The documentation has a little red asterisk next to Interface, but no mention why or what it means:

 

https://fndn.fortinet.net/index.php?/fortiapi/1-fortios/5140/1/virtual-wan/

 

Does anyone have any ideas how we can make the interface string appear please?

MartinJS
MartinJSAnswer
New Member
Aug 1, 2025 6:54 AM UTC

Sorry it took a while for the post to appear but meanwhile we've solved this:

Here is the explanation:

 

When we make calls to that endpoint we use a set of filter parameters to make the API only return the fields that we want (we try to be good API citizens and be as efficient as we can be making API calls). 

 

With the older FortiOS API, the interface name is part of the JSON structure, so we didn't specify we wanted 'interface' back as part of the response, eg:

 

We send this:

 

    "resource": "/api/v2/monitor/virtual-wan/members?format=link|rx_bandwidth|rx_bytes|state_changed|tx_bandwidth|tx_bytes",

 

 

..and we got back this:

 

    },

                                "VPN2": {

                                    "link": "up",

                                    "rx_bandwidth": 5760,

                                    "rx_bytes": 540113826,

                                    "session": 4,

                                    "state_changed": 1753254017,

                                    "tx_bandwidth": 20668,

                                    "tx_bytes": 1362208182

                                },

 

With the newer FortiOS version, the response has changed and the interface name has moved to the body of the response, because we weren't explicitly selecting 'interface' in our filter, we didn't get it back:

 

    {

                                    "link": "up",

                                    "rx_bandwidth": 8507,

                                    "rx_bytes": 10329308034,

                                    "state_changed": 1752487770,

                                    "tx_bandwidth": 3465,

                                    "tx_bytes": 4164459580

                                },

 

...specify 'interface' in the filter, and...:

 

    {

                                    "interface": "WAN1",

                                    "link": "up",

                                    "rx_bandwidth": 9394,

                                    "rx_bytes": 10329379660,

                                    "state_changed": 1752487770,

                                    "tx_bandwidth": 3767,

                                    "tx_bytes": 4164494145

                                },

 

What a pain...

3 replies

Anthony_E
Staff
Staff
Aug 1, 2025 5:11 AM UTC

Hello Martin,


Thank you for using the Community Forum. I will seek to get you an answer or help. We will reply to this thread with an update as soon as possible.


Thanks,

Translate
Best Regards
MartinJS
MartinJSAuthorAnswer
New Member
Aug 1, 2025 6:54 AM UTC

Sorry it took a while for the post to appear but meanwhile we've solved this:

Here is the explanation:

 

When we make calls to that endpoint we use a set of filter parameters to make the API only return the fields that we want (we try to be good API citizens and be as efficient as we can be making API calls). 

 

With the older FortiOS API, the interface name is part of the JSON structure, so we didn't specify we wanted 'interface' back as part of the response, eg:

 

We send this:

 

    "resource": "/api/v2/monitor/virtual-wan/members?format=link|rx_bandwidth|rx_bytes|state_changed|tx_bandwidth|tx_bytes",

 

 

..and we got back this:

 

    },

                                "VPN2": {

                                    "link": "up",

                                    "rx_bandwidth": 5760,

                                    "rx_bytes": 540113826,

                                    "session": 4,

                                    "state_changed": 1753254017,

                                    "tx_bandwidth": 20668,

                                    "tx_bytes": 1362208182

                                },

 

With the newer FortiOS version, the response has changed and the interface name has moved to the body of the response, because we weren't explicitly selecting 'interface' in our filter, we didn't get it back:

 

    {

                                    "link": "up",

                                    "rx_bandwidth": 8507,

                                    "rx_bytes": 10329308034,

                                    "state_changed": 1752487770,

                                    "tx_bandwidth": 3465,

                                    "tx_bytes": 4164459580

                                },

 

...specify 'interface' in the filter, and...:

 

    {

                                    "interface": "WAN1",

                                    "link": "up",

                                    "rx_bandwidth": 9394,

                                    "rx_bytes": 10329379660,

                                    "state_changed": 1752487770,

                                    "tx_bandwidth": 3767,

                                    "tx_bytes": 4164494145

                                },

 

What a pain...

Translate
Anthony_E
Staff
Staff
Aug 1, 2025 6:56 AM UTC

Thank you for sharing the solution Martin :)

Translate
Best Regards
Risk and Resilience in the Age of AI. An OT Thought Leadership Summit for Houston's Critical Infrastructure Leaders. Date: Thursday, December 3, 2026. Time: 8:30 am - 1:30 pm (CT). Location: The Westin Houston, Memorial City | 945 Gessner Road, Houston, TX 77024