Skip to main content
Solved

Authentication Problem for new API, i am using correct api


Forum|alt.badge.img+1

{
  errors: [
    {
      id: 'de016172-6f39-4cf6-b4f7-a0163fbc7301',
      status: 401,
      code: 'not_authenticated',
      title: 'Authentication credentials were not provided.',
      detail: 'Missing or invalid authorization scheme. Please use Klaviyo-API-Key.',
      source: [Object]
    }
  ]
}

 

i am using correct api to be specific but i do not why i am failing authentication

used this code

 

Best answer by ankitdew05

correct authentication is 

 

View original
Did this topic or the replies in the thread help you find an answer to your question?

4 replies

Forum|alt.badge.img+1
  • Author
  • Problem Solver I
  • 3 replies
  • Answer
  • March 5, 2023

correct authentication is 

 


Forum|alt.badge.img+2
  • Contributor IV
  • 8 replies
  • August 2, 2023

Hello, i’m trying to do like the example here : https://developers.klaviyo.com/en/reference/create_profile

But i always get a 401 even if i send my authorization like above. See my screenshot

 

 


Brian Turcotte
Forum|alt.badge.img+37

Hi @bproulx!

There’s essentially 3 likely causes of this issue, if you are certain the authentication statement is correctly formatted:

  1. There’s a typo in the private API key.
  2. The API key does not have the correct scope. (for example, READ permissions is not sufficient to create a profile)
  3. If you are trying to make a server-side request (like Create Profile) on the client-side, which would elicit a CORS error. For client-side requests, you could use this endpoint instead:

 

Best,

Brian


  • Contributor I
  • 1 reply
  • April 17, 2024

in klaviyo oauth2 authentication when request for token its give error "{     "error": "invalid_request",     "error_description": "Missing \"code\" in request." }" , but i put code in request