- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
getNetworkEvents working example with curl
I've been trying to use this endpoint but haven't had any success. I wonder if someone might share a working example executed with curl.
Solved! Go to solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
On your Authorization Bearer, are you perhaps missing an apostrophe? Or is that just a result of the anonymisation?
Like what you see? - Give a Kudo ## Did it answer your question? - Mark it as a Solution 🙂
All code examples are provided as is. Responsibility for Code execution lies solely your own.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Here is an example:
curl -L -H 'X-Cisco-Meraki-API-Key: <Your-API-Key>' -X GET -H 'Content-Type: application/json' 'https://api.meraki.com/api/v1/networks/<Your-Network-ID>/events'
Please, if this post was useful, leave your kudos and mark it as solved.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In the API documentation there is also an example of curl code.
Get Network Events - Meraki Dashboard API v1 - Cisco Meraki Developer Hub
Please, if this post was useful, leave your kudos and mark it as solved.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I literally copied the curl command from this page, and followed the same process as I usually to to test endpoints. I copy the curl example, swap-out my API key and put single quotes around the call. I'm used to the API providing a useful error message, but in this case I get nothing.
https://developer.cisco.com/meraki/api-v1/get-network-events/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The correct command.
curl -L -H 'X-Cisco-Meraki-API-Key: <Your-API-Key>' -X GET -H 'Content-Type: application/json' 'https://api.meraki.com/api/v1/networks/<Your-Network-ID>/events?productType=wireless'
You have to add the productType
Please, if this post was useful, leave your kudos and mark it as solved.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Copied directly from meraki.io - https://developer.cisco.com/meraki/api-v1/get-network-events/
Last login: Thu Mar 7 13:35:54 on ttys007
RHB@wopr ~ % curl -L --request GET \
--url 'https://api.meraki.com/api/v1/networks/xxxx/events?productType=appliance' \
--header 'Authorization: Bearer xxxx' \
--header 'Accept: application/json'
{"message":null,"pageStartAt":"2024-03-08T18:02:41.102375Z","pageEndAt":"2024-03-08T19:08:17.455765Z","events":[], ...}
Like what you see? - Give a Kudo ## Did it answer your question? - Mark it as a Solution 🙂
All code examples are provided as is. Responsibility for Code execution lies solely your own.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks so much. When I execute this for a network that I know has an appliance, this is what I get:
Last login: Fri Mar 8 13:50:23 on ttys000
patrick.rouse@RMT-PROUSE ~ % curl -L --request GET \
--url 'https://api.meraki.com/api/v1/networks/L_1234567890/events?productType=appliance' \
--header 'Authorization: Bearer 1234567890\
--header 'Accept: application/json'
patrick.rouse@RMT-PROUSE ~ %
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Have you tried the code that I sent to you?
Please, if this post was useful, leave your kudos and mark it as solved.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
On your Authorization Bearer, are you perhaps missing an apostrophe? Or is that just a result of the anonymisation?
Like what you see? - Give a Kudo ## Did it answer your question? - Mark it as a Solution 🙂
All code examples are provided as is. Responsibility for Code execution lies solely your own.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I think the post stripped that out. Here's a screenshot. No error message, just a null response. Could there be something a customer has to enable in the Dashboard that I could verify via the API?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I really can't say what's going on. Perhaps try adding "&perPage=1000" after "appliance" on the URL?
Like what you see? - Give a Kudo ## Did it answer your question? - Mark it as a Solution 🙂
All code examples are provided as is. Responsibility for Code execution lies solely your own.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ok, I got this working, but I don't know why the following command did not give me an incorrect API key response when I missed a character.
Thanks to all who helped.
