Solved

Create Event API call 401 error

  • 30 November 2022
  • 5 replies
  • 1111 views

Badge +1

I’m trying to get the create event api working but as soon as I send a request, it gives me a 401 error with a message saying Authentication credentials were not provided. details: missing or invalid authorization scheme. Please use Klaviyo-API-Key. So I have the private key set up as PRIVATE_KEY and have been trying various different custom headers such as Authorization: PRIVATE_KEY and Authorization: Klaviyo-API-Key {{PRIVATE_KEY}}. But, it seems nothing is working. I have also added revision:”string” but still nothing. Any suggestions as to what I should be doing? 

 

icon

Best answer by Brian Turcotte 1 December 2022, 21:43

View original

5 replies

Userlevel 7
Badge +36

Hi @Esalvador13 and welcome to the Community!

 

The correct syntax should be 'Authorization: Klaviyo-API-Key your-private-api-key', where you’d substitute your-private-api-key for the API Key you can generate from Settings > API Keys:
 

Just to clarify the issue, can you confirm that you’re making sure to substitute the Private Key here and not the Public Key?

 

Thanks,

-Brian

Userlevel 1
Badge +2

Tips are given below-

Look for Errors in the URL.
Clear Your Browser's Cache.
Flush Your DNS.
Deactivate Your WordPress Plugins.
Check the WWW-Authenticate Header Response.

 

Regards,

Rachel Gomez

Userlevel 1
Badge +1

I am facing the same problem, how to solve it using the private key only

Badge

Hi @Esalvador13 and welcome to the Community!

 

The correct syntax should be 'Authorization: Klaviyo-API-Key your-private-api-key', where you’d substitute your-private-api-key for the API Key you can generate from Settings > API Keys:
 

Just to clarify the issue, can you confirm that you’re making sure to substitute the Private Key here and not the Public Key?

 

Thanks,

-Brian

Hi @Brian Turcotte, for the new events API, can we make it work with public key or is it compulsary that we need private key in order to send events?

Userlevel 7
Badge +36

Hi @manojkannekanti1!

 

Public API keys cannot be used to access any account data, so you would have to use a private API key in order to create events. Public API Keys are only used to track people and events in client-side JavaScript code.

 

Hope this helps!

- Brian

Reply