Solved

Authentication Problem for new API, i am using correct api

  • 5 March 2023
  • 4 replies
  • 1210 views

Userlevel 1
Badge +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

 

icon

Best answer by ankitdew05 5 March 2023, 10:43

View original

4 replies

Userlevel 1
Badge +1

correct authentication is 

 

Badge +1

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

 

 

Userlevel 7
Badge +36

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

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

 

Reply