The API GET/networks/{networkId}/traffic?timespan=7500 returns an empty array. I have a network with some clients and have traffic analysis and hostname visibility enabled a couple of days back. I see some data on the Traffic Analytics page on the UI but this API doesn't return anything. I tried with multiple timestamp values but no use. Any help in this matter would be appreciated.
Can you provide the complete code you're using? With API keys and Network ID's scrubbed of course.
As @jdsilva says, we really need to see your sanitized code.
Sometimes things like this are due to typos that you can't see yourself or something else missing. I recently wasted 45 minutes on something because I didn't realize I was using requests.put instead of requests.post, for instance. 🙂
Thanks for the quick response 🙂
I am trying this in postman. This is exact URL with method GET https://api.meraki.com/api/v0/networks/{networkID}/traffic?timespan=7200.
Headers:
X-Cisco-Meraki-API-Key : {key}
Content-Type : "application/json".
and response.
[]
Okay, when I test that one out, I get back:
Yes, the status is 200, I enabled the traffic analysis and hostname visibility. So was wondering if there is a min threshold data needed for the API to show some response? because I see some data in the UI (unless the corresponding APIs are different)