Skip to content
h1acct2 edited this page Mar 24, 2022 · 3 revisions

Welcome to the fresh-samples wiki!

Create ticket with custom fields and attachments (multipart/form-data)

Not sure where the best place for this is, but wanted to add an example to send a custom field when using the form method (required when sending attachments):

notice the custom_fields[field_name] syntax, I could not find this anywhere else, but the support team at freshdesk responded to my question right away with the correct info, thanks!

curl -v -u user@yourcompany.com:test -F "attachments[]=@/path/to/attachment1.ext" -F "attachments[]=@/path/to/attachment2.ext" -F "email=example@example.com" -F "custom_fields[category]=Primary" -F "custom_fields[department]=Testing" -F "subject=Ticket Title" -F "description=this is a sample ticket" -X POST 'https://domain.freshdesk.com/api/v2/tickets'

Clone this wiki locally