- Home [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
- Manage types
- Global context and isolation
- Manage apps
- Batch actions with app items
- Manage external services
- Scripts in widgets
- Web components
- Access permissions
- Getting started with processes
- Getting started with signatures
- Getting started with file previews
- Getting started with the organizational chart
- Getting started with users and groups
-
Getting started with the
Table data type - Dynamic calculation of event type
- Use cases
-
API
- Object types
- Data types
- Global constants
- Work with apps
- Web requests
- Access permissions
- Document flow
-
Live Chats
- LineChannelState
- LineChannelType
- LineClientBlockedStatus
- LineMessageType
- LineMetricType
- LineSessionPriority
- LineSessionState
- OperatorStatusType
- LineApplicationRef
- LineBindingApplication
- LineChannelData
- LineChannelItem
- LineChannelItemRef
- LineChannelSearch
- LineChannels
- LineClientData
- LineClientExtraData
- LineClientItem
- LineClientItemRef
- LineClientSearch
- LineClients
- LineData
- LineItem
- LineItemRef
- LineMessageData
- LineMessageItem
- LineMetricData
- LineMetricItem
- LineMetrics
- LineSearch
- LineSessionData
- LineSessionItem
- LineSessionItemRef
- LineSessionSearch
- LineSessions
- Lines
- LinesCollections
- SessionChangedPayload
- SessionFieldChange
- SessionReassignedPayload
- LineSessionPriorityEnumBase
- LineSessionStateEnumBase
- “Code” widget
- Signatures
- Business calendars
- Integration with IP telephony
- Integration with email marketing services
Live Chat session object
Type parameters
I: Item<ItemData>
I: Item<ItemData>
Hierarchy
Properties
Readonly code
App code of the URL’s target (the app’s code).
Readonly data
Values of object’s fields.
Readonly fields
Description of the object’s fields.
Readonly id
ID of the URL’s target.
Readonly namespace
Namespace of the URL target (the code of the workspace that the app belongs to).
Methods
assignToBot
The method assigns a bot to a session.
Parameters
Optional silent: undefined | false | true
Returns Promise<void>
assignToOperator
The method assigns an operator to a session.
Parameters
operator: UserItemRef
Returns Promise<void>
assignToOperatorGroup
The method assigns a group of operators to a session.
Parameters
userGroup: UserGroupItemRef
Returns Promise<void>
close
The method is used to close an active session.
Note that the script should be executed on behalf of the operator or bot assigned to the sessions. Other users cannot close the session.
await Context.data.session.close();
Returns Promise<void>
fetch
Request complete data of a reference object.
Returns Promise<LineSessionItem>
getAllMessages
The method returns all messages in a session.
Parameters
Optional from: undefined | number
Optional size: undefined | number
Returns Promise<LineMessageItem[]>
getLastMessage
The method returns the last message in a session.
const lastMessage = await Context.data.session. getLastMessage();
Returns Promise<LineMessageItem>
markAsSpam
The method marks a session as spam.
The data (metrics) of a session marked as spam are not taken into account when generating reports. The method is not available for the following types of channels:
internal
andsupport
(see LineChannelType).await Context.data.session.markAsSpam();
Returns Promise<void>
normalize
Delete duplicate data in arrays.
The method deletes duplicates in fields that store arrays of links to system objects (users, files, app items, or documents). For example, you can call this method after bulk editing data within an object.
const app1 = await Context.data.app1.fetch(); const app2 = await Context.data.app2 .fetch(); app1.data.executors.push(app2.data.executors); app1.normalize(); // Now we need to go over the elements in the new array app1.data.executors .forEach( ... );
Returns void
save
The method saves the session object.
This method is used to update the current session. The following fields are editable:
__name
and_apps
.const session = await Context.data.session.fetch(); session.data.__name = 'new session name'; session.data._apps.push(Context.data.lead); await session.save();
Returns Promise<void>
sendSystemMessage
The method sends a system message to a session.
Parameters
message: string
Returns Promise<LineMessageItem>
setPriority
The method is used to set a session’s priority.
await Context.data.session.setPriority(LineSessionPriority. Low);
Parameters
Optional priority: LineSessionPriorityEnumBase
Returns Promise<void>
unmarkAsSpam
The method deletes a session from spam.
The session is assigned to the operator who previously worked on it or added to the queue.
await Context.data.session.unmarkAsSpam();
Returns Promise<void>
Properties
Methods