omnidesk
  • Ticket
    • Message
    • Using forms
    • Contact forms
  • Customers
    • General
    • API sync on contact
    • CSV import
    • API sync before contact
    • Customer lookup
  • Telephone
    • Callflow
    • Numbers
  • E-mail
  • Users
  • Live chat
    • Livechat chatbot and app integration (backend)
  • Facebook
  • Twitter
  • Survey
    • Push data
  • Statistics
    • Statistics API
  • Raw data - BI
  • Security policy
  • Hosting
  • API docs
    • General
    • Authentication
    • REST
  • API specification
    • Documentation for the Omnidesk API endpoints
    • Chat
    • Customer
    • Email
    • Form
    • Formfield
    • Message
    • Notification
    • Raw
    • Statisticsv2
    • Ticket
    • User
    • View
Powered by GitBook
On this page
  • Create an empty ticket
  • Create content for the ticket (a message)
  1. Ticket

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 'https://{{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 contact form is now created within Omnidesk.


You can also attach files to the contact form message by adding the attachments[] parameter:

curl --location 'https://{{acount}}.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}}"' \
--form 'attachments[]=@"{{file-location}}"'

Multiple files can also be sent by simply adding the attachments[] parameter multiple times.

PreviousUsing formsNextCustomers

Last updated 1 month ago