Configure the Session History API

The Session History API returns post-session data and details about a session or set of sessions according to the configured filtering options.

URL for Session History API

Input Parameters

Element Format Mandatory Description
KEY Varchar(64) Yes Your API key
VARS Varchar(512) Yes Variable specification. Check description below
(FILTERS) --- No

Filtering options. Check description below

Vars

This variable specifies the information that is returned by the function. Each parameter is separated by a space.

Element Format Description
COMPUTER_NAME Varchar(50) Customer's computer name
COMPUTER_DOMAIN Varchar(100) The domain of the customer's computer
COMPUTER_OS Varchar(64) Computer's operating system
TECH_USERNAME Varchar(100) Technician's username (email address)
TECH_NAME Varchar(100) Technicians name
CUSTOMER_NAME Varchar(200) Customer's name
CUSTOMER_EMAIL Varchar(100) Customer's email address
CUSTOMER_NUMBER Varchar(50) Customer's identification number in your company
PROBLEM_DESCRIPTION Varchar(4000) Description of the problem
NOTES Varchar(4000) Technician's description of the issue
HAS_VIDEOS BOOLEAN(TRUE,FALSE) Returns TRUE if there are recorded videos
DATE_START

YYYY-MM-DD

HH:MM:SS

Session's starting time
DATE_END

YYYY-MM-DD

HH:MM:SS

Session's ending time
CHAT_INFO XML XML data structure containing the chat transcript
VIDEO_LINKS XML XML data structure containing video URLs
OUTPUT_FORMAT XML OR JSON XML OR JSON
CUSTOM_FIELD_NAME Varchar(32) Name for custom field
CUSTOM_FIELD_VALUE Varchar(100) Value for custom field

Filters

This function supports a number of filters that allows the selection of a subset of sessions.

Element Format Description
FILTER_ID INT Filter results from a specific session ID
FILTER_DATE_START_INI

YYYY-MM-DD

HH:MM:SS

Session’s starting time must be higher than this value
FILTER_DATE_START_END

YYYY-MM-DD

HH:MM:SS

Session’s starting time must be lower than this value
FILTER_CUSTOMER_NAME Varchar(100) Customer's name
FILTER_CUSTOMER_EMAIL Varchar(100) Customer's email address
FILTER_CUSTOMER_NUMBER Varchar(50) Customer's identification number in your company
FILTER_COMPUTER_NAME Varchar(100) Customer's computer name
FILTER_COMPUTER_DOMAIN Varchar(100) Customer's computer domain
FILTER_TECH_USERNAME Varchar(100) Technician's username
FILTER_START_METHOD ALL, APPLET, AGENT Session started from Agent software running on customer’s PC or otherwise (e.g. session started from a pin number)
FILTER_PROCESSED ALL, ANSWERED, NOT_ANSWERED Session was answered by a technician or not
FILTER_HAS_VIDEOS BOOLEAN (TRUE, FALSE)

TRUE = Only requests WITH video recordings

FALSE = Only requests WITHOUT video recordings

Empty value = All requests

FILTER_CUSTOM_FIELD_NAME Varchar(32) Name for custom field filter
FILTER_CUSTOM_FIELD_VALUE Varchar(100) Value for custom field filter

Output

The function returns the following XML structure:

 

Error handling

The error messages are returned by the function within the XML structure in the following format:

<response><error_msg> Error message.</error_msg></response>

These are some other examples:

<response><error_msg>Invalid FILTER_HAS_VIDEOS setting.</error_msg></response>
<response><error_msg>Invalid FILTER_START_METHOD setting.</error_msg></response>
<response><error_msg>Invalid FILTER_START_METHOD setting.</error_msg></response>
<response><error_msg>Invalid FILTER_DATE_START_INI value.</error_msg></response>
<response><error_msg>Invalid FILTER_DATE_START_END value.</error_msg></response>

Examples

This example returns the fields selected in VARS from all the ANSWERED sessions created after 2011-01-01 UTC:

get_session_history.php?KEY=xxxxx&VARS=ID CUSTOMER_NUMBER DATE_START DATE_END 
TECH_USERNAME&FILTER_DATE_START_INI=2011-01-01&FILTER_PROCESSED=ANSWERED

This example returns the fields selected in VARS from all the ANSWERED by tech mytech@techplace.com requests created after 2011-01-01 UTC:

get_session_history.php?KEY=xxxxx&VARS=ID CUSTOMER_NUMBER 
DATE_START&FILTER_DATE_START_INI=2011-01-01&
FILTER_PROCESSED=ANSWERED&FILTER_TECH_USERNAME=mytech@techplace.com

This example returns the fields selected in VARS from request ID 12334:

get_session_history.php?KEY=xxxxx&VARS=CUSTOMER_NAME CUSTOMER_NUMBER
COMPUTER_NAME COMPUTER_DOMAIN PROBLEM_DESCRIPTION TECH_USERNAME DATE_START
DATE_END HAS_VIDEOS COMPUTER_OS NOTES&FILTER_ID=12334

What do you want to do?