Contact forms

If you have a contact form on your website, it can use these requests to create a new ticket with content in Omnidesk

Create an empty ticket

POST https://{{account}}.omnidesk.com/api/v2/ticket

With this endpoint you create a new empty ticket with the data required. Below you can find an example of how this request can be made. All the values in the double brackets are variables you can adjust for your own purposes.

curl --location 'https://{{account}}.omnidesk.com/api/v2/ticket' \
--header 'Content-Type: multipart/form-data' \
--header 'apiKey: {{api-key}}' \
--form 'brandID="{{brand-id}}"' \
--form 'channelID="1"' \
--form 'direction="inbound"' \
--form 'from="{{customer-email}}"' \
--form 'to="{{brand-email}}"' \
--form 'title="{{ticket-title}}"'

Additionally, you can also add these optional parameters if needed:

  • fromName - The name of the customer

  • assignedGroupID - The group this ticket will be assigned to

  • formID - The form this ticket will have on it

The response will return the ticket ID in it as well. Make sure you save this, as you need it in the next request.


Create content for the ticket (a message)

POST https://{{account}}.omnidesk.com/api/v2/message

With this endpoint you create a message in the newly created ticket, containing the contact form data itself. For the message parameter, HTML is accepted.

curl --location 'http://{{account}}.omnidesk.com/api/v2/message' \
--header 'Content-Type: multipart/form-data' \
--header 'apiKey: {{api-key}}' \
--form 'ticketID="{{id-newly-created-ticket}}"' \
--form 'type="contactform"' \
--form 'message="{{contact-form-message}}"'

If this request returns a HTTP code of 200, everything successfully came through and the contactform is now created within Omnidesk.

Last updated