Hello,
I have used 2 different languages( merakiapi.py and c# ) to update the port configuration on a switch ( tags and vlan ) and although the return status is 200, the configuration is not changed. I am sending the following information:
PUT v0/devices/{serial-num-of-switch}/switchPorts/1
And the data I am sending is :
{
"vlan": 12,
"tags": "test"
}
Anything that I am missing to get this working?
Thanks in advance.
Update to issue. I was able to update the port configuration via postman... So wondering why my API apps are not working..
Are you certain that you're getting a 200 response? Some Meraki API calls will respond with a redirect. Not all libraries default to following redirects and some will even follow the redirect as a GET rather than a PUT or POST.
Do you want to share a bit of your python code (make sure to remove API key and any device serial numbers or network ids)?
Postman just uses the API so possibly a difference in the code/calls you are using? You can generate code from Postman to compare and verify.
I have discovered the issue the Content-Type was not set to 'application/json'.
Still does not explain why I get status 200 when Content-Type is set to 'text/plain'.
Thanks.
Hi Dear,
Please can you guide me how you have update switch port ? because i'm trying and it's not working
what i need to do is to shutdown port number 4 of my ms switch
when i put the serial number of my switch and the number (port number) 4 and then i add the key enabled: false ( so it shutdown) i get this error:
Sorry I am using c# controlling ports on the Meraki switch... So can't help you with specific python issues...
One question I do have have you supplied the Organization name to the Meraki python api?
Is this error coming from the SDK method, or from a raw JSON PUT/GET?
Hi there,
Here you have a small piece of python code i use to configure a switch .
Script set first port as an uplink and the last port as a Access Point
The rest of the ports will be Data/Voip