Skip to main content
Problem Solver I
March 5, 2023
Solved

Authentication Problem for new API, i am using correct api

  • March 5, 2023
  • 4 replies
  • 2554 views

{
  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

 

    This topic has been closed for replies.
    Best answer by ankitdew05

    correct authentication is 

     

    4 replies

    ankitdew05AuthorAnswer
    Problem Solver I
    March 5, 2023

    correct authentication is 

     

    Contributor IV
    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
    Klaviyo Alum
    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

    Contributor I
    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