cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
15419
Views
2
Helpful
9
Replies

Unable to use API Key created - 404 Not Found

Craiegg
Community Member

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.

image.png

Would anyone have any suggestions as to what is going wrong here?

Thanks,
Craig.

1 Accepted Solution

Accepted Solutions

Philip D'Ath
Meraki Community All-Star
Meraki Community All-Star

Something like:

dashboard = meraki.DashboardAPI(
	api_key=MERAKI_API_KEY,
	base_url='https://api.meraki.cn/api/v1/',
	output_log=False,
	print_console=False
)

View solution in original post

9 Replies 9

Philip D'Ath
Meraki Community All-Star
Meraki Community All-Star

If it is a different API key, try regenerating the second API key.

BRUCE NEWTON
Level 11
Level 11

Basic I know, but is the API access enabled under the Organization Settings?

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.

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 NEWTON

The user has Full org access as shown below:

image.png


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

image.png

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 NEWTON

Thanks for the suggestion, changing it to :https://api.meraki.cn/ actually worked in postman!

image.png


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?

Philip D'Ath
Meraki Community All-Star
Meraki Community All-Star

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 NEWTON @Philip D'Ath ,

Thanks alot for all the suggestions and help, I was successfully able to achieve what I needed to!

Cheers!