I would like to create a ticket via REST API.
The application via curl works, but if I hang pictures with it, I can not open the pictures in the ticket.
Text files can be viewed from the ticket.
I hand over the data as follows:
$ticket = array(
“title” => $data[‘betreff’],
“group_id” => $data[‘bereich’],
“priority_id” => 2,
“customer” => $data[‘email’],
“php_datei” => $data[‘php_datei’],
“article” => array(
“body” => $data[‘beschreibung’],
“type” => “note”,
“subject” => $data[‘betreff’],
“internal” => false
),
“note” => $data[‘beschreibung’]
);
foreach ($pictures as $picture) {
$ticket['article']['attachments'][] = array(
"filename" => $picture['name'],
"data" => base64_encode(make_iso($picture['content'])),
"mime-type" => 'application/octet-stream'
);
}
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($ticket));
I have nowhere in the documentation found anything with uploading images, maybe “mime-type” is not right.
Über eine Hilfe währe ich sehr dankbar.