Developers

Create Ticket

Usage

Use this method to create a ticket through the Messenger API.

client.createTicket(data).then(function(result){

});

Mandatory parameters

Name Array property Type Description
creator array The data related to the ticket creator
name string The name of the user who is creating the ticket Yes
address string The address of the user who is creating the ticket Yes
message string The body of the ticket. Accepts an HTML-formatted string and inline attachments

Optional parameters

Name Array property Array property Type Description
title string The title of the ticket to be created
creator1 array The data related to the ticket creator
extra array A list of extra user data consisting of the agent and/or contact attribute IDs defined in the instance's Messenger > Settings > User data screen, together with the corresponding values
id integer The ID of the agent and/or contact attribute for which you are providing a value, as defined in the instance's Messenger > Settings > User data screen
content string The value for the attribute specified in the id property
attachments integer A list of the IDs of the media files attached to the ticket
classifications integer A list of the ticket classification IDs as defined in the instance's Messenger > Settings > Classifications screen
extra array A list of extra ticket data as defined in the instance's Messenger > Settings > Ticket data screen
id integer The ID of the extra ticket data attribute for which you are providing a value, as defined in the instance's Messenger > Settings > Ticket data screen
content string The value for the extra ticket data attribute specified in the id property
source integer The ID of the ticket source as defined in the instance's Messenger > Settings > Ticket sources screen
language integer The ID of the ticket language. You can obtain a list of the language IDs using the Messenger API's GET /settings/languages endpoint.
priority integer The priority of the ticket:
  • 1: Low
  • 2: Medium
  • 3: High
queue integer The queue ID of the ticket, as defined in the instance's Messenger > Settings > Queues screen

1 The creator property has both mandatory and optional subproperties, which is why it is mentioned in both the Mandatory and the Optional parameters sections.

Response data format

The createTicket method returns the ID of the created ticket with and without the instance ID. For the full response model, please see the Responses section for the POST /tickets endpoint on the Messenger API Routes page.

Example

client.createTicket({
creator: {

       address:'<email_address>',
       extra:[],
       name:'<name>'
},
message:'<message>'
}).then(function(result){
console.log(result);
});