Skip to main content
MartinJS
New Member
July 28, 2025
Solved

FortiOS API - virtual-wan/member missing interface string

  • July 28, 2025
  • 3 replies
  • 500 views
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?

Best answer by MartinJS

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
August 1, 2025

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,

Best Regards
MartinJS
MartinJSAuthorAnswer
New Member
August 1, 2025

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...

Anthony_E
Staff
Staff
August 1, 2025

Thank you for sharing the solution Martin :)

Best Regards
Thought Leadership Security Summit. Outpace New Threats with AI - enhanced defense. Tuesday, Septmeber 15, 8:30 AM - 2:30 PM PT. The Golf Club at Newcastle, WA.
Fortinet Flag the Hack. Wednesday, August 26, 9:00 AM - 5:00 PM ET, COSM, Atlanta, GA.