The chat report export is a REST service that exports chat sessions from jtel to an external system.

The report export can be initiated manually by agents in the chat session, using the Report Export button:

Notes: this requires the implementation of a REST service by the customer on the customer back-end system. The report export button will only appear, if the URL is configured in the Report Export Post parameters.

The configuration of the report export is performed in the Chat Connector configuration, on the REST tab.

Phase 1 - Token Post

Phase 1 is used to acquire an access token for the operation.

Note: This is not necessary if a token is not required, and all necessary information can be provided in the second post request.


URL

This is the URL to which the post request to acquire the token should be sent.

Header

This part specifies the headers which should be sent with the request. Any necessary headers can be specified here.

Body

This part specifies the body which should be sent with the request. Any necessary body can be specified here.

Phase 2 - Report Export Post

The second phase posts the PDF report containing the chat session to the backend system.

Any data can be specified in the body. 


URL

This is the URL to which the report post should be sent.

Header

Specify any headers required here. The token retrieved in the first step can be specified, for example, with $tokenResponse.body.JSON.access_token

Body

Specify the body of the post request here. The XML template can be inserted into the body as base64 coded data using the variable $xmlTemplate.encoded.base64

Xml Template

This template can contain any data, which will be base 64 coded into the body when the variable $xmlTemplate.encoded.base64 is used.

Variables

The following variables are provided, which can be used in either of the requests:

VariableMeaning
$ClientsIDThe ID of the client account.
$chatConnector.idThe ID of the chat connector.
$chatConnector.nameThe name of the chat connector.
$tokenResponse.body.JSON.access_tokenThe access token returned by the token post.
$report.encoded.base64The encoded PDF data as base 64 encoded data.
$report.bytesThe number of bytes in the encoded report PDF data.
$dateTimeThe current date and time in the format yyyy-MM-dd HH:mm:ss
$xmlTemplate.encoded.base64The XML template encoded in base 64 format.
$pdata.*

Where * is any variable from the pdata configured in the chat connector.

Example:

pdata: {name:'John Doe', email:'john.doe@example.com'}

$pdata.name will be equal to 'John Doe'.

  • No labels