Hi,
pls check the bwlow code what we are using for to adda contact to a list(static).
// 52366813746765 is the contact id
$properties = [
“52366813746765”
];
$params = json_encode(
[
‘data’ => $properties
]
);
$curl = curl_init();
// 14912312 is static list id
curl_setopt_array($curl, array(
CURLOPT_URL => “https://api.hubapi.com/crm/v3/lists/14912312/memberships/add”,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => “”,
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => “POST”,
CURLOPT_POSTFIELDS => $params,
CURLOPT_HTTPHEADER => array(
“Authorization: Bearer xxxxxxxxxxxxxxxxxxxxx”,
“accept: application/json”,
“content-type: application/json”
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
i am getting empty response pls check once.