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.
Something like:
dashboard = meraki.DashboardAPI(
api_key=MERAKI_API_KEY,
base_url='https://api.meraki.cn/api/v1/',
output_log=False,
print_console=False
)
If it is a different API key, try regenerating the second API key.
Basic I know, but is the API access enabled under the Organization Settings?
Hi @Bruce and @PhilipDAth ,
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.
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.
Hey @Bruce
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
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.
Hey @Bruce
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?
Something like:
dashboard = meraki.DashboardAPI(
api_key=MERAKI_API_KEY,
base_url='https://api.meraki.cn/api/v1/',
output_log=False,
print_console=False
)
@Bruce @PhilipDAth ,
Thanks alot for all the suggestions and help, I was successfully able to achieve what I needed to!
Cheers!