Aug 13 2018
10:24 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Aug 13 2018
10:24 AM
API returning 404
I'm new to using the API and Python. I'm trying to learn how to just print the output of devices in a network. I keep getting a 404 and I feel like I need to pass an orgId. I've tried doing that in the headers but it didn't work. The reason why I thought I had to pass an orgId is because I have access to other organizations from my dashboard.
import requests api_key = 'xxxx' org_id = 'xxxx' network_id = 'xxxx' base_url = 'https://dashboard.meraki.com/api/v0' headers = "X-Cisco-Meraki-API-key: api_key" def devicelist(api_key, network_id): geturl = "{0}/networks/{1}/devices".format(str(base_url), str(network_id)) headers = { 'X-Cixco-Meraki-API-key': format(str(api_key)), 'Content-Type': 'application/json' } devices = requests.get(geturl, headers=headers) print(devices) devicelist(api_key, network_id)
CWNE #210
Co-host of Clear To Send Wi-Fi Podcast - http://cleartosend.net
Co-host of Clear To Send Wi-Fi Podcast - http://cleartosend.net
Solved! Go to solution.
Labels:
- Labels:
-
Dashboard API
1 Accepted Solution
Aug 13 2018
12:03 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Aug 13 2018
12:03 PM
My typo was in the header. Instead of X-Cisco-Meraki-API-key I had Cisco typed out as Cixco.
Took me long enough to see it!
CWNE #210
Co-host of Clear To Send Wi-Fi Podcast - http://cleartosend.net
Co-host of Clear To Send Wi-Fi Podcast - http://cleartosend.net
3 Replies 3
Aug 13 2018
10:32 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Aug 13 2018
10:32 AM
Hah. Figured out my own problem. Type in X-Cisco-Meraki-API-key.
Doh!
Doh!
CWNE #210
Co-host of Clear To Send Wi-Fi Podcast - http://cleartosend.net
Co-host of Clear To Send Wi-Fi Podcast - http://cleartosend.net
Aug 13 2018
11:58 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Aug 13 2018
11:58 AM
As you typed that I was thinking the same thing. api_key should have been xxxxx indicating your API key 😉
Adam R MS | CISSP, CISM, VCP, MCITP, CCNP, ITILv3, CMNO
If this was helpful click the Kudo button below
If my reply solved your issue, please mark it as a solution.
If this was helpful click the Kudo button below
If my reply solved your issue, please mark it as a solution.
Aug 13 2018
12:03 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Aug 13 2018
12:03 PM
My typo was in the header. Instead of X-Cisco-Meraki-API-key I had Cisco typed out as Cixco.
Took me long enough to see it!
CWNE #210
Co-host of Clear To Send Wi-Fi Podcast - http://cleartosend.net
Co-host of Clear To Send Wi-Fi Podcast - http://cleartosend.net

Get notified when there are additional replies to this discussion.