Am I using the Dashboard API correctly?

Solved
Fridal
Here to help

Am I using the Dashboard API correctly?

Hi,

 

I am new to Meraki and to the Dashboard API. I am trying to ascertain whether I am using the Dashboard API correctly or not. I need to get the status of all access points and switches in an organization. Currently this is how I approach it:

 

  1. Request status for every device in the organization (API: https://api.meraki.com/api/v0/organizations/***/deviceStatuses).
  2. Iterate over each device and request additional device details (https://api.meraki.com/api/v0/networks/***/devices/***).
  3. Iterate over the device details, using the device's model name to group the devices into groups eg. all devices with a model name starting with "MR" belongs to the Access Point group, all devices starting with "MS" belongs to the switches group and so on.

 

I have two questions to the above approach:

 

  1. Is there a better way than getting all the devices via the deviceStatuses endpoint and then requesting each device's details? It results in a lot of requests and I am concerned that I will quickly reach the API's max request limit - 5 calls pr second.
  2. Is there a better way to identify a device type (eg access point, switch etc) other than looking at the device's model name?

 

Regards,

Bjørn

 

1 Accepted Solution
Bruce
Kind of a big deal

Once you've got your initial status of devices, if you are then looking for alerts on those devices you could look at using Webhooks (https://documentation.meraki.com/zGeneral_Administration/Other_Topics/Webhooks) so that you don't exceed the API rate limit - just depends on what the goal of your solution is.

View solution in original post

4 Replies 4
HodyCrouch
Building a reputation

In cases like this, your only option is to make a lot of separate API calls.  To avoid the API request limit, you can use a rate limiter.  For example, I sometimes use the throttled-request package with Node.js.

 

Remember that the rate limit applies at the organization level.  If you have any other integrations or tasks using the API, you need to consider the total usage.

 

Using the first two letters of the model to determine the device type seems good enough for now.

Fridal
Here to help

Hi,

Thanks for confirming my approach. I already have a throttler in mind, though the API rate limit still concerns me. I don't want to end up with a slow responding application.

Regards,
Bjørn
Bruce
Kind of a big deal

Once you've got your initial status of devices, if you are then looking for alerts on those devices you could look at using Webhooks (https://documentation.meraki.com/zGeneral_Administration/Other_Topics/Webhooks) so that you don't exceed the API rate limit - just depends on what the goal of your solution is.

Fridal
Here to help

Hi Bruce,

That's a good idea! I am building a dashboard that shows the status of certain Meraki devices. The dashboard should always stay open. so instead of requesting a new status for the devices every few minute, I might be able to use webhooks to report back if anything changes.

Regards,
Bjørn
Get notified when there are additional replies to this discussion.