Hello, I want to add a contact with cURL but I am getting this error; Error Result: {"error_key":"unauthorized","error_message":"Unauthorized"}bool(true) Issue. My Code: $url = "https://api.cc.email/v3/contacts"; $ch = curl_init($url); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HTTPHEADER, array('accept'=>'application/json')); curl_setopt($ch, CURLOPT_HTTPHEADER, array('authorization'=>'Bearer {XXXXXX-XXXX-XXXX-XXXX-XXXXXXXX}')); curl_setopt($ch, CURLOPT_HTTPHEADER, array('cache-control'=>'no-cache')); curl_setopt($ch, CURLOPT_HTTPHEADER, array('content-type'=> 'application/json')); curl_setopt($ch, CURLOPT_POST, true); $data = array( '{ "email_address": {"address": "danipper@example.com","permission_to_send": "implicit"}, "first_name": "David", "last_name": "Nipper", "job_title": "Musician", "company_name": "Acme Corp.", "create_source": "Account", "birthday_month": 11, "birthday_day": 24, "anniversary": "2006-11-15", "steet_addresses":{ "kind":"home", "street": "123 Kashmir Valley Road", "city": "Chicago", "state": "Illinois", "country": "United States", } }'); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); //for debug only! curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); $resp = curl_exec($ch); curl_close($ch); var_dump($resp);
... View more