Hello Community.
I’m trying to use curl in Windows to add to a list.
So far I have this working in a bat file.
For windows I worked out that the url needs to be in double quotes and the double quotes in the data need to be escaped with a back slash.
d:\powerbas\Epos\curl.exe -o d:\powerbas\Epos\curl_test.txt -H "Content-Type: application/json" -X POST "https://a.klaviyo.com/api/v2/list/TcrZhw/members?api_key=pk_xxx" -d " { \"profiles\": : { \"email\": \"antonisklaviyo+test@gmail.com\" } ] } "
I want to include the title, first, last name, Organization and phone number. I tried to start with the organisation like this.
d:\powerbas\Epos\curl.exe -o d:\powerbas\Epos\curl_test.txt -H "Content-Type: application/json" -X POST "https://a.klaviyo.com/api/v2/list/TcrZhw/members?api_key=pk_xxxx" -d " { \"profiles\": " { \"email\": \"antonisklaviyo+test@gmail.com\" } , { \"organization\": \"klaviyo\" }] } "
Returns the following message
{"detail":"email or phone number is a required field for each profile"}