I can easily share the function that is taking the data and then making the API call. The whole program is pretty large. This where my coding problem was. You will be able to see where I am building the dictionary with the "rules" tag in the dictionary and then the conversion to a JSON string and the API call. If you have any question about this, let me know. def SetL3Rules(Id,ruleslist): # Copy the global header and add the content information. header = g_header header.update({'Content-Type':'application/json'}) url = g_baseURL+'networks/'+Id+'/l3FirewallRules' # Add the "rules" key to make a dictionary with the L3 rules as the data. L3rules = {'rules':ruleslist} # Convert the dictionary to JSON. This will replace False with false, True with true, and the ' with ". payload = json.dumps(L3rules) try: ret = requests.request("PUT", url, data=payload, headers=header) except requests.exceptions.ConnectionError: print('A connection error has occurred while writing the layer 3 information.') print('The layer 3 rules were NOT updated.\n') return None rules = ErrorCheck(ret) return rules
... View more