Skip to main content
Solved

Unable to add members to LIST through API using Go

  • January 25, 2022
  • 1 reply
  • 210 views

Forum|alt.badge.img+2

I am unable to add members to List using the following code, 

 

https://developers.klaviyo.com/en/reference/add-members

 

I used payload as, -d '{"profiles": [{"email": "george.washington@klaviyo.com"}]}'

I am using right right LIST_ID and API key, but still it is complaining like this,

 

<h2>Sorry, that page isn't actually here.</h2>

 

  <p>The address you asked for didn't work for some reason. Here are some possible reasons why:</p>

  <ol>

    <li>We have a bad link and you were unlucky enough to click it.</li>

    <li>You may have typed the page address incorrectly.</li>

    <li>This web server is bonkers right now.</li>

  </ol>

Best answer by Dov

Hi @ragch577,

Thanks for sharing this with our community.

First, can you ensure you are using your private API key for this request?

Also, make sure that you're specifying the content type in your API call. If you're sending Klaviyo data, this will be a POST request. Also, please ensure that you are specifying the payload as JSON in the header.

Here's an example curl request using the V2 Lists API members endpoint:

curl -X POST \
  https://a.klaviyo.com/api/v2/list/LISTID/members \
  -H 'Content-Type: application/json' \
  -d '{
 "api_key": "private_key",
 "profiles": [
  {

      "email":"testing@yahoo.com"



  }

 ]

}'

If you’re still having trouble, can you send over the full payload (redacting all sensitive information including your API key, email address and phone number) and any additional errors you are seeing? 

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

1 reply

Dov
Forum|alt.badge.img+61
  • Klaviyo Alum
  • 1493 replies
  • Answer
  • January 25, 2022

Hi @ragch577,

Thanks for sharing this with our community.

First, can you ensure you are using your private API key for this request?

Also, make sure that you're specifying the content type in your API call. If you're sending Klaviyo data, this will be a POST request. Also, please ensure that you are specifying the payload as JSON in the header.

Here's an example curl request using the V2 Lists API members endpoint:

curl -X POST \
  https://a.klaviyo.com/api/v2/list/LISTID/members \
  -H 'Content-Type: application/json' \
  -d '{
 "api_key": "private_key",
 "profiles": [
  {

      "email":"testing@yahoo.com"



  }

 ]

}'

If you’re still having trouble, can you send over the full payload (redacting all sensitive information including your API key, email address and phone number) and any additional errors you are seeing?