Solved

Unable to add members to LIST through API using Go

  • 25 January 2022
  • 1 reply
  • 176 views

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

icon

Best answer by Dov 25 January 2022, 23:48

View original

1 reply

Userlevel 7
Badge +61

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? 

Reply