03-08-2024 10:59 AM
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.
03-08-2024 11:55 AM
On your Authorization Bearer, are you perhaps missing an apostrophe? Or is that just a result of the anonymisation?
03-08-2024 11:05 AM
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'
03-08-2024 11:09 AM
In the API documentation there is also an example of curl code.
Get Network Events - Meraki Dashboard API v1 - Cisco Meraki Developer Hub
03-08-2024 12:38 PM
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/
03-08-2024 12:40 PM
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
03-08-2024 11:10 AM
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":[], ...}
03-08-2024 11:39 AM
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 ~ %
03-08-2024 11:43 AM
Have you tried the code that I sent to you?
03-08-2024 11:55 AM
On your Authorization Bearer, are you perhaps missing an apostrophe? Or is that just a result of the anonymisation?
03-08-2024 12:04 PM
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?
03-08-2024 12:22 PM
I really can't say what's going on. Perhaps try adding "&perPage=1000" after "appliance" on the URL?
03-08-2024 12:50 PM
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.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide