v7.1.5 - Rest API - SFP TX/RX Power

I am trying to retrieve the current sfp-tx-power and sfp-rx-power from the rest api, and struggling to get the correct syntax.

From the console I can get it data at /interface ethernet monitor sfp-sfpplus1

I thought it would be something like this, but I get am “unknown parameter interface” error back.

POST “https://10.11.12.114/rest/interface/ethernet/monitor” with a body of {“interface”:“sfp-sfpplus1”,“duration”:“1s”}

Would welcome any pointers!

Thanks!

Just asking again if anyone could point me in the right direction?

Thanks!

Look at the equivalent command in the CLI, API and CLI parameter names are identical, so there is no “interface” parameter just as the error says.

Most likely you need to get the ID of the interface first and then use the “numbers” parameter