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:
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:
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.
Is there a better way to identify a device type (eg access point, switch etc) other than looking at the device's model name?
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.
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.