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)