Hi community,
I’m using PHP to make API calls to interact with Freshdesk, and un til today, i had no problem to deal with it.
Right now, i’m facing an issue about attachments files that we can add to the tickets. In fact, i’m trying to use the code samples here :
but i’m very disappointed cause none of the ones who deal with attachments are working.
Could some PHP developer help me ? Somebody made it work on his side ?
Thanks a lot guys, you could help me a lot with this !!
Have a nice day
Anthony
hello could you share your code and error return? I’ve used these examples a few times, I didn’t get any problems!
2 Likes
This code :
<?php
$api_key = "API_KEY";
$password = "x";
$yourdomain = "YOUR_DOMAIN";
$ticket_payload = array(
'email' => 'test@example.com',
'subject' => 'test',
'description' => 'testing description content',
'priority' => 2,
'status' => 2,
'attachments[]' => curl_file_create("data/x.png", "image/png", "x.png")
);
$url = "https://$yourdomain.freshdesk.com/api/v2/tickets";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, true);
This file has been truncated. show original
does not work ! I also used these samples to make a lot of other things like “Create a simple ticket”, “Create a user” but this thing with attachments just dont work.
Could someone please help me ? i’m lost !!!
Hi Anthony
I’m currently dealing with the same problem. Did you find the solution?
Thanks!
Jonathan