02-08-2021 03:45 PM
Hello all,
I work for an MSP and we currently have 2 dashboards for our clients : Dashboard 1 ( 50 + Orgs ) , Dashboard 2 ( 2 clients ). I have created the API keys for both clients atleast a week ago
For dashboard one, I was able to create and successfully use the API key without any issue.
However with dashboard 2 , I have created the API key but I receive 404 error on using via Postman and even via the Python SDK.
I have added the API key in postman as well as the Python dashboard call.
Would anyone have any suggestions as to what is going wrong here?
Thanks,
Craig.
Solved! Go to Solution.
02-09-2021 10:09 AM
Something like:
dashboard = meraki.DashboardAPI(
api_key=MERAKI_API_KEY,
base_url='https://api.meraki.cn/api/v1/',
output_log=False,
print_console=False
)
02-08-2021 06:04 PM
If it is a different API key, try regenerating the second API key.
02-08-2021 09:38 PM
Basic I know, but is the API access enabled under the Organization Settings?
02-09-2021 01:30 AM
Hi @BRUCE NEWTON and @Philip D'Ath ,
API access is enabled from the Organization Settings.
I've also tried regenerating a new API key in Dashboard 2.
Both don't work, one throws 404 and the other 401!
Looking at the error codes it's due to invalid api key, but it's exactly the same as what is provided during creation.
Anything else you'd recommend to check? Bit of an odd one as I've been using the API for Dashboard one since a few months now.
02-09-2021 01:59 AM
Really scratching for ideas here. The API key is associated with a user, make sure that the user has the appropriate permissions to the organisations.
02-09-2021 03:13 AM
Hey @BRUCE NEWTON
The user has Full org access as shown below:
Another thing that I may have forgot to mention is Dashboard 1 is https://n63.meraki.com , while dashboard 2 is https://n3.meraki.cn/
Would that be causing a problem? I dont think this should cause any error though cause Im hitting the endpoint of https://api.meraki.com/api/v0/organizations
Additionally, here is a screengrab of my python script
02-09-2021 03:35 AM
I’ve just spotted that one of your Dashboard’s appears to be in China (.cn), I betting this is the issue. The is a certain amount of separation between the Meraki organisations hosted in China and those hosted elsewhere in the world... for Dashboard 2, the China hosted organisations you need to use api.meraki.cn for the API endpoints.
02-09-2021 03:44 AM
Hey @BRUCE NEWTON
Thanks for the suggestion, changing it to :https://api.meraki.cn/ actually worked in postman!
For the second part of this, how do I get this working with the Python SDK, as that still throws me the 404 error? Would I have to use the Python Requests module in this case or are you aware of a workaround using the Python SDK?
02-09-2021 10:09 AM
Something like:
dashboard = meraki.DashboardAPI(
api_key=MERAKI_API_KEY,
base_url='https://api.meraki.cn/api/v1/',
output_log=False,
print_console=False
)
02-09-2021 03:56 PM
@BRUCE NEWTON @Philip D'Ath ,
Thanks alot for all the suggestions and help, I was successfully able to achieve what I needed to!
Cheers!
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide