Hi, New to API's and coding in general. I am trying to write a script that adds a new firewall rule to a network (I'm using a test site atm). However I am getting a 404 error which I assume means my URL is wrong? I got this from the Meraki reference guide but I'm not sure its correct. /networks/{network_id}/appliance/firewall/l3firewallRules Also - I read somewhere that adding a new rule would overwrite all the existing rules! Is that true and if so is there a way to add a rule so that it doesn't effect any existing rules? Thanks! import requests import security import json api_key = security.MERAKI_API_KEY organizationId = security.ORG_ID network_id = "xxxxxxxxx" rule = { 'name': 'Test Rule', 'policy': 'deny', 'protocol': 'any', 'srcPort': 'any', 'srcCidr': '1.1.1.1/24', 'dstPort': 'any', 'dstCidr': '0.0.0.0/0', } url = f"https://api.meraki.com/api/v1/networks/{network_id}/appliance/firewall/l3firewallRules" headers = { 'X-Cisco-Meraki-API-Key': api_key, 'Content-Type': 'application/json' } response = requests.post(url, headers=headers, data=json.dumps(rule), verify=False) print(response.status_code)
... View more