Skip to main content
Solved

Add profile to a list API wrong response


Forum|alt.badge.img+1

Just lost 2 hours with your API for adding profiles to a list.

Writing api for adding profile to a list and whole morning getting “TypeError (no implicit conversion of nil into String)” …  What ever I do, at some point I check the lists online and see there were one profile added.

Please fix this, we need correct request response.

https://developers.klaviyo.com/en/reference/create_list_relationships
 75:       # payload = {
   76:       #   "data" => profiles_to_add
   77:       # }
   78:       # payload = {data: [profile('01H6J8KNW8PAKMGAPG79PMY1JZ')]}
   79:       payload = {"data":[{"type":"profile","id":"01H5SG79CA9F3BFHVDTMRH4DNN"}]}
   80:       byebug
=> 81:       call_api(Net::HTTP::Post, "lists/#{list_id}/relationships/profiles/", payload)
   82:     end
   83:   end
   84: end
(byebug) c
Traceback (most recent call last):
        3: from (irb):19
        2: from app/models/klaviyo/api.rb:81:in `add_profile_to_list'
        1: from app/models/klaviyo/api.rb:32:in `call_api'
TypeError (no implicit conversion of nil into String)

Best answer by Brian Turcotte

Hi @nezir!

 

I have reported this to our API team, but I was not able to reproduce this response when I test myself - is this still occurring for you?

 

Best,

Brian

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

2 replies

Brian Turcotte
Forum|alt.badge.img+37

Hi @nezir!

I’m going to check on this with our API team and I’ll update the thread as soon as possible!
 

Best,

Brian


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

Hi @nezir!

 

I have reported this to our API team, but I was not able to reproduce this response when I test myself - is this still occurring for you?

 

Best,

Brian