Skip to main content
Solved

Authentication Problem for new API, i am using correct api

  • March 5, 2023
  • 4 replies
  • 2395 views

Forum|alt.badge.img+2

{
  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 

 

4 replies

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

correct authentication is 

 


Forum|alt.badge.img+3
  • 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
  • Klaviyo Alum
  • 1393 replies
  • August 10, 2023

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


Forum|alt.badge.img
  • 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