SlideShare a Scribd company logo
1 of 4
Download to read offline
CustomerState vs. SessionState
CustomerState is information associated with an individual mobile user. It should be used to store
permanent information associated with a mobile user, such as their name, their home address, and
other bits of information that is unique to a user and relevant to your eTXT application.

SessionState is information that is temporary, and lasts for approximately 60 minutes since the last
time a user responded to a message from your application. It should be used to track temporary
information that is only relevant for a particular “conversation” between the application and a
mobile user. Examples include the current page in an SMS “wizard”, as well as information
previously collected as part of that dialogue.

SessionState explained
Have you ever left your web-browser open on a secure page for a while not doing anything.....Then
you go back to it and click a link and it says "Sorry, your session has timed out please login again"?

A session in the eTXT API works in the same way. When 60 minutes have passed since the user last
interacted with an application, the system ends their session. When this expires, any temporary
information – such as where you were on a web page, the contents of your shopping cart, and other
temporary information, is gone.

Session information will be passed in the sessionstate member of the request object passed to your
application.

CustomerState explained
CustomerState is like the information that exists after you have logged into a web site. This
“permanent” information would include things like your name, your mailing address, and your credit
card details…something that should remain the same across multiple computers and browser
“sessions.”

CustomerState information in the eTXT API is information that will always be sent to the callback
URL irrespective of which session is currently active. It will be passed in the customerstate member
of the request object passed to your application.
Example JSON Code 1
This example demonstrates setting the customer state. Customer state, once set, will cross session
boundaries, and be sent each time until changed. This demonstrates a theoretical restaurant service
which finds restaurants near to a particular street location. It is triggered by sending #restaurant to
30000

        Request 1

        …HTTP Headers…
        {
               "customerstate":null,
               "id":"09883dc9-a90c-4bb6-b71f-73e94a56e618",
               "msg":"#restaurant",
               "sessionstate":null
        }

        Response 1

        …HTTP Headers…
        {
               "customerstate":null,
               "id":"09883dc9-a90c-4bb6-b71f-73e94a56e618",
               "msg":"Hello, what is your name?",
               "sessionstate":null
        }

        Request 2 (continuation of session)

        …HTTP Headers…
        {
               "customerstate":null,
               "id":"09883dc9-a90c-4bb6-b71f-73e94a56e618",
               "msg":"John",
               "sessionstate":null
        }

        Response 2

        …HTTP Headers…
        {
               "customerstate":”John”,
               "id":"09883dc9-a90c-4bb6-b71f-73e94a56e618",
               "msg":"Hello John, Reply with your street address",
               "sessionstate":null
        }
Example JSON Code (new session)
This shows use of session state, which is a temporary store of information that lasts for around 60
seconds. It also shows the persistence of customer state, which is passed again to the application
URL because it was set in a previous session. As before, it is triggered by sending #restaurant to
30000

        Request 1 (new session)

        …HTTP Headers…
        {
               "customerstate":”John”,
               "id":"09883dc9-a90c-4bb6-b71f-73e94a56e618",
               "msg":"#restaurant",
               "sessionstate":null
        }

        Response 1

        …HTTP Headers…
        {
               "customerstate":”John”,
               "id":"09883dc9-a90c-4bb6-b71f-73e94a56e618",
               "msg":"Hello John, what is street address?",
               "sessionstate":null
        }

        Request 2 (enter street address)

        …HTTP Headers…
        {
               "customerstate":”John”,
               "id":"09883dc9-a90c-4bb6-b71f-73e94a56e618",
               "msg":"7172 Hawthorn Ave",
               "sessionstate":null
        }

        Response 2

        …HTTP Headers…
        {
               "customerstate":”John”,
               "id":"09883dc9-a90c-4bb6-b71f-73e94a56e618",
               "msg":"What is your city?",
               "sessionstate":”7172 Hawthorn Ave”
        }
Request 3 (enter city)

…HTTP Headers…
{
       "customerstate":”John”,
       "id":"09883dc9-a90c-4bb6-b71f-73e94a56e618",
       "msg":"Los Angeles",
       "sessionstate":”7172 Hawthorn Ave”
}

Response 3

…HTTP Headers…
{
       "customerstate":”John”,
       "id":"09883dc9-a90c-4bb6-b71f-73e94a56e618",
       "msg":"Here are the restaurants near 7172 Hawthorn Ave: …",
       "sessionstate":”7172 Hawthorn Ave|Los Angeles”
}

More Related Content

Similar to Customer state v Session state

Eurosentiment - Developing a new service
Eurosentiment - Developing a new serviceEurosentiment - Developing a new service
Eurosentiment - Developing a new servicemario_munoz
 
Bringing Transactional Guarantees to MongoDB
Bringing Transactional Guarantees to MongoDBBringing Transactional Guarantees to MongoDB
Bringing Transactional Guarantees to MongoDBPaul Robinson
 
Small pieces loosely joined
Small pieces loosely joinedSmall pieces loosely joined
Small pieces loosely joinedennui2342
 
Mongo Web Apps: OSCON 2011
Mongo Web Apps: OSCON 2011Mongo Web Apps: OSCON 2011
Mongo Web Apps: OSCON 2011rogerbodamer
 
How to ship customer value faster with step functions
How to ship customer value faster with step functionsHow to ship customer value faster with step functions
How to ship customer value faster with step functionsYan Cui
 
Mongo db world 2014 billrun
Mongo db world 2014   billrunMongo db world 2014   billrun
Mongo db world 2014 billrunMongoDB
 
Powering Heap With PostgreSQL And CitusDB (PGConf Silicon Valley 2015)
Powering Heap With PostgreSQL And CitusDB (PGConf Silicon Valley 2015)Powering Heap With PostgreSQL And CitusDB (PGConf Silicon Valley 2015)
Powering Heap With PostgreSQL And CitusDB (PGConf Silicon Valley 2015)Dan Robinson
 
Hatohol technical-brief-20130830-hbstudy
Hatohol technical-brief-20130830-hbstudyHatohol technical-brief-20130830-hbstudy
Hatohol technical-brief-20130830-hbstudykoedoyoshida
 
Liquid Stream Processing Across Web Browsers and Web Servers
Liquid Stream Processing Across Web Browsers and Web ServersLiquid Stream Processing Across Web Browsers and Web Servers
Liquid Stream Processing Across Web Browsers and Web ServersMasiar Babazadeh
 
Streaming Way to Webscale: How We Scale Bitly via Streaming
Streaming Way to Webscale: How We Scale Bitly via StreamingStreaming Way to Webscale: How We Scale Bitly via Streaming
Streaming Way to Webscale: How We Scale Bitly via StreamingAll Things Open
 
LJC Conference 2014 Cassandra for Java Developers
LJC Conference 2014 Cassandra for Java DevelopersLJC Conference 2014 Cassandra for Java Developers
LJC Conference 2014 Cassandra for Java DevelopersChristopher Batey
 
Luciano Mammino - Cracking JWT tokens: a tale of magic, Node.JS and parallel...
Luciano Mammino  - Cracking JWT tokens: a tale of magic, Node.JS and parallel...Luciano Mammino  - Cracking JWT tokens: a tale of magic, Node.JS and parallel...
Luciano Mammino - Cracking JWT tokens: a tale of magic, Node.JS and parallel...Codemotion
 
Cracking JWT tokens: a tale of magic, Node.JS and parallel computing
Cracking JWT tokens: a tale of magic, Node.JS and parallel computingCracking JWT tokens: a tale of magic, Node.JS and parallel computing
Cracking JWT tokens: a tale of magic, Node.JS and parallel computingLuciano Mammino
 
MongoDB Stitch Introduction
MongoDB Stitch IntroductionMongoDB Stitch Introduction
MongoDB Stitch IntroductionMongoDB
 
mDevCamp 2016 - Zingly, or how to design multi-banking app
mDevCamp 2016 - Zingly, or how to design multi-banking appmDevCamp 2016 - Zingly, or how to design multi-banking app
mDevCamp 2016 - Zingly, or how to design multi-banking appPetr Dvorak
 
[WSO2Con EU 2017] Streaming Analytics Patterns for Your Digital Enterprise
[WSO2Con EU 2017] Streaming Analytics Patterns for Your Digital Enterprise[WSO2Con EU 2017] Streaming Analytics Patterns for Your Digital Enterprise
[WSO2Con EU 2017] Streaming Analytics Patterns for Your Digital EnterpriseWSO2
 
2011 05-23 metrics-agilasverige-english
2011 05-23 metrics-agilasverige-english2011 05-23 metrics-agilasverige-english
2011 05-23 metrics-agilasverige-englishMårten Gustafson
 

Similar to Customer state v Session state (19)

Eurosentiment - Developing a new service
Eurosentiment - Developing a new serviceEurosentiment - Developing a new service
Eurosentiment - Developing a new service
 
SignalR
SignalRSignalR
SignalR
 
Into The Box 2018 cbelasticsearch
Into The Box 2018   cbelasticsearchInto The Box 2018   cbelasticsearch
Into The Box 2018 cbelasticsearch
 
Bringing Transactional Guarantees to MongoDB
Bringing Transactional Guarantees to MongoDBBringing Transactional Guarantees to MongoDB
Bringing Transactional Guarantees to MongoDB
 
Small pieces loosely joined
Small pieces loosely joinedSmall pieces loosely joined
Small pieces loosely joined
 
Mongo Web Apps: OSCON 2011
Mongo Web Apps: OSCON 2011Mongo Web Apps: OSCON 2011
Mongo Web Apps: OSCON 2011
 
How to ship customer value faster with step functions
How to ship customer value faster with step functionsHow to ship customer value faster with step functions
How to ship customer value faster with step functions
 
Mongo db world 2014 billrun
Mongo db world 2014   billrunMongo db world 2014   billrun
Mongo db world 2014 billrun
 
Powering Heap With PostgreSQL And CitusDB (PGConf Silicon Valley 2015)
Powering Heap With PostgreSQL And CitusDB (PGConf Silicon Valley 2015)Powering Heap With PostgreSQL And CitusDB (PGConf Silicon Valley 2015)
Powering Heap With PostgreSQL And CitusDB (PGConf Silicon Valley 2015)
 
Hatohol technical-brief-20130830-hbstudy
Hatohol technical-brief-20130830-hbstudyHatohol technical-brief-20130830-hbstudy
Hatohol technical-brief-20130830-hbstudy
 
Liquid Stream Processing Across Web Browsers and Web Servers
Liquid Stream Processing Across Web Browsers and Web ServersLiquid Stream Processing Across Web Browsers and Web Servers
Liquid Stream Processing Across Web Browsers and Web Servers
 
Streaming Way to Webscale: How We Scale Bitly via Streaming
Streaming Way to Webscale: How We Scale Bitly via StreamingStreaming Way to Webscale: How We Scale Bitly via Streaming
Streaming Way to Webscale: How We Scale Bitly via Streaming
 
LJC Conference 2014 Cassandra for Java Developers
LJC Conference 2014 Cassandra for Java DevelopersLJC Conference 2014 Cassandra for Java Developers
LJC Conference 2014 Cassandra for Java Developers
 
Luciano Mammino - Cracking JWT tokens: a tale of magic, Node.JS and parallel...
Luciano Mammino  - Cracking JWT tokens: a tale of magic, Node.JS and parallel...Luciano Mammino  - Cracking JWT tokens: a tale of magic, Node.JS and parallel...
Luciano Mammino - Cracking JWT tokens: a tale of magic, Node.JS and parallel...
 
Cracking JWT tokens: a tale of magic, Node.JS and parallel computing
Cracking JWT tokens: a tale of magic, Node.JS and parallel computingCracking JWT tokens: a tale of magic, Node.JS and parallel computing
Cracking JWT tokens: a tale of magic, Node.JS and parallel computing
 
MongoDB Stitch Introduction
MongoDB Stitch IntroductionMongoDB Stitch Introduction
MongoDB Stitch Introduction
 
mDevCamp 2016 - Zingly, or how to design multi-banking app
mDevCamp 2016 - Zingly, or how to design multi-banking appmDevCamp 2016 - Zingly, or how to design multi-banking app
mDevCamp 2016 - Zingly, or how to design multi-banking app
 
[WSO2Con EU 2017] Streaming Analytics Patterns for Your Digital Enterprise
[WSO2Con EU 2017] Streaming Analytics Patterns for Your Digital Enterprise[WSO2Con EU 2017] Streaming Analytics Patterns for Your Digital Enterprise
[WSO2Con EU 2017] Streaming Analytics Patterns for Your Digital Enterprise
 
2011 05-23 metrics-agilasverige-english
2011 05-23 metrics-agilasverige-english2011 05-23 metrics-agilasverige-english
2011 05-23 metrics-agilasverige-english
 

Recently uploaded

Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Bhuvaneswari Subramani
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxRemote DBA Services
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 

Recently uploaded (20)

Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 

Customer state v Session state

  • 1. CustomerState vs. SessionState CustomerState is information associated with an individual mobile user. It should be used to store permanent information associated with a mobile user, such as their name, their home address, and other bits of information that is unique to a user and relevant to your eTXT application. SessionState is information that is temporary, and lasts for approximately 60 minutes since the last time a user responded to a message from your application. It should be used to track temporary information that is only relevant for a particular “conversation” between the application and a mobile user. Examples include the current page in an SMS “wizard”, as well as information previously collected as part of that dialogue. SessionState explained Have you ever left your web-browser open on a secure page for a while not doing anything.....Then you go back to it and click a link and it says "Sorry, your session has timed out please login again"? A session in the eTXT API works in the same way. When 60 minutes have passed since the user last interacted with an application, the system ends their session. When this expires, any temporary information – such as where you were on a web page, the contents of your shopping cart, and other temporary information, is gone. Session information will be passed in the sessionstate member of the request object passed to your application. CustomerState explained CustomerState is like the information that exists after you have logged into a web site. This “permanent” information would include things like your name, your mailing address, and your credit card details…something that should remain the same across multiple computers and browser “sessions.” CustomerState information in the eTXT API is information that will always be sent to the callback URL irrespective of which session is currently active. It will be passed in the customerstate member of the request object passed to your application.
  • 2. Example JSON Code 1 This example demonstrates setting the customer state. Customer state, once set, will cross session boundaries, and be sent each time until changed. This demonstrates a theoretical restaurant service which finds restaurants near to a particular street location. It is triggered by sending #restaurant to 30000 Request 1 …HTTP Headers… { "customerstate":null, "id":"09883dc9-a90c-4bb6-b71f-73e94a56e618", "msg":"#restaurant", "sessionstate":null } Response 1 …HTTP Headers… { "customerstate":null, "id":"09883dc9-a90c-4bb6-b71f-73e94a56e618", "msg":"Hello, what is your name?", "sessionstate":null } Request 2 (continuation of session) …HTTP Headers… { "customerstate":null, "id":"09883dc9-a90c-4bb6-b71f-73e94a56e618", "msg":"John", "sessionstate":null } Response 2 …HTTP Headers… { "customerstate":”John”, "id":"09883dc9-a90c-4bb6-b71f-73e94a56e618", "msg":"Hello John, Reply with your street address", "sessionstate":null }
  • 3. Example JSON Code (new session) This shows use of session state, which is a temporary store of information that lasts for around 60 seconds. It also shows the persistence of customer state, which is passed again to the application URL because it was set in a previous session. As before, it is triggered by sending #restaurant to 30000 Request 1 (new session) …HTTP Headers… { "customerstate":”John”, "id":"09883dc9-a90c-4bb6-b71f-73e94a56e618", "msg":"#restaurant", "sessionstate":null } Response 1 …HTTP Headers… { "customerstate":”John”, "id":"09883dc9-a90c-4bb6-b71f-73e94a56e618", "msg":"Hello John, what is street address?", "sessionstate":null } Request 2 (enter street address) …HTTP Headers… { "customerstate":”John”, "id":"09883dc9-a90c-4bb6-b71f-73e94a56e618", "msg":"7172 Hawthorn Ave", "sessionstate":null } Response 2 …HTTP Headers… { "customerstate":”John”, "id":"09883dc9-a90c-4bb6-b71f-73e94a56e618", "msg":"What is your city?", "sessionstate":”7172 Hawthorn Ave” }
  • 4. Request 3 (enter city) …HTTP Headers… { "customerstate":”John”, "id":"09883dc9-a90c-4bb6-b71f-73e94a56e618", "msg":"Los Angeles", "sessionstate":”7172 Hawthorn Ave” } Response 3 …HTTP Headers… { "customerstate":”John”, "id":"09883dc9-a90c-4bb6-b71f-73e94a56e618", "msg":"Here are the restaurants near 7172 Hawthorn Ave: …", "sessionstate":”7172 Hawthorn Ave|Los Angeles” }