Difference between revisions of "ATC/Current/SDK/api.session.getData"

From Genesys Documentation
Jump to: navigation, search
m (Text replacement - "\|Platform=([^\|]*)GenesysEngage-onpremises([\|]*)" to "|Platform=$1GenesysEngage-cloud$2")
(Published)
Line 6: Line 6:
 
|Dimension=api.session
 
|Dimension=api.session
 
|ComingSoon=No
 
|ComingSoon=No
|Platform=GenesysEngage-cloud, PureConnect, GenesysCloud
+
|Platform=PureConnect, GenesysCloud, GenesysEngage-cloud
|Prereq=
 
 
|Section={{Section
 
|Section={{Section
 +
|sectionHeading=About web messaging
 +
|anchor=WebMessaging
 +
|alignment=Vertical
 +
|structuredtext={{BarbFeatureTemp|Feature=Web messaging}}This article only applies to customers using web chat. If you are a Genesys Cloud customer, we encourage you to use the new {{Link-AnywhereElse|product=ATC|version=Current|manual=AdminGuide|topic=About_web_messaging|display text=web messaging}} feature to replace web chat.
 +
|Status=No
 +
}}{{Section
 
|sectionHeading=Description
 
|sectionHeading=Description
 
|anchor=Desc
 
|anchor=Desc
 
|alignment=Vertical
 
|alignment=Vertical
|Media=
 
|image=
 
 
|structuredtext=api.session.getData returns an object that contains the session Id, short Id, and customer cookie Id.
 
|structuredtext=api.session.getData returns an object that contains the session Id, short Id, and customer cookie Id.
|structuredtextwide=
 
|FAQHeading=
 
 
|Status=No
 
|Status=No
 
}}{{Section
 
}}{{Section
Line 22: Line 23:
 
|anchor=Signature
 
|anchor=Signature
 
|alignment=Vertical
 
|alignment=Vertical
|Media=
 
|image=
 
 
|structuredtext=<syntaxhighlight lang="javascript">
 
|structuredtext=<syntaxhighlight lang="javascript">
 
ac('api.session.getData', (err, sessionInfo) => {
 
ac('api.session.getData', (err, sessionInfo) => {
Line 34: Line 33:
 
});
 
});
 
</syntaxhighlight><br />
 
</syntaxhighlight><br />
|structuredtextwide=
 
|FAQHeading=
 
 
|Status=No
 
|Status=No
 
}}{{Section
 
}}{{Section
Line 41: Line 38:
 
|anchor=Example
 
|anchor=Example
 
|alignment=Vertical
 
|alignment=Vertical
|Media=
 
|image=
 
 
|structuredtext=The following is an example of an object that is returned by api.session.getData:<syntaxhighlight lang="javascript">
 
|structuredtext=The following is an example of an object that is returned by api.session.getData:<syntaxhighlight lang="javascript">
 
{
 
{
Line 50: Line 45:
 
}
 
}
 
</syntaxhighlight><br />
 
</syntaxhighlight><br />
|structuredtextwide=
 
|FAQHeading=
 
 
|Status=No
 
|Status=No
 
}}{{Section
 
}}{{Section
Line 57: Line 50:
 
|anchor=Callback
 
|anchor=Callback
 
|alignment=Vertical
 
|alignment=Vertical
|Media=
 
|image=
 
 
|structuredtext=The callback takes err as the first parameter.
 
|structuredtext=The callback takes err as the first parameter.
|structuredtextwide=
 
|FAQHeading=
 
 
|Status=No
 
|Status=No
 
}}
 
}}
 
}}
 
}}

Revision as of 13:19, December 15, 2020

This topic is part of the manual Journey JavaScript SDK for version Current of Genesys Predictive Engagement.

Learn how to obtain the data such as the short ID for a particular customer's session.

About web messaging

Feature coming soon: Web messaging

This article only applies to customers using web chat. If you are a Genesys Cloud customer, we encourage you to use the new web messaging feature to replace web chat.

Description

api.session.getData returns an object that contains the session Id, short Id, and customer cookie Id.

Signature

ac('api.session.getData', (err, sessionInfo) => {
  if (err) {
    // handle error
    return;
  }
  
  return sessionInfo;
});

Example

The following is an example of an object that is returned by api.session.getData:
{
  id: <uuid>
  shortId: 12345
  customerCookieId: <uuid>
}

Callback

The callback takes err as the first parameter.

Comments or questions about this documentation? Contact us for support!