Hi All,
This piece of code works:
apiURL='https://api.meraki.com'
apiRessourcepath='/api/v1/networks/'+str(networkID)+'/devices'
myheaders={'X-Cisco-Meraki-API-Key' : main.myAPIKEY}
response = requests.request("GET",apiURL+apiRessourcepath,headers=myheaders)
myresponse = response.json()
but this one retrieves an error 404:
apiURL='https://api.meraki.com'
apiRessourcepath='/api/v1/networks/'+str(networkID)+'/vlans'
myheaders={'X-Cisco-Meraki-API-Key' : main.myAPIKEY}
print(apiURL+apiRessourcepath)
response = requests.request("GET",apiURL+apiRessourcepath,headers=myheaders)
Do you have an idea why? it is written in python. same api-key, same network ID value, etc. Only the endpoint ressource changes.
Happy to get any clue.
Regards
Adrien
Solved! Go to solution.
As far as I recall, there is no endpoint "/networks/{networkID}/vlans"
Perhaps you are looking for this one? https://developer.cisco.com/meraki/api-v1/#!get-network-appliance-vlans
That endpoint is
/networks/{networkId}/appliance/vlans
So in your case the code would be;
apiURL='https://api.meraki.com'
apiRessourcepath='/api/v1/networks/'+str(networkID)+'/appliance/vlans'
myheaders={'X-Cisco-Meraki-API-Key' : main.myAPIKEY}
print(apiURL+apiRessourcepath)
response = requests.request("GET",apiURL+apiRessourcepath,headers=myheaders)
Hi ,
Is there a MX in that network ? Is it configured in routed mode ?
there are at least two MX. I don't know if they are in routed mode. I can ask
Yes, they are in routed mode, as per template
As far as I recall, there is no endpoint "/networks/{networkID}/vlans"
Perhaps you are looking for this one? https://developer.cisco.com/meraki/api-v1/#!get-network-appliance-vlans
That endpoint is
/networks/{networkId}/appliance/vlans
So in your case the code would be;
apiURL='https://api.meraki.com'
apiRessourcepath='/api/v1/networks/'+str(networkID)+'/appliance/vlans'
myheaders={'X-Cisco-Meraki-API-Key' : main.myAPIKEY}
print(apiURL+apiRessourcepath)
response = requests.request("GET",apiURL+apiRessourcepath,headers=myheaders)
According to https://api.meraki.com/api/v0/openapiSpec , the endpoint should be available.unless I missed something important.
I'll try your proposal, but I need to find out the answer to the previous question of Raphael
You shouldn't use v0 it is deprecated.
😮I think Cisco should update the link here: https://developer.cisco.com/meraki/api-v1/#!sdks-overview then!!!! thanks for the hint.
it worked. Thank you!