Can't modify MX L3 Firewall Rules

Kind of a big deal

Can't modify MX L3 Firewall Rules

What am I doing wrong?  I get a 404 returned.  The "networkid" is correct.  The apikey is correct.


headers = {
  'x-cisco-meraki-api-key': format(str(apikey)),
  'Content-Type': 'application/json'

puturl = '{0}/l3FirewallRules'.format(str(networkid))
dashboard = requests.put(puturl, data=json.dumps({"rules": [{"srcPort": "Any", "syslogEnabled": False, "policy": "deny", "comment": "Test", "destCidr": "", "srcCidr": "Any", "destPort": "80", "protocol": "tcp"}], "syslogDefaultRule": False}), headers=headers)

Building a reputation

Try adding /api/v0 in the url.


For example:


puturl = '{0}/l3FirewallRules'.format(str(networkid))


Also, make sure you're set to follow redirects when you make the request.  This endpoint redirects to the specific '' for your organization when you issue the request.

I feel like such a ditz now.  I spent hours on this on specific API call trying to figure it out.  I kept thinking a out the 404 response and that really should have been a bigger hint.


It is working now.


The documentation for the Python requests module has that it follows redirects automatically.

Get notified when there are additional replies to this discussion.
Welcome to the Meraki Community!
To start contributing, simply sign in with your Cisco account. If you don't yet have a Cisco account, you can sign up.