No Results
Search Tips:
- Please consider misspellings
- Try different search keywords
Newer Version Available
preChatInit
Use the preChatInit method to access the custom details that have been passed into
the chat through the addCustomDetail Deployment API method.
Usage
Extracts the custom details that have been passed into the chat through the addCustomDetail Deployment API method and integrates them into a pre-chat form.
Syntax
liveagent.details.preChatInit(String chatUrl, function detailCallback, (optional) String chatFormName)
Parameters
| Name | Type | Description | Available Versions |
|---|---|---|---|
| chatUrl | String | The URL of the chat to retrieve custom details from. | Available in API versions 29.0 and later. |
| detailCallback | String | Name of the JavaScript function to call upon completion of the method. | Available in API versions 29.0 and later. |
| (Optional) chatFormName | String | The name of the HTML form tag for the pre-chat form to which to incorporate the custom details. | Available in API versions 29.0 and later. |
Responses
| Name | Type | Description | Available Versions |
|---|---|---|---|
| details | Object | An object containing all of the custom details that were included in the pre-chat form using the preChatInit method. | Available in API versions 29.0 and later. |
The details object
has a structure similar to the following example object:
1{
2 "geoLocation":{
3 "countryCode":"US",
4 "countryName":"United States",
5 "longitude":-122.4294,
6 "organization":"SALESFORCE.COM",
7 "latitude":37.764496,
8 "region":"CA",
9 "city":"San Francisco"
10
11 },
12 "customDetails":[
13 {
14 "label":"Email",
15 "value":"sonic@sega.com",
16 "transcriptFields":["Email__c"],
17 "entityMaps":[
18 {
19 "fieldName":"Email",
20 "isAutoQueryable":true,
21 "entityName":"Contact",
22 "isExactMatchable":true,
23 "isFastFillable":false
24 }]
25 },
26 {
27 "label":"Name",
28 "value":"Sonic H.",
29 "transcriptFields":[],
30 "entityMaps":[]
31 }
32 ],
33 "visitorId":"251a5956-bcbc-433d-b822-a87c062e681c"
34}detailCallback
The detailCallback method specifies the behavior that should occur after the preChatInit method returns the details object.
| Syntax | Parameters | Description | Available Versions |
|---|---|---|---|
|
details | Specifies the actions to occur after the custom details are retrieved using the preChatInit method. | Available in API versions 29.0 and later. |