API error: "6007: Malformed JSON in request body"

Title says about everything already, this is my curl:

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, ‘https://api.cloudflare.com/client/v4/zones/d603382fda9ad9225362f0c8b8713a71b/dns_records’);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, “{"type":"A","name":"proxy1","content":"$output1","ttl":1,"priority":10,"proxied":false}”);
curl_setopt($ch, CURLOPT_POST, 1);

$headers = array();
$headers = ‘X-Auth-Email: [email protected]’;
$headers = ‘X-Auth-Key: 5eba105546be96b2ays62fe93399f852ae9e8c4’;
$headers = ‘Content-Type: application/json’;
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$result = curl_exec($ch);
if (curl_errno($ch)) {
echo ‘Error:’ . curl_error($ch);
}
curl_close ($ch);
echo $result;

I use php btw :wink:

Your JSON string is malformed as API says. Before sending it to API endpoint, log it somewhere and check its validity to pinpoint the problem.

make sure your json is valid by using online validator tools like https://validatejson.com