I am attempting to write a script to pull events associated with non-meraki-vpns import requests def getNetworkAlerts(headers, networkId, startDate, endDate): # Define the URL url = (f"https://api.meraki.com/api/v1/networks/{networkId}/events") params = { "productType": "appliance", "includedEventTypes[]": "non_meraki_vpn", "startingAfter":startDate, "endingBefore":endDate } # what is actually being sent to meraki dashboard req = requests.Request('GET', url, headers=headers, params=params) prepared_request = req.prepare() print(f'The full url to be sent is: {prepared_request.url}') # Below in red is what requests builds. https://api.meraki.com/api/v1/networks/L_3895050727722058407/events?productType=appliance&includedEventTypes%5B%5D=non_meraki_vpn&startingAfter=2025-08-30+13%3A38%3A05.459567&endingBefore=2025-08-30+14%3A38%3A05.459567 # Send the GET request response = requests.get(url, headers=headers, params=params) status code 400 However, if I build the url manually and don't use the keyword params url = (f"https://api.meraki.com/api/v1/networks/{networkId}/events?productType=appliacnce&includeEventTypes[]=non_meraki_vpn&startingAfter=2025-08-30 13:52:56.146621&endingBefore=2025-08-30 14:52:56.146621') I don't get the error. But I can't encode varaiables directly into the url. Research suggests you do this by using the keyword params in the requests library Any more experienced coders out there got any advice please.
... View more