Here is a sample PHP script I made to be bare-bones simple. Whenever I execute it, I get a "Invalid value passed for JSONString".
I know I'm missing something crazy simple. Please let me know. Sample code below.
<?php
$zohoauthtoken = "XXXXXXXXXXXXXXXXXXXXXXXXXX";
$zohoorgid = "XXXXXXXXX";
$json_string = '{
"contact_name": "test123",
}';
$post = array(
'JSONString' => $json_string,
);
$headers = array(
'Authorization' => "Zoho-authtoken $zohoauthtoken",
'Content-Type' => "application/json;charset=UTF-8",
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_URL, $url);
$results = curl_exec($ch);
curl_close($ch);
error_log($results);
?>