Call Visualizer

Call Visualizer REST API specification

Acquire Launch Token

Action: POST /auth/token

curl --request POST \
--data-binary "api_token=$token" \
"https://omnibrowse.salemove.com/auth/token"
$.ajax({
type: 'POST',
url: 'https://omnibrowse.salemove.com/auth/token',
data: 'api_token=AjMMVGcvSdHg8H6f_dOr6Q',
success: function(response) {
console.log(response);
}
});

Generates the Output

{
"launch_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJqdGkiOiJlZTUwMjNhMS0xM2Q3LTQzMTItYTk5YS0zOGNmODM1Yzc2NTgiLCJvcGVyYXRvcl9pZCI6ImY0MjgxMWJjLTg1MTktNGQzMy1iYmIxLTM2ZDQ1NTVlY2IwYSIsIm5hbWUiOiJTYXNoYSBCcm93biIsImVtYWlsIjoic2FzaGFicm93bkBlbWFpbC5jb20iLCJwaG9uZSI6IjEyMDI0NTYxMTExIiwiaWF0IjoxNDk5ODg5MzUwLCJleHAiOjE0OTk4OTMxODZ9.r3K_OffhPjAWEelPdsLlXo3Ewc1bMijKdiPYyhIFGLc"
}

Description

Acquire a token which can be used later to start a Call Visualizer session. The token has a very short lifespan and is intended to be used immediately. API user must provide a valid API token to acquire a launch token.

Parameters

Name

Located In

Description

Required

Type

api_token

request body

The user's API token

Yes

String

Fetch Visitor Information by External ID

Action: GET /sites/{site_id}/visitors

cURL
Untitled
cURL
curl --request GET \
--header "Authorization: Bearer $access_token" \
"https://omnibrowse.salemove.com/sites/$site_id/visitors?external_id=$external_id"
Untitled
var siteId = '19797dfc-c035-4c92-882c-dd080007a7a5';
var externalId = '14755';
$.ajax({
type: 'GET',
url: 'https://omnibrowse.salemove.com/sites/' + siteId + '/visitors',
data: {
external_id: externalId
},
headers: {
Authorization: 'Bearer $access_token'
},
success: function(response) {
console.log(response);
}
});

Generates the Output

[
{
"visitor_id": "d2097185-d995-4538-94ae-2ddd77325bbe",
"updated_at": "2017-03-21T12:18:32.598729",
"site_id": "19797dfc-c035-4c92-882c-dd080007a7a5",
"phone": "+19176753436",
"note": null,
"name": "John",
"generated_name": "Visitor #1",
"external_id": "14755601",
"email": "test@email.com",
"custom_attributes": {
"external_id": "14755"
},
"created_at": "2016-07-13T14:22:56.161119"
}
]

Description

Fetches list of site's visitors with given external ID. By default, only active visitors will be returned. The user whose Bearer access token is used for making this request must have access to the site.

Parameters

Name

Located In

Description

Required

Type

site_id

path

Site ID.

Yes

String

external_id

query

External ID. Maximum length is 64 characters; can not be 5 digits.

Yes

String

include_offline

query

Show inactive visitors. The default value is false.

No

Boolean

Fetch Visitor Information by Visitor ID

Action: GET /sites/{site_id}/visitors/{id}

cURL
Untitled
cURL
curl --request GET \
--header "Authorization: Bearer $access_token" \
"https://omnibrowse.salemove.com/sites/$site_id/visitors/$visitor_id"
Untitled
var siteId = '19797dfc-c035-4c92-882c-dd080007a7a5';
var visitorId = 'd2097185-d995-4538-94ae-2ddd77325bbe';
$.ajax({
type: 'GET',
url:
'https://omnibrowse.salemove.com/sites/' +
siteId +
'/visitors/' +
visitorId,
headers: {
Authorization: 'Bearer AjMMVGcvSdHg8H6f_dOr6Q'
},
success: function(response) {
console.log(response);
}
});

Generates the output

{
"visitor_id": "d2097185-d995-4538-94ae-2ddd77325bbe",
"updated_at": "2017-03-21T12:18:32.598729",
"site_id": "19797dfc-c035-4c92-882c-dd080007a7a5",
"phone": "+19176753436",
"note": null,
"name": "John",
"generated_name": "Visitor #1",
"external_id": "14755601",
"email": "test@email.com",
"custom_attributes": {
"external_id": "14755601"
},
"created_at": "2016-07-13T14:22:56.161119"
}

Description

Fetches site's visitor by its ID. The user whose Bearer access token is used for making this request must have access to the site.

Parameters

Name

Located In

Description

Required

Type

site_id

path

Site ID.

Yes

String

id

path

Visitor ID.

Yes

String

Fetch Visitor by Visitor Code

Action: GET /visitor

cURL
Untitled
cURL
curl --request GET \
--header "Authorization: Bearer $access_token" \
"https://omnibrowse.salemove.com/visitor?visitor_code=$visitor_code"
Untitled
var visitorCode = '12345';
$.ajax({
type: 'GET',
url: 'https://omnibrowse.salemove.com/visitor',
data: {
visitor_code: visitorCode
},
headers: {
Authorization: 'Bearer AjMMVGcvSdHg8H6f_dOr6Q'
},
success: function(response) {
console.log(response);
}
});

Generates the output

{
"id": "c62b4a91-a0d7-4137-80e3-c281393b71c2",
"site_id": "19797dfc-c035-4c92-882c-dd080007a7a5"
}

Description

Fetches visitor by visitor code. The user whose Bearer access token is used for making this request must have access to the site that the visitor code was generated for.

Parameters

Name

Located In

Description

Required

Type

visitor_code

query

Visitor code. A unique 5-digit code to identify the visitor.

Yes

String

Status Codes

Status code

Description

200 - OK

The provided code is associated with the returned visitor.

404 - Not Found

Provided visitor code is not found or expired.

Update Visitor's External ID

Action: PATCH /sites/{site_id}/visitors/{visitor_id}

cURL
Untitled
cURL
curl --request PATCH \
--header "Authorization: Bearer $access_token" \
--data-binary "external_id=$external_id" \
"https://omnibrowse.salemove.com/sites/$site_id/visitors/$visitor_id"
Untitled
require 'rest-client'
require 'json'
token = ARGV[0].strip
site_id = ARGV[1].strip
visitor_id = ARGV[2].strip
external_id = ARGV[3].strip
headers = {
:authorization => "Bearer #{accessToken}"
}
body = "external_id=#{external_id}"
response = RestClient.patch "https://omnibrowse.salemove.com/sites/#{site_id}/visitors/#{visitor_id}", body, headers
puts response.body

Generates the Output

{
"visitor_id": "d2097185-d995-4538-94ae-2ddd77325bbe",
"updated_at": "2017-03-21T12:18:32.598729",
"site_id": "19797dfc-c035-4c92-882c-dd080007a7a5",
"phone": "+19176753436",
"note": null,
"name": "John",
"generated_name": "Visitor #1",
"external_id": "14755601",
"email": "test@email.com",
"custom_attributes": {
"external_id": "14755601"
},
"created_at": "2016-07-13T14:22:56.161119"
}

Description

Updates visitor's external ID. The user whose Bearer access token is used for making this update must have access to the site. The maximum length of the external ID is 64 characters, at the same time it can not be a 5-digit string.

Parameters

Name

Located In

Description

Required

Type

site_id

path

Site ID.

Yes

String

id

path

Visitor ID.

Yes

String

external_id

request body

External ID. Maximum length is 64 characters.

Yes

String

Showing Visitor Code

<button
class="omnibrowse-code-button"
onclick="document.body.appendChild(document.createElement('sm-visitor-code'))">
Get CoBrowsing code
</button>
// The button to show Visitor Code
<button class="omnibrowse-code-button">Get CoBrowsing code</button>;
function showVisitorCode() {
var code = document.createElement('sm-visitor-code');
document.body.appendChild(code);
}
// Add a "click" event listener to the button. <sm-visitor-code />
// is added to the DOM when the button is clicked.
document
.querySelector('.omnibrowse-code-button')
.addEventListener('click', showVisitorCode);

Call Visualizer visitor code is shown when the visitor presses the CTRL + Y key combination. The code can also be made to appear by adding a <sm-visitor-code /> custom HTML element to the DOM.

Glia Visitor App detects this addition to the DOM and replaces its contents with the Call Visualizer visitor code modal which will then appear for the visitor. When the visitor clicks the X button to close the modal the <sm-visitor-code /> element along with its contents are removed from the DOM. Only one instance of <sm-visitor-code /> can be added to the DOM at a time. When the visitor code modal is already visible then any new <sm-visitor-code /> elements added to the DOM will be removed. When the operator successfully starts observing the visitor then the Call Visualizer visitor code modal is closed and the <sm-visitor-code /> element is removed from the DOM.

As an example the <sm-visitor-code /> element can be used to create buttons on your site that the visitor can interact with to show the visitor code. This would be an alternative method to showing visitor code other than the CTRL + Y key combination.

Exports for Call Visualizer

What is an Engagement in Call Visualizer?

Call Visualizer engagement is a phone-first engagement that has started as a regular phone call between the operator and a visitor and can be amended with a live observation or CoBrowsing.

Configuring Exports

Action: POST /sites/{site_id}/crm/exports

If you implemented Call Visualizer so that your operators are able to observe your visitors based on their external_id, then you are already sending a custom attribute to the visitor class. If you would like to gather other data from your site, such as

  • Account holder’s name,

  • Contact information, and

  • Form inputs,

you can do so by programmatically scraping that information from your site and submitting it to Glia as visitor custom attributes when Glia loads or as that information becomes available.

Then, when an engagement ends, you can include that information in your export.

Example Visitor Object

{
"href": "https://api.salemove.com/visitors/039124e6-b4e8-4a0d-b420-5b6696c7ecb4",
"name": "Sasha Brown",
"email": "sasha.brown@email.com",
"phone": null,
"note": null,
"custom_attributes": {},
"id": "039124e6-b4e8-4a0d-b420-5b6696c7ecb4"
}

Export templates can be configured in three different formats: HTML, XML and JSON. Which template you use will depend on what system you are using to capture the data Glia sends. Example templates can be found in Glia’s support documentation about Configuring Export Content. In order to include descriptive content about your engagements, you will want to incorporate field tags.

Field Tags

Field tags are placeholders for dynamic values which Glia will detect and replace on sending your exports. The following values are available if they are updated before or during an Phone-first engagement. Please see the Exports for further information.

Collection Tags

Some templated field tags return multiple items, such as operators who participated in an engagement or the custom attributes of a visitor who left an offline message. These are called collection_tags, and generate XML, JSON, or HTML content, depending on the template's content-type. Please see the Export for further information.

POST New Export

With the aforementioned variables, you can configure exports programmatically. Please take a look at Exports for examples how to send and export following an engagement to your inbox, data warehouse, or CRM using Glia REST API.