I am working with the Meraki API's to update switch port info. I can add a voiceVlan just fine. The issue is when I try to remove (blank out) an existing voiceVlan via the API.
I am not the first person with this issue: https://community.meraki.com/t5/Developers-APIs/which-parameters-in-an-API-call-are-required/m-p/61890/highlight/false#M1973
One person said it started working when he added: 'Content-Type':'application/json', but I already have that.
I believe I know what is wrong, but I do not know how to get past it.
The voiceVlan field is an integer field. If I feed it any integer it works. The new value is successfully updated.
In my .csv file that I feed to my Python program I am placing 'null'. I called Meraki support and they said they can't trouble shoot 'third party' (i.e., personal) programs, but they said they can update it via cURL using null.
In the PyCharm debugger I see this:
Notice how the voiceVlan shows an empty string even though my .csv file has null in that field.
Then, when I convert the dict to json (port_data = ) I see this:
voiceVlan is an empty string. That won't work, so that is my problem. 'enabled": true is correct and that is how it is in my .csv file. My issue, which I don't know how to resolve, is how do I get the voiceVlan value to be null instead of an empty string after I convert the dict to json?
The value in port_data for voiceVlan needs to be null, not an empty string.