Skip to main content
Question

Error creating ticket with attachments PHP

  • February 6, 2023
  • 2 replies
  • 141 views

Forum|alt.badge.img

Good morning, i'm trying to create a ticket calling the api v2 (php with attachments)

But it return all time error 500 without any explanation, the request id is:

X-Request-Id:  647b2819-0e25-41c1-affd-e76380b93b2d


Rest Error: Internal Server Error - API StatusCode: 500 - API Detailed Error Message: {"code":"internal_error","message":"We're sorry, but something went wrong."}


Can you give any feedback?

Did this topic help you find an answer to your question?

2 replies

Sudharshan
Community Debut
Forum|alt.badge.img+4
  • Community Debut
  • 49 replies
  • February 7, 2023

Hi @jgarcia13456,

 

Greetings from Freshworks Community!

 

I understand that you’re using PHP to create Freshdesk tickets via API. Here are few sample PHP codes on how attachments can be handled for an API call:

https://github.com/freshworks/fresh-samples/tree/master/PHP

 

Please refer to our API documentation for more details on other languages. You can find similar code samples here:

https://developers.freshdesk.com/api/#code_samples

 

Please note that if you’re making an API call with attachments, the Content-Type should always be “multipart/form-data”. You can refer to this detailed API documentation on Attachments for more details:

https://developers.freshdesk.com/api/#attachments

 

Cheers!


Forum|alt.badge.img
  • Author
  • Apprentice
  • 1 reply
  • February 13, 2023

For everyone who comes here looking for a solution. In my case the problem was that if several attachments are included both have the id attachments[]


Reply