Hello, I am trying to get a list of vlan information (specifically looking for the fixed ip assignments) from all networks. Starting with trying to use API to get the info for a single vlan on a single network.
I am using the template from https://developer.cisco.com/meraki/api-v1/#!get-network-appliance-vlan using the Meraki Python Library.
My API key which has full access to the dashboard and is being used for several scripts that work. When I try the below I get a 401 error.
>>> import meraki
>>> API_KEY = '{MY_API_KEY deleted}'
>>> organization_id = '{MY ORG ID delteed}'
>>> dashboard = meraki.DashboardAPI(API_KEY)
>>> network_id = '{removed network ID}'
>>> vlan_id = '10'
>>> response = dashboard.appliance.getNetworkApplianceVlan(network_id, vlan_id)
2022-07-21 08:25:17 meraki: INFO > GET https://api.meraki.com/api/v1/networks/{removed network ID}/appliance/vlans/10
2022-07-21 08:25:18 meraki: ERROR > appliance, getNetworkApplianceVlan - 401 Unauthorized, {'errors': ['Invalid API key']}
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.9/site-packages/meraki/api/appliance.py", line 1369, in getNetworkApplianceVlan
return self._session.get(metadata, resource)
File "/usr/local/lib/python3.9/site-packages/meraki/rest_session.py", line 284, in get
response = self.request(metadata, 'GET', url, params=params)
File "/usr/local/lib/python3.9/site-packages/meraki/rest_session.py", line 278, in request
raise APIError(metadata, response)
meraki.exceptions.APIError: appliance, getNetworkApplianceVlan - 401 Unauthorized, {'errors': ['Invalid API key']}
>>>
With the same above If I use the below command, I can get a list of my networks...
>>>>networks = dashboard.organizations.getOrganizationNetworks(
... organization_id, total_pages='all')
>>>>print(networks)
So I know the API key is valid. What am I missing?