Also, this is not correct...
"startingAfter":startDate,
"endingBefore":endDate
These parameters are used by the pagination mechanism, you'll see that the documentation for the call says... "This parameter should not be defined by client applications."
https://developer.cisco.com/meraki/api-v1/get-network-events/
I just grab the results and filter out the ones that are out of the desired date range.
The endpoint can be fiddly to use, for instance check for a non-Null 'Message' element in the response, this may be used to signal that there are no matching events