We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
i am using PHP Version 7.2.2 and i am following this document https://github.com/freshdesk/fresh-samples/blob/master/PHP/create_ticket_with_attachment.php to create a ticket with attachment but i am getting this error Error, HTTP Status Code : 0 Headers are Response are .
Here is my code below
$ticket_payload = array( 'email' => $email, 'subject' => 'test', 'description' => 'testing description content', 'priority' => 2, 'status' => 2, 'attachments[]' => curl_file_create("data/butterfly.png", "image/png", "butterfly.png"), );
$ticket_payload = array(
'email' => $email,
'subject' => 'test',
'description' => 'testing description content',
'priority' => 2,
'status' => 2,
'attachments[]' => curl_file_create("data/butterfly.png", "image/png", "butterfly.png"),
);
$url = "https://$yourdomain.freshdesk.com/api/v2/tickets"; $ch = curl_init($url);`
$url = "https://$yourdomain.freshdesk.com/api/v2/tickets";
`$header[] = "Content-type: multipart/form-data";` `curl_setopt($ch, CURLOPT_POST, false);` `curl_setopt($ch, CURLOPT_HEADER, true);` `curl_setopt($ch, CURLOPT_HTTPHEADER, $header);` `curl_setopt($ch, CURLOPT_USERPWD, "$api_key:$password");` `curl_setopt($ch, CURLOPT_POSTFIELDS, $ticket_payload);` `curl_setopt($ch, CURLOPT_RETURNTRANSFER, false);`
$server_output = curl_exec($ch); $info = curl_getinfo($ch); $header_size = curl_getinfo($ch, CURLINFO_HEADER_SIZE); $headers = substr($server_output, 0, $header_size); $response = substr($server_output, $header_size);
$server_output = curl_exec($ch);
$info = curl_getinfo($ch);
$header_size = curl_getinfo($ch, CURLINFO_HEADER_SIZE);
$headers = substr($server_output, 0, $header_size);
$response = substr($server_output, $header_size);
am i doing something wrong ?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
i am using PHP Version 7.2.2 and i am following this document https://github.com/freshdesk/fresh-samples/blob/master/PHP/create_ticket_with_attachment.php to create a ticket with attachment but i am getting this error Error, HTTP Status Code : 0 Headers are Response are .
Here is my code below
$ticket_payload = array(
'email' => $email,
'subject' => 'test',
'description' => 'testing description content',
'priority' => 2,
'status' => 2,
'attachments[]' => curl_file_create("data/butterfly.png", "image/png", "butterfly.png"),
);
$url = "https://$yourdomain.freshdesk.com/api/v2/tickets";
$ch = curl_init($url);`$server_output = curl_exec($ch);
$info = curl_getinfo($ch);
$header_size = curl_getinfo($ch, CURLINFO_HEADER_SIZE);
$headers = substr($server_output, 0, $header_size);
$response = substr($server_output, $header_size);
am i doing something wrong ?
The text was updated successfully, but these errors were encountered: