API - post attachments

 

Hi,


I'm starting to get a bit of confidence with the use of the API.

Through a form, I can create a ticket. Also through the form I would like to insert an attachment and view it on FreshDesk.

I develop in PHP. Do you have any example that I can riferiemento? Can you give me a hand?

For example, you place a bit of code that I'm using:

 

************************************************************

$ticket = new DomDocument('1.0');
$ticket_root = $ticket->appendChild($ticket->createElement('helpdesk_ticket'));

// Field Status - 2 Open - 3 Pending - 4 Resolved - 5 Closed
$status_tag = $ticket_root->appendChild($ticket->createElement('status'));
$status_tag->appendChild($ticket->createTextNode("2"));


// Field Email
$email_tag = $ticket_root->appendChild($ticket->createElement('email'));
$email_tag->appendChild($ticket->createTextNode($email_cli));


************************************************************


Thank you in advance for your help! ;)


 

Luca


Hi Luca, 


My apologies for the late reply. Here is a PHP sample for your reference. 


https://github.com/johnpaulh/mysamples/tree/master/php_samples 


Let us know if you need any other help. 



Hi Samyuktha,

I already saw this example, but it does not work! :(


I get the error: NULL RESPONSE


I'm desperate! I'm still on this problem for almost 1 month


Luca




 

Hi Samyuktha,

are you avaible for a conference?
can you help me also for ticket #99497 during the conference ?

thanks
Luca