I got a solution myself. The issue was with the JSON string that I was supplying in API. I am sharing the correct way to insert contact in a particular list. $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => "https://api.cc.email/v3/contacts", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => '{"email_address": {"address": "YOUR_EMAIL","permission_to_send": "implicit"},"first_name":"NAME_OF_THE_USER","create_source": "Account","list_memberships": ["LIST_ID"]}', CURLOPT_HTTPHEADER => array( 'authorization: Bearer ADD_TOKEN_HERE', "content-type: application/json", "cache-control: no-cache", "accept: application/json" ), )); $response = curl_exec($curl); curl_close($curl);
... View more