Hi, I'm trying to create a ticket through the API and I just got:
{"error":1,"message":"Ticket not found."}
Below is the php:
<?php
$token = "xxxx";
$request = ['opener' => 'user', 'user_id' => 3, 'staff_id' => 1, 'department_id' => 4, 'subject' => 'test', 'body' => 'This is a test.', 'attachment[]'=> new CURLFILE(''), 'notify' => 1];
$authorization = 'Token: '.$token;
$curl = curl_init('https://xxxxxxx.com.br/support/api/tickets/create');
curl_setopt($curl, CURLOPT_HTTPHEADER, array($authorization));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POST, POST);
curl_setopt($curl, CURLOPT_POSTFIELDS, $request);
$response = curl_exec($curl);
echo $response;
curl_close($curl);
What am I doing wrong?
{"error":1,"message":"Ticket not found."}
Below is the php:
<?php
$token = "xxxx";
$request = ['opener' => 'user', 'user_id' => 3, 'staff_id' => 1, 'department_id' => 4, 'subject' => 'test', 'body' => 'This is a test.', 'attachment[]'=> new CURLFILE(''), 'notify' => 1];
$authorization = 'Token: '.$token;
$curl = curl_init('https://xxxxxxx.com.br/support/api/tickets/create');
curl_setopt($curl, CURLOPT_HTTPHEADER, array($authorization));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POST, POST);
curl_setopt($curl, CURLOPT_POSTFIELDS, $request);
$response = curl_exec($curl);
echo $response;
curl_close($curl);
What am I doing wrong?