Header Problems with API v1

PaintTheNight
Here to help

Header Problems with API v1

The new API v1 requires a header of:

 

'Authorization: Bearer <key>'

 

With space inbetween "Bearer" and your unique key.

 

I'm trying to convert our Zabbix templates to support the new API but it's having issues with the space. I can get this working in postman so I know the issue lies with Zabbix.

I back the response:

 

{"errors":["Invalid API key"]}

 

Does anyone know anyway around this without raising a support ticket with Zabbix? I've tried using "%20" to escape a space but no luck.

 

4 REPLIES 4
DexterLaBora
Meraki Employee

Re: Header Problems with API v1

Try changing the Base URL to

https://api-meraki.com/api/v1

 

The new authentication in version 1 does not always play nice with redirects. This will be resolved when v1 is no longer in beta. 

PaintTheNight
Here to help

Re: Header Problems with API v1

This doesn't appear to be an issue with final release of v1 - was able to use "X-Cisco-Meraki-API-Key" to authenticate.

Yurii
Comes here often

Re: Header Problems with API v1

Hello PaintTheNight, I would like to ask if you could share the templates for zabbix, which you monitor Meraki from the cloud via API
I will be very grateful.

John-K
Meraki Employee

Re: Header Problems with API v1

X-Cisco-Meraki-API-Key will work as a header if you run into any issues with bearer tokens.

 

However, if you're seeing redirects on API v1, that might be interesting. What's the header response?

Welcome to the Meraki Community!
To start contributing, simply sign in with your Cisco account. If you don't yet have a Cisco account, you can sign up.