Queue Tickets

Queue Ticket represents Visitor's request for Engagement with any available Operator.

Create a Queue Ticket

Action: POST /queue_tickets

Creates a new Queue Ticket entity and puts Visitor into the Queue. The Visitor, whose credentials are contained in Authorization header, must be present on the same Site, that the Queue Ticket is created on. See Authorization section for more information.

Parameter

Type

Required

Description

site_id

String

Yes

ID of the Site, that the Visitor enqueues on.

media

String

Yes

The initial Engagement media type. One of text, phone, audio, video. Can only be text or phone if the request is made by a Visitor integrator.

media_options

Object

No

Any additional parameters for the desired media type. See Engagement Requests for more information.

team_ids

Array of strings

No

A set of Team IDs (in UUID v4 format) to restrict Engagement request to. An Operator must belong to at least one of the specified Team IDs to be able to serve the Visitor. This parameter can't be used together with parameter queue_id.

queue_id

String

No

A Queue ID (in UUID v4 format), which Queue Ticket will be assigned to. This parameter can't be used together with parameter team_ids.

source

String

No

Engagement starting source (tab, hotlink, button_embed, callout, external_call, sdk, offline_phone, visitor_integrator). See Engagement sources.

webhooks

Array of webhooks

No

A list of webhooks that will subscribe to Queue Ticket or Engagement events. Only events regarding this Queue Ticket and the resulting Engagement that is created by accepting this Queue Ticket will be sent. Webhooks can have overlapping sets of events. A maximum of 10 webhooks are allowed.

Status codes

Status code

Status name

Description

200

OK

Visitor already has an existing active Queue Ticket with the same request criteria.

201

Created

A new Queue Ticket has been created.

409

Conflict

Visitor has an active Queue Ticket with criteria conflicting with what was requested. The active Queue Ticket can be deleted and a subsequent request made with new criteria to replace it.

Output

Field

Type

Required

Description

id

String

Yes

Queue Ticket ID.

site_id

String

Yes

ID of the Site, that the Visitor queued for.

source

String

Yes

Engagement starting source (tab, hotlink, button_embed, callout, external_call, sdk, offline_phone, visitor_integrator). See Engagement sources.

media

String

Yes

The initial Engagement media type. One of text, phone, audio, video. Can only be text or phone if the request is made by a Visitor integrator.

team_ids

Array

Yes

A set of Team IDs (in UUID v4 format) for which the Visitor is queueing for.

created_at

String

Yes

An ISO-8601 timestamp. Defines the creation time of the Queue Ticket.

visitor_authentication

Object

Yes

Headers which are required to make subsequent requests that modify the Queue Ticket and an eventual Engagement.

cURL
Untitled
Untitled
cURL
curl --request POST \
--header "Authorization: Bearer $access_token" \
--header "Accept: application/vnd.salemove.v1+json" \
--header "Content-Type: application/json" \
--data-binary '{
"site_id": "51138845-3c46-4c21-8bd8-1cf45957f62e",
"source": "hotlink",
"media": "video",
"team_ids": [
"cd564dd0-c8c1-44d2-88a9-074243e029b8",
"22ff2c56-037c-467c-9346-7309a23335b6"
]
}' \
"https://api.salemove.com/queue_tickets"
Untitled
var XMLHttpRequest = require('xmlhttprequest').XMLHttpRequest;
var xhr = new XMLHttpRequest();
xhr.open('POST', 'https://api.salemove.com/queue_tickets', false);
xhr.setRequestHeader('authorization', `Bearer ${access_token}`);
xhr.setRequestHeader('accept', 'application/vnd.salemove.v1+json');
xhr.setRequestHeader('content-type', 'application/json');
var data = {
site_id: '51138845-3c46-4c21-8bd8-1cf45957f62e',
source: 'hotlink',
media: 'video',
team_ids: [
'cd564dd0-c8c1-44d2-88a9-074243e029b8',
'22ff2c56-037c-467c-9346-7309a23335b6'
]
};
var query = JSON.stringify(data);
xhr.send(query);
var response = JSON.parse(xhr.responseText);
console.log(response);
Untitled
require 'httparty'
ENDPOINT = 'https://api.salemove.com/queue_tickets'
access_token = ARGV[0].strip
headers = {
'Authorization' => "Bearer #{access_token}",
'Accept' => 'application/vnd.salemove.v1+json',
'Content-Type' => 'application/json'
}
options = {
headers: headers,
query: {
"site_id": "51138845-3c46-4c21-8bd8-1cf45957f62e",
"source": "hotlink",
"media": "video",
"team_ids": [
"cd564dd0-c8c1-44d2-88a9-074243e029b8",
"22ff2c56-037c-467c-9346-7309a23335b6"
]
}
}
raw_response = HTTParty.post(
ENDPOINT,
options
)
response = JSON.parse(raw_response.body)
puts response

Generates the output

{
"id": "59b0d786-e59a-4c62-a064-05e4f47488a2",
"site_id": "51138845-3c46-4c21-8bd8-1cf45957f62e",
"source": "hotlink",
"media": "video",
"team_ids": [
"cd564dd0-c8c1-44d2-88a9-074243e029b8",
"22ff2c56-037c-467c-9346-7309a23335b6"
],
"created_at": "2017-02-20T00:00:00Z",
"visitor_authentication": {
"Authorization": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJ2aXNpdG9yOjVmOGE2YmM2LTAxNTYtNDM0ZC04N2RkLWMyYWEzMjQwMDJkOSIsInJvbGVzIjpbeyJ0eXBlIjoidmlzaXRvciIsInZpc2l0b3JfaWQiOiI1ZjhhNmJjNi0wMTU2LTQzNGQtODdkZC1jMmFhMzI0MDAyZDkifSx7InR5cGUiOiJzaXRlX3Zpc2l0b3IiLCJzaXRlX2lkIjoiZWEwY2FiMTctMzAxYy00YzNiLWI2ZWItNmNlZjZkZDkzYjVjIn1dLCJpc3MiOiJTYWxlTW92ZSBWaXNpdC1SZWdpc3RyeSIsImlhdCI6MTU0MTE2NDE1NSwiZXhwIjoxNTQyMzczNzU1fQ.hjILobSmfLBTZwQtMSHxdg6bAo7W5UysLOmIaktRdPNuAN3iEWOC6A-PXfwPM98MKFs5QgKX_H-q4JJ_gixB0w"
}
}

Delete a Queue Ticket

Action: DELETE /queue_tickets/:queue_ticket_id

Deletes the Queue Ticket and removes Visitor from the Queue.

cURL
Untitled
Untitled
cURL
curl --request DELETE \
--header "Authorization: Bearer $access_token" \
--header "Accept: application/vnd.salemove.v1+json" \
"https://api.salemove.com/queue_tickets/1bb4631a-40c7-4011-b7e6-b9e789901949"
Untitled
var XMLHttpRequest = require('xmlhttprequest').XMLHttpRequest;
var xhr = new XMLHttpRequest();
xhr.open(
'DELETE',
'https://api.salemove.com/queue_tickets/1bb4631a-40c7-4011-b7e6-b9e789901949',
false
);
xhr.setRequestHeader('authorization', `Bearer ${access_token}`);
xhr.setRequestHeader('accept', 'application/vnd.salemove.v1+json');
xhr.send();
console.log(xhr.status);
Untitled
require 'httparty'
ENDPOINT = 'https://api.salemove.com/queue_tickets/1bb4631a-40c7-4011-b7e6-b9e789901949'
access_token = ARGV[0].strip
headers = {
'Authorization' => "Bearer #{access_token}",
'Accept' => 'application/vnd.salemove.v1+json'
}
options = {
headers: headers,
}
response = HTTParty.delete(
ENDPOINT,
options
)
puts response.code

Generates the output

204 No Content