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

https://api.swi-rc.com/integration/get_history_api.php

Input Parameters

ElementFormatMandatoryDescription
KEYVarchar(64)YesYour API key
VARSVarchar(512)YesVariable specification. Check description below
(FILTERS)---NoFiltering options. Check description below

Vars

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

ElementFormatDescription
COMPUTER_NAMEVarchar(50)Customer's computer name
COMPUTER_DOMAINVarchar(100)The domain of the customer's computer
COMPUTER_OSVarchar(64)Computer's operating system
TECH_USERNAMEVarchar(100)Technician's username (email address)
TECH_NAMEVarchar(100)Technicians name
CUSTOMER_NAMEVarchar(200)Customer's name
CUSTOMER_EMAILVarchar(100)Customer's email address
CUSTOMER_NUMBERVarchar(50)Customer's identification number in your company
PROBLEM_DESCRIPTIONVarchar(4000)Description of the problem
NOTESVarchar(4000)Technician's description of the issue
HAS_VIDEOSBOOLEAN(TRUE,FALSE)Returns TRUE if there are recorded videos
DATE_STARTYYYY-MM-DDSession's starting time
HH:MM:SSAlternative session's starting time format.
DATE_ENDYYYY-MM-DDSession's ending time
HH:MM:SSAlternative session's ending time format.
CHAT_INFOXMLXML data structure containing the chat transcript
VIDEO_LINKSXMLXML data structure containing video URLs
OUTPUT_FORMATXML OR JSONXML OR JSON
CUSTOM_FIELD_NAMEVarchar(32)Name for custom field
CUSTOM_FIELD_VALUEVarchar(100)Value for custom field

Filters

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

ElementFormatDescription
FILTER_IDINTFilter results from a specific session ID
FILTER_DATE_START_INIYYYY-MM-DDSession’s starting time must be higher than this value
HH:MM:SSAlternative session’s starting time format
FILTER_DATE_START_ENDYYYY-MM-DDSession’s starting time must be lower than this value
HH:MM:SSAlternative session’s starting time format
FILTER_CUSTOMER_NAMEVarchar(100)Customer's name
FILTER_CUSTOMER_EMAILVarchar(100)Customer's email address
FILTER_CUSTOMER_NUMBERVarchar(50)Customer's identification number in your company
FILTER_COMPUTER_NAMEVarchar(100)Customer's computer name
FILTER_COMPUTER_DOMAINVarchar(100)Customer's computer domain
FILTER_TECH_USERNAMEVarchar(100)Technician's username
FILTER_START_METHODALL, APPLET, AGENTSession started from Agent software running on customer’s PC or otherwise (e.g. session started from a pin number)
FILTER_PROCESSEDALL, ANSWERED, NOT_ANSWEREDSession was answered by a technician or not
FILTER_HAS_VIDEOSBOOLEAN (TRUE, FALSE)TRUE = Only requests WITH video recordings
FALSE = Only requests WITHOUT video recordings
Empty value = All requests
FILTER_CUSTOM_FIELD_NAMEVarchar(32)Name for custom field filter
FILTER_CUSTOM_FIELD_VALUEVarchar(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 [email protected] 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=[[email protected]](mailto:[email protected])

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