<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Update Layer 7 Firewall rules in Network Platform API</title>
    <link>https://community.cisco.com/t5/network-platform-api/update-layer-7-firewall-rules/m-p/5432475#M5250</link>
    <description>&lt;P&gt;I'm having the same issue with the same error as reported by &lt;A href="https://community.meraki.com/t5/user/viewprofilepage/user-id/29599"&gt;@richardbrady194924&lt;/A&gt; &lt;/P&gt;&lt;P&gt;When I go to update L7 rules using the &lt;SPAN&gt;updateNetworkApplianceFirewallL7FirewallRules&lt;/SPAN&gt;, I get:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;{"errors":["The \"rules\" parameter must be an array of hashes (each representing a firewall rule)"]}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;But, the format I'm sending is exactly what is provided by the getNetworkApplianceFirewallL7FirewallRules api.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;What am I doing wrong?&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 26 Jan 2026 22:01:52 GMT</pubDate>
    <dc:creator>BElias</dc:creator>
    <dc:date>2026-01-26T22:01:52Z</dc:date>
    <item>
      <title>Update Layer 7 Firewall rules</title>
      <link>https://community.cisco.com/t5/network-platform-api/update-layer-7-firewall-rules/m-p/5432472#M5247</link>
      <description>&lt;P&gt;Hi, I'm trying to add to the layer 7 rules via the updateNetworkApplianceFirewallL7FirewallRules api. As I understand it, I cannot just add a new rule, I have to read in the existing rules and then add my rule and send the whole lot back. I've got to the point where I have the existing and new rule as variables and have combined them. When I try to update the rules, I get the error: 400 Bad Request, {'errors': ['The "rules" parameter must be an array of hashes (each representing a firewall rule)']}&lt;/P&gt;&lt;P&gt;This is new rules variable I'm trying to send:&lt;/P&gt;&lt;P&gt;print (l7fw_rules)&lt;BR /&gt;{'rules': [{'policy': 'deny', 'type': 'application', 'value': {'id': 'meraki:layer7/application/101', 'name': 'CBS Sports'}}, {'policy': 'deny', 'type': 'application', 'value': {'id': 'meraki:layer7/application/40', 'name': 'ESPN'}}, {'policy': 'deny', 'type': 'application', 'value': {'id': 'meraki:layer7/application/96', 'name': 'foxsports.com'}}]}&lt;/P&gt;&lt;P&gt;going round in circles now so any help would be appreciated.&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;</description>
      <pubDate>Wed, 15 Mar 2023 20:18:24 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/update-layer-7-firewall-rules/m-p/5432472#M5247</guid>
      <dc:creator>richardbrady194924</dc:creator>
      <dc:date>2023-03-15T20:18:24Z</dc:date>
    </item>
    <item>
      <title>Re: Update Layer 7 Firewall rules</title>
      <link>https://community.cisco.com/t5/network-platform-api/update-layer-7-firewall-rules/m-p/5432473#M5248</link>
      <description>&lt;P&gt;Hello &lt;A href="https://community.meraki.com/t5/user/viewprofilepage/user-id/29599"&gt;@richardbrady194924&lt;/A&gt;,&lt;BR /&gt;&lt;BR /&gt;Are you talking about this endpoint : &lt;A href="https://developer.cisco.com/meraki/api-v1/#!get-network-appliance-firewall-l-7-firewall-rules" target="_blank" rel="noopener nofollow noreferrer"&gt;https://developer.cisco.com/meraki/api-v1/#!get-network-appliance-firewall-l-7-firewall-rules&lt;/A&gt; ?&lt;/P&gt;&lt;P&gt;If yes, here is a working script using your payload (note the &lt;EM&gt;&lt;STRONG&gt;json.dumps()&lt;/STRONG&gt; &lt;/EM&gt;for the payload):&lt;/P&gt;&lt;H2 id="toc-hId-1623579616"&gt;Code&lt;/H2&gt;&lt;PRE&gt;&lt;SPAN&gt;import&lt;/SPAN&gt; &lt;SPAN&gt;requests&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;import&lt;/SPAN&gt; &lt;SPAN&gt;json&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;import&lt;/SPAN&gt; &lt;SPAN&gt;yaml&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;&lt;SPAN&gt;# Open the config.yml file and load its contents into the 'config' variable&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;SPAN&gt;with&lt;/SPAN&gt; &lt;SPAN&gt;open&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'config.yml'&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;'r'&lt;/SPAN&gt;&lt;SPAN&gt;) &lt;/SPAN&gt;&lt;SPAN&gt;as&lt;/SPAN&gt; &lt;SPAN&gt;file&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;  config&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;FONT color="#333333"&gt;&lt;SPAN&gt;yaml&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;safe_load&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;file&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;&lt;SPAN&gt;# New rules to be created&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;SPAN&gt;newRules&lt;/SPAN&gt;&lt;SPAN&gt; = {&lt;/SPAN&gt;&lt;SPAN&gt;'rules'&lt;/SPAN&gt;&lt;SPAN&gt;: [{&lt;/SPAN&gt;&lt;SPAN&gt;'policy'&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;'deny'&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;'type'&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;'application'&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;'value'&lt;/SPAN&gt;&lt;SPAN&gt;: {&lt;/SPAN&gt;&lt;SPAN&gt;'id'&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;'meraki:layer7/application/101'&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;'name'&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;'CBS Sports'&lt;/SPAN&gt;&lt;SPAN&gt;}}, {&lt;/SPAN&gt;&lt;SPAN&gt;'policy'&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;'deny'&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;'type'&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;'application'&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;'value'&lt;/SPAN&gt;&lt;SPAN&gt;: {&lt;/SPAN&gt;&lt;SPAN&gt;'id'&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;'meraki:layer7/application/40'&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;'name'&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;'ESPN'&lt;/SPAN&gt;&lt;SPAN&gt;}}, {&lt;/SPAN&gt;&lt;SPAN&gt;'policy'&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;'deny'&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;'type'&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;'application'&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;'value'&lt;/SPAN&gt;&lt;SPAN&gt;: {&lt;/SPAN&gt;&lt;SPAN&gt;'id'&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;'meraki:layer7/application/96'&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;'name'&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;'foxsports.com'&lt;/SPAN&gt;&lt;SPAN&gt;}}]}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;&lt;SPAN&gt;# Create the URL for retrieving all VLANs in the network&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;SPAN&gt;url&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;f&lt;/SPAN&gt;&lt;SPAN&gt;"https://api.meraki.com/api/v1/networks/&lt;/SPAN&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;SPAN&gt;config&lt;/SPAN&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;SPAN&gt;'networkId'&lt;/SPAN&gt;&lt;SPAN&gt;]&lt;/SPAN&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;SPAN&gt;/appliance/firewall/l7FirewallRules"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;&lt;SPAN&gt;# Set the HTTP headers&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;SPAN&gt;headers&lt;/SPAN&gt;&lt;SPAN&gt; = {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;  "Content-Type"&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;"application/json"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;  "Accept"&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;"application/json"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;  "X-Cisco-Meraki-API-Key"&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;config&lt;/SPAN&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;SPAN&gt;"apiKey"&lt;/SPAN&gt;&lt;SPAN&gt;]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;&lt;SPAN&gt;# Make the API request using the requests library&lt;BR /&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN&gt;response&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;requests&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;request&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"PUT"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;url&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;headers&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;headers&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;data&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;STRONG&gt;json.dumps(&lt;/STRONG&gt;&lt;SPAN&gt;newRules&lt;/SPAN&gt;&lt;SPAN&gt;&lt;STRONG&gt;)&lt;/STRONG&gt;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;&lt;SPAN&gt;# Print the status code of the response&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;SPAN&gt;print&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;\n&lt;/SPAN&gt;&lt;SPAN&gt;Request status code : "&lt;/SPAN&gt;&lt;SPAN&gt;+&lt;/SPAN&gt;&lt;SPAN&gt;str&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;response&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;status_code&lt;/SPAN&gt;&lt;SPAN&gt;), &lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;\n&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;&lt;SPAN&gt;# Parse the response as JSON&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;SPAN&gt;responseJson&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;response&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;json&lt;/SPAN&gt;&lt;SPAN&gt;()&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;print&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;responseJson&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/PRE&gt;&lt;H2 id="toc-hId--928577345"&gt;Ouptut&lt;/H2&gt;&lt;PRE&gt;&lt;SPAN&gt;Request status code : 200 &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;{'rules': [{'policy': 'deny', 'type': 'application', 'value': {'id': 'meraki:layer7/application/101', 'name': 'CBS Sports'}}, {'policy': 'deny', 'type': 'application', 'value': {'id': 'meraki:layer7/application/40', 'name': 'ESPN'}}, {'policy': 'deny', 'type': 'application', 'value': {'id': 'meraki:layer7/application/96', 'name': 'foxsports.com'}}]}&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;Indeed, it removed the existing rules :&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="xaviervalette_0-1678956787439.png" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="image.png"&gt;&lt;img src="https://community.cisco.com/t5/image/serverpage/image-id/262993iEA0676E7472DECEB/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;You can find everything on the following repo: &lt;A href="https://github.com/xaviervalette/meraki-update-l7-firewall-rules" target="_blank" rel="noopener nofollow noreferrer"&gt;https://github.com/xaviervalette/meraki-update-l7-firewall-rules&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;Hope it helps! &lt;SPAN class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Mar 2023 08:57:17 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/update-layer-7-firewall-rules/m-p/5432473#M5248</guid>
      <dc:creator>xvalette</dc:creator>
      <dc:date>2023-03-16T08:57:17Z</dc:date>
    </item>
    <item>
      <title>Re: Update Layer 7 Firewall rules</title>
      <link>https://community.cisco.com/t5/network-platform-api/update-layer-7-firewall-rules/m-p/5432474#M5249</link>
      <description>&lt;P&gt;Hi &lt;A href="https://community.meraki.com/t5/user/viewprofilepage/user-id/77653"&gt;@xvalette&lt;/A&gt;, thank you for taking the time to reply and for your help. Although not exactly what I was looking for, this has helped me greatly by expanding my knowledge of using the requests library rather than the meraki library which is what I was using before. I'm a python beginner so have learned a lot by trial and erro and I've now got some working code.&lt;/P&gt;&lt;P&gt;Cheers.&lt;/P&gt;</description>
      <pubDate>Sat, 25 Mar 2023 13:57:04 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/update-layer-7-firewall-rules/m-p/5432474#M5249</guid>
      <dc:creator>richardbrady194924</dc:creator>
      <dc:date>2023-03-25T13:57:04Z</dc:date>
    </item>
    <item>
      <title>Re: Update Layer 7 Firewall rules</title>
      <link>https://community.cisco.com/t5/network-platform-api/update-layer-7-firewall-rules/m-p/5432475#M5250</link>
      <description>&lt;P&gt;I'm having the same issue with the same error as reported by &lt;A href="https://community.meraki.com/t5/user/viewprofilepage/user-id/29599"&gt;@richardbrady194924&lt;/A&gt; &lt;/P&gt;&lt;P&gt;When I go to update L7 rules using the &lt;SPAN&gt;updateNetworkApplianceFirewallL7FirewallRules&lt;/SPAN&gt;, I get:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;{"errors":["The \"rules\" parameter must be an array of hashes (each representing a firewall rule)"]}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;But, the format I'm sending is exactly what is provided by the getNetworkApplianceFirewallL7FirewallRules api.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;What am I doing wrong?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jan 2026 22:01:52 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/update-layer-7-firewall-rules/m-p/5432475#M5250</guid>
      <dc:creator>BElias</dc:creator>
      <dc:date>2026-01-26T22:01:52Z</dc:date>
    </item>
  </channel>
</rss>

