HTTP ERROR 415 when creating ticket via api.

I am creating a ticket via new api and I keep recieving this error.

Problem accessing /crm/v3/objects/tickets. Reason: Unsupported Media Type

Here is my JSON String:

$data_JSON = "{
 'properties':
 {
 'hs_pipeline': '2081686',
 'hs_pipeline_stage' : '2081687',
 'hs_ticket_category': 'PRODUCT_ISSUE',
 'content': 'This is a test is product issue ticket done.'
 }
 }";

And here is the POST call for creating the ticket:

function creatTicket($token)
{
 $curl = curl_init('https://api.hubapi.com/crm/v3/objects/tickets');
 curl_setopt($curl, CURLOPT_POST, true);
 curl_setopt($curl, CURLOPT_POSTFIELDS, $data_JSON);
 curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
 curl_setopt($ch, CURLOPT_HEADER, true);
 curl_setopt($ch, CURLOPT_HTTPHEADER, array(
 "Accept:application/json",
 "Content-Type:application/json",
 "Authorization: Bearer ".$token,
 ));
 $response = curl_exec($curl);
 curl_close($curl);
 return $response;
}

Some help is really appriciated
16x16_smiley-happy.png.png
.

I realized the mistake. I am just adding the wrong variable in

curl_setopt($ch, CURLOPT_HEADER, true);

It should be:

curl_setopt($curl, CURLOPT_HEADER, true);