< Back to Package Overview
SDK Operations
All SDK operations return a response. The response contains the status of the response. The status may be one of the following: OK, UNAUTHORIZED, BAD_REQUEST or ERROR
Customer Management API Operations
Get Customer Record
Parameters:
Parameter |
Required |
Data Type |
Description |
customerId |
false |
String |
Customer Id |
crmId |
false |
String |
CRM ID |
phone |
false |
String |
Phone |
email |
false |
String |
Email |
social |
false |
String |
Social Media Handle |
accountId |
false |
String |
Account Id |
accountType |
false |
String |
Account Type |
summaryDataOnly |
false |
Boolean |
Enable to return a data summary |
authHeader |
false |
String |
Authorization Header |
Return:
Code |
Type |
Message |
200 |
OK |
The request was successful. |
Get Customer Id
Parameters:
Parameter |
Required |
Data Type |
Description |
crmId |
false |
String |
CRM ID |
phone |
false |
String |
Phone |
email |
false |
String |
Email |
social |
false |
String |
Social Media Handle |
platform |
false |
String |
Social Media Platform used |
accountId |
false |
String |
Account Id |
accountType |
false |
String |
Account Type |
Return:
Code |
Type |
Message |
200 |
OK |
The request was successful. |
Get Customer Journey
Parameters:
Parameter |
Required |
Data Type |
Description |
workrequestId |
true |
String |
Work Request Id (context Id) |
topic |
false |
String |
Topic Name |
Return:
Code |
Type |
Message |
200 |
OK |
The request was successful. |
Get Customer Journey on Customer
Parameters:
Parameter |
Required |
Data Type |
Description |
customerId |
true |
String |
Customer Id |
topic |
false |
String |
Topic Name |
Return:
Code |
Type |
Message |
200 |
OK |
The request was successful. |
Create Customer Journey
Parameters:
Parameter |
Required |
Data Type |
Description |
requestBody |
true |
JSON |
Data object containing required key/value pairs (elementId or customerId) and optional fields include tenantId, threadId etc. |
authorization |
false |
String |
Authorization Header |
Return:
Code |
Type |
Message |
200 |
OK |
The request was successful. |
Update Customer Journey
Parameters:
Parameter |
Required |
Data Type |
Description |
requestBody |
true |
JSON |
Data object containing key/value pairs to add or overwrite |
elementId |
true |
String |
Work Request Id (context Id) |
authorization |
false |
String |
Authorization Header |
Return:
Code |
Type |
Message |
200 |
OK |
The request was successful. |
Get Customer Details
Parameters:
Parameter |
Required |
Data Type |
Description |
workrequestId |
true |
String |
Work Request Id |
customerId |
true |
String |
Customer ID |
Return:
Code |
Type |
Message |
200 |
OK |
The request was successful. |
Get Customer History
Parameters:
Parameter |
Required |
Data Type |
Description |
workrequestId |
true |
String |
Work Request Id |
Return:
Code |
Type |
Message |
200 |
OK |
The request was successful. |
Get Customer History on Customer
Parameters:
Parameter |
Required |
Data Type |
Description |
customerId |
true |
String |
Customer Id |
Return:
Code |
Type |
Message |
200 |
OK |
The request was successful. |
Context Store API Operations
Check Context Store Status
Parameters:
None
Return:
Code |
Type |
Message |
200 |
OK |
"Context Store cluster is UP" |
Create context
Parameters:
Parameter |
Required |
Data Type |
Description |
requestBody |
true |
JSON |
Context data object containing required key/value pairs (required) optional fields include contextId, groupId, tenantId etc. |
sid |
false |
String |
Session Id |
rid |
false |
String |
Routing identifier in geo-redundant deployment |
touchpoint |
false |
String |
User/application identifier for Audit Trail |
lease |
false |
Integer |
Context will be stored for period specified in lease |
rules |
false |
Boolean |
Set flag to set rules |
shortid |
false |
Boolean |
Set flag to request short generated contextId (less than 12 characters) |
Return:
Code |
Type |
Message |
200 |
OK |
empty string "" or JSON Object containing contextId (if it was not specified in request) |
Get context by contextId
Parameters:
Parameter |
Required |
Data Type |
Description |
contextId |
true |
String |
The contextId (for requests "by ContextId" only) |
sid |
false |
String |
Session Id |
rid |
false |
String |
Routing identifier in geo-redundant deployment |
touchpoint |
false |
String |
User/application identifier for Audit Trail |
Return:
Code |
Type |
Message |
200 |
OK |
JSON Object |
Get context by contextId with Meta Data
Parameters:
Parameter |
Required |
Data Type |
Description |
contextId |
true |
String |
The contextId (for requests "by ContextId" only) |
sid |
false |
String |
Session Id |
rid |
false |
String |
Routing identifier in geo-redundant deployment |
touchpoint |
false |
String |
User/application identifier for Audit Trail |
Return:
Code |
Type |
Message |
200 |
OK |
JSON Object |
Get context by aliasId
Parameters:
Parameter |
Required |
Data Type |
Description |
aliasId |
true |
String |
The aliasId(for requests "by AliasId" only) |
sid |
false |
String |
Session Id |
rid |
false |
String |
Routing identifier in geo-redundant deployment |
touchpoint |
false |
String |
User/application identifier for Audit Trail |
Return:
Code |
Type |
Message |
200 |
OK |
JSON Object |
Get context by aliasId with Meta Data
Parameters:
Parameter |
Required |
Data Type |
Description |
aliasId |
true |
String |
The aliasId(for requests "by AliasId" only) |
sid |
false |
String |
Session Id |
rid |
false |
String |
Routing identifier in geo-redundant deployment |
touchpoint |
false |
String |
User/application identifier for Audit Trail |
Return:
Code |
Type |
Message |
200 |
OK |
JSON Object |
Get value by contextId
Parameters:
Parameter |
Required |
Data Type |
Description |
contextId |
true |
String |
The contextId (for requests "by ContextId" only) |
key |
true |
String |
Key name to retrieve |
sid |
false |
String |
Session Id |
rid |
false |
String |
Routing identifier in geo-redundant deployment |
touchpoint |
false |
String |
User/application identifier for Audit Trail |
Return:
Code |
Type |
Message |
200 |
OK |
String |
Get value by aliasId
Parameters:
Parameter |
Required |
Data Type |
Description |
aliasId |
true |
String |
The aliasId(for requests "by AliasId" only) |
key |
true |
String |
Key name to retrieve |
sid |
false |
String |
Session Id |
rid |
false |
String |
Routing identifier in geo-redundant deployment |
touchpoint |
false |
String |
User/application identifier for Audit Trail |
Return:
Code |
Type |
Message |
200 |
OK |
String |
Get group
Parameters:
Parameter |
Required |
Data Type |
Description |
groupId |
true |
String |
The group Id |
sid |
false |
String |
Session Id |
rid |
false |
String |
Routing identifier in geo-redundant deployment |
touchpoint |
false |
String |
User/application identifier for Audit Trail |
Return:
Code |
Type |
Message |
200 |
OK |
JSON Object |
Get getContextIdByAliasId
Parameters:
Parameter |
Required |
Data Type |
Description |
aliasId |
true |
String |
The aliasId(for requests "by AliasId" only) |
sid |
false |
String |
Session Id |
rid |
false |
String |
Routing identifier in geo-redundant deployment |
touchpoint |
false |
String |
User/application identifier for Audit Trail |
Return:
Code |
Type |
Message |
200 |
OK |
JSON Object |
Get getAliasesByContextId
Parameters:
Parameter |
Required |
Data Type |
Description |
contextId |
true |
String |
The contextId (for requests "by ContextId" only) |
sid |
false |
String |
Session Id |
rid |
false |
String |
Routing identifier in geo-redundant deployment |
touchpoint |
false |
String |
User/application identifier for Audit Trail |
Return:
Code |
Type |
Message |
200 |
OK |
JSON Object |
Get audit trail by contextId
Parameters:
Parameter |
Required |
Data Type |
Description |
contextId |
true |
String |
The contextId (for requests "by ContextId" only) |
sid |
false |
String |
Session Id |
rid |
false |
String |
Routing identifier in geo-redundant deployment |
Return:
Code |
Type |
Message |
200 |
OK |
JSON Object |
Get audit trail by aliasId
Parameters:
Parameter |
Required |
Data Type |
Description |
aliasId |
true |
String |
The aliasId(for requests "by AliasId" only) |
sid |
false |
String |
Session Id |
rid |
false |
String |
Routing identifier in geo-redundant deployment |
Return:
Code |
Type |
Message |
200 |
OK |
JSON Object |
Update context by contextId
Parameters:
Parameter |
Required |
Data Type |
Description |
contextId |
true |
String |
The contextId (for requests "by ContextId" only) |
requestBody |
true |
JSON |
Context data object containing required key/value pairs (required). |
sid |
false |
String |
Session Id |
rid |
false |
String |
Routing identifier in geo-redundant deployment |
touchpoint |
false |
String |
User/application identifier for Audit Trail |
lease |
false |
Integer |
Context will be stored for period specified in lease |
rules |
false |
Boolean |
Set flag to set rules |
groupId |
false |
String |
The Group ID |
Return:
Code |
Type |
Message |
200 |
OK |
Empty String "" |
Update context by aliasId
Parameters:
Parameter |
Required |
Data Type |
Description |
aliasId |
true |
String |
The aliasId(for requests "by AliasId" only) |
requestBody |
true |
JSON |
Context data object containing required key/value pairs (required). |
sid |
false |
String |
Session Id |
rid |
false |
String |
Routing identifier in geo-redundant deployment |
touchpoint |
false |
String |
User/application identifier for Audit Trail |
lease |
false |
Integer |
Context will be stored for period specified in lease |
rules |
false |
Boolean |
Set flag to set rules |
groupId |
false |
String |
The Group ID |
Return:
Code |
Type |
Message |
200 |
OK |
Empty String "" |
Update value by contextId
Parameters:
Parameter |
Required |
Data Type |
Description |
contextId |
true |
String |
The contextId (for requests "by ContextId" only) |
key |
true |
String |
Key name to set |
value |
true |
String |
Value to set |
sid |
false |
String |
Session Id |
rid |
false |
String |
Routing identifier in geo-redundant deployment |
touchpoint |
false |
String |
User/application identifier for Audit Trail |
lease |
false |
Integer |
Context will be stored for period specified in lease |
rules |
false |
Boolean |
Set flag to set rules |
Return:
Code |
Type |
Message |
200 |
OK |
Empty String "" |
Update value by aliasId
Parameters:
Parameter |
Required |
Data Type |
Description |
aliasId |
true |
String |
The aliasId(for requests "by AliasId" only) |
key |
true |
String |
Key name to set |
value |
true |
String |
Value to set |
sid |
false |
String |
Session Id |
rid |
false |
String |
Routing identifier in geo-redundant deployment |
touchpoint |
false |
String |
User/application identifier for Audit Trail |
lease |
false |
Integer |
Context will be stored for period specified in lease |
rules |
false |
Boolean |
Set flag to set rules |
Return:
Code |
Type |
Message |
200 |
OK |
Empty String "" |
Update aliases by contextId
Parameters:
Parameter |
Required |
Data Type |
Description |
contextId |
true |
String |
The contextId (for requests "by ContextId" only) |
requestBody |
true |
JSON |
Context data object containing required key/value pairs (required). |
sid |
false |
String |
Session Id |
rid |
false |
String |
Routing identifier in geo-redundant deployment |
touchpoint |
false |
String |
User/application identifier for Audit Trail |
lease |
false |
Integer |
Context will be stored for period specified in lease |
rules |
false |
Boolean |
Set flag to set rules |
Return:
Code |
Type |
Message |
200 |
OK |
Empty String "" |
Update aliases by aliasId
Parameters:
Parameter |
Required |
Data Type |
Description |
aliasId |
true |
String |
The aliasId(for requests "by AliasId" only) |
requestBody |
true |
JSON |
Context data object containing required key/value pairs (required). |
sid |
false |
String |
Session Id |
rid |
false |
String |
Routing identifier in geo-redundant deployment |
touchpoint |
false |
String |
User/application identifier for Audit Trail |
lease |
false |
Integer |
Context will be stored for period specified in lease |
rules |
false |
Boolean |
Set flag to set rules |
Return:
Code |
Type |
Message |
200 |
OK |
Empty String "" |
Upsert context by contextId
(updates the context or creates it if it does not exist)
Parameters:
Parameter |
Required |
Data Type |
Description |
contextId |
true |
String |
The contextId (for requests "by ContextId" only) |
requestBody |
true |
JSON |
Context data object containing required key/value pairs (required). |
sid |
false |
String |
Session Id |
rid |
false |
String |
Routing identifier in geo-redundant deployment |
touchpoint |
false |
String |
User/application identifier for Audit Trail |
lease |
false |
Integer |
Context will be stored for period specified in lease |
rules |
false |
Boolean |
Set flag to set rules |
Return:
Code |
Type |
Message |
200 |
OK |
JSON Object |
Upsert context by aliasId
(updates the context or creates it if it does not exist)
Parameters:
Parameter |
Required |
Data Type |
Description |
aliasId |
true |
String |
The aliasId(for requests "by AliasId" only) |
requestBody |
true |
JSON |
Context data object containing required key/value pairs (required). |
sid |
false |
String |
Session Id |
rid |
false |
String |
Routing identifier in geo-redundant deployment |
touchpoint |
false |
String |
User/application identifier for Audit Trail |
lease |
false |
Integer |
Context will be stored for period specified in lease |
rules |
false |
Boolean |
Set flag to set rules |
Return:
Code |
Type |
Message |
200 |
OK |
Empty string "" or JSON Object containing contextId (if it was not specified in request) |
Delete context by contextId
Parameters:
Parameter |
Required |
Data Type |
Description |
contextId |
true |
String |
The contextId (for requests "by ContextId" only) |
sid |
false |
String |
Session Id |
rid |
false |
String |
Routing identifier in geo-redundant deployment |
Return:
Code |
Type |
Message |
200 |
OK |
Empty String "" |
Delete context by aliasId
Parameters:
Parameter |
Required |
Data Type |
Description |
aliasId |
true |
String |
The aliasId(for requests "by AliasId" only) |
sid |
false |
String |
Session Id |
rid |
false |
String |
Routing identifier in geo-redundant deployment |
Return:
Code |
Type |
Message |
200 |
OK |
Empty String "" |
Delete value by contextId
Parameters:
Parameter |
Required |
Data Type |
Description |
contextId |
true |
String |
The contextId (for requests "by ContextId" only) |
key |
true |
String |
Key name to retrieve |
sid |
false |
String |
Session Id |
rid |
false |
String |
Routing identifier in geo-redundant deployment |
touchpoint |
false |
String |
User/application identifier for Audit Trail |
Return:
Code |
Type |
Message |
200 |
OK |
Empty String "" |
Delete value by aliasId
Parameters:
Parameter |
Required |
Data Type |
Description |
aliasId |
true |
String |
The aliasId(for requests "by AliasId" only) |
key |
true |
String |
Key name to retrieve |
sid |
false |
String |
Session Id |
rid |
false |
String |
Routing identifier in geo-redundant deployment |
touchpoint |
false |
String |
User/application identifier for Audit Trail |
Return:
Code |
Type |
Message |
200 |
OK |
Empty String "" |
Delete alias by aliasId
Parameters:
Parameter |
Required |
Data Type |
Description |
aliasId |
true |
String |
The aliasId(for requests "by AliasId" only) |
sid |
false |
String |
Session Id |
rid |
false |
String |
Routing identifier in geo-redundant deployment |
touchpoint |
false |
String |
User/application identifier for Audit Trail |
Return:
Code |
Type |
Message |
200 |
OK |
Empty String "" |
Get EDM Entry
Parameters:
Parameter |
Required |
Data Type |
Description |
contextId |
true |
String |
The context Id |
diff |
false |
String |
Returns the audit trail changes between interactions |
data |
false |
String |
Returns the data associated with a Context |
metadata |
false |
String |
Returns the metadata associated with a Context |
schema |
false |
String |
Returns the internal schema data associated with a Context (internal use only) |
Return:
Code |
Type |
Message |
200 |
OK |
JSON Object |
Get EDM Entry Audit Trail
Parameters:
Parameter |
Required |
Data Type |
Description |
contextId |
true |
String |
The context Id |
diff |
false |
String |
Returns the audit trail changes between interactions |
data |
false |
String |
Returns the data associated with a Context |
metadata |
false |
String |
Returns the metadata associated with a Context |
schema |
false |
String |
Returns the internal schema data associated with a Context (internal use only) |
Return:
Code |
Type |
Message |
200 |
OK |
JSON Object |
Get EDM Group Audit Trail
Parameters:
Parameter |
Required |
Data Type |
Description |
groupId |
true |
String |
The group Id |
diff |
false |
String |
Returns the audit trail changes between interactions |
data |
false |
String |
Returns the data associated with a Context |
metadata |
false |
String |
Returns the metadata associated with a Context |
schema |
false |
String |
Returns the internal schema data associated with a Context (internal use only) |
Return:
Code |
Type |
Message |
200 |
OK |
JSON Object |
Customer Journey API Operations
Get Customer Journey
Parameters:
Parameter |
Required |
Data Type |
Description |
customerId |
true |
String |
Customer Id |
topic |
false |
String |
Topic Name |
Return:
Code |
Type |
Message |
200 |
OK |
The request was successful. |
Get Customer Journey via Element Id
Parameters:
Parameter |
Required |
Data Type |
Description |
elementId |
true |
String |
Element Id (Context Id) |
topic |
false |
String |
Topic Name |
before |
false |
String |
Only entries earlier than this time will be returned |
Return:
Code |
Type |
Message |
200 |
OK |
The request was successful. |
Get Customer Journey with Admin data via Element Id
Parameters:
Parameter |
Required |
Data Type |
Description |
elementId |
true |
String |
Element Id (Context Id) |
topic |
false |
String |
Topic Name |
before |
false |
String |
Only entries earlier than this time will be returned |
Return:
Code |
Type |
Message |
200 |
OK |
The request was successful. |
Get Last Journey Element
Parameters:
Parameter |
Required |
Data Type |
Description |
elementId |
true |
String |
Element Id (Context Id) |
topic |
false |
String |
Topic Name |
before |
false |
String |
Only entries earlier than this time will be returned |
Return:
Code |
Type |
Message |
200 |
OK |
The request was successful. |
Get Customer Journey via Account Id
Parameters:
Parameter |
Required |
Data Type |
Description |
accountId |
true |
String |
Account Id |
topic |
false |
String |
Topic Name |
Return:
Code |
Type |
Message |
200 |
OK |
The request was successful. |
Create Customer Journey
Parameters:
Parameter |
Required |
Data Type |
Description |
requestBody |
true |
JSON |
Data object containing required key/value pairs (elementId or customerId) and optional fields include tenantId, threadId etc. |
Return:
Code |
Type |
Message |
200 |
OK |
The request was successful. |
Update Customer Journey
Parameters:
Parameter |
Required |
Data Type |
Description |
requestBody |
true |
JSON |
Data object containing key/value pairs to add or overwrite |
elementId |
true |
String |
Element Id (Context Id) |
Return:
Code |
Type |
Message |
200 |
OK |
The request was successful. |
Update Agent Note
Parameters:
Parameter |
Required |
Data Type |
Description |
agentNote |
true |
String |
Agent note text |
interactionId |
true |
String |
Interaction Id |
Return:
Code |
Type |
Message |
200 |
OK |
The request was successful. |
Update Identifiers
Parameters:
Parameter |
Required |
Data Type |
Description |
requestBody |
true |
JSON |
Data object containing key/value pairs to add or overwrite |
elementId |
true |
String |
Element Id (Context Id) |
Return:
Code |
Type |
Message |
200 |
OK |
The request was successful. |
SDK Properties
client.version; // version of the JavaScript SDK
Logging SDK Events
The easiest way to log SDK events is to use the browser's native console API by implementing the following in your code
client.registerLogger(console);
Logger will then be executed internally in the SDK. Data Store Services Client SDK package for JavaScript uses 5 different logging levels.
-
Error: Client.Base.Logger.error('error message');
The execution of some task could not be completed (e.g. an email couldn't be sent, a page couldn't be rendered).
-
Warn: Client.Base.Logger.warn('warning message');
Something unexpected happened, but that execution can continue, perhaps in a degraded mode (e.g. a configuration file was missing but defaults were used). Warnings are often a sign that there will be an error very soon.
-
Info: Client.Base.Logger.info('info message');
Something normal but significant happened (e.g. system started, user logged in). Typical business exceptions can go here (e.g. login failed due to bad credentials).
-
Log: Client.Base.Logger.log('log message');
Logic information (e.g. result of an if statement)
-
Debug: Client.Base.Logger.debug('debug message');