Skip to main content
Solved

Version 2023-08-15

  • September 6, 2023
  • 1 reply
  • 75 views

Forum|alt.badge.img+3
  • Contributor III
  • 6 replies

Hi! I was using a klaviyo/sdk-php that is deprecated so I need now to change it for the new sdk klaviyo-api.
I’m following Klaviyo developers guide of the stable version 2023-08-15 and also I’m doing the klaviyo developer certification at the same time, (I though that would be helpful), but I’m looking some differences between docs and while following the steps, I found out that when I’m trying to make a test API request using POSTMAN I got a 404.

https://developers.klaviyo.com/en/docs/make_your_first_api_call

In this above page, section Test with Postman, I forked Klaviyo Postman Workspace, there is not a List & Segments as it says on this documentation, but I picked just list from the postman workspace.

In the picture on the same section, looks like the example filled up Params (for authorization) and Body/x-www-form-urlencoded (to create the list) and shows the
          POST {{baseUrl}}/v2/lists?api_key=PRIVATE_KEY
and suggest to Replace the PRIVATE_KEY value with a private API key from your account. But in the forked Postman workspace the 
          POST {{baseUrl}}/api/lists/

My question is how is the correct way to authorize the API call, I tried all the combinations using Params and also using Authorization type API Key.

Thank you!

Best answer by Brian Turcotte

Hi @veroca!

The link you provided above directs you to make an API call that creates a list, by using a CURl request imported into postman. In that example, the line that authorizes the call is:

--header 'Authorization: Klaviyo-API-Key your-private-api-key'

 

 - where you would replace your-private-api-key with your actual private API key. 

 

The first API call you referenced, POST {{baseUrl}}/v2/lists?api_key=PRIVATE_KEY, is a v2 (legacy) endpoint, where the authorization would appear in the URL of the call.

 

For the new V3 endpoints (including version 2023-08-15), the authorization line is no longer present in the URL, but rather as a header in the CURl request.

 

I hope that helps, and thanks for using the Community!

 

- Brian

 

View original

1 reply

Brian Turcotte
Forum|alt.badge.img+37
  • Klaviyo Alum
  • 1393 replies
  • Answer
  • September 7, 2023

Hi @veroca!

The link you provided above directs you to make an API call that creates a list, by using a CURl request imported into postman. In that example, the line that authorizes the call is:

--header 'Authorization: Klaviyo-API-Key your-private-api-key'

 

 - where you would replace your-private-api-key with your actual private API key. 

 

The first API call you referenced, POST {{baseUrl}}/v2/lists?api_key=PRIVATE_KEY, is a v2 (legacy) endpoint, where the authorization would appear in the URL of the call.

 

For the new V3 endpoints (including version 2023-08-15), the authorization line is no longer present in the URL, but rather as a header in the CURl request.

 

I hope that helps, and thanks for using the Community!

 

- Brian