Account Linking is a system response that takes the user through the sign-in workflow. In order to invoke the channel's system level response, you must set the following on your response:
"system": "ACCOUNT_LINK",
You can also set the context on the response to surface when the user has not linked their account.
"systemCondition": "!ACCOUNT_LINKED",
Example for Alexa & Google Assistant
To put this together for a more concrete example, the following works with the Alexa & Google Assistant channels.
{
"name": "User without linked account",
"system": "ACCOUNT_LINK",
"systemCondition": "!ACCOUNT_LINKED",
"outputSpeech": {
"displayText": "Welcome, before we get started I need you to login to your account from the Alexa app on your mobile device.",
"ssml": "Welcome, before we get started I need you to login from the Alexa app on your mobile device.",
"suggestions": []
},
"reprompt": {
"displayText": "Want me to walk you through it or are you good?",
"ssml": "Want me to walk you through it or are you good?",
"suggestions": []
},
"data": {
"context": "Welcome, in order to proceed"
}
}
To dissect this example, you can see the system & systemCondition keys which communicate it will perform the account linking flow for the channel and this response is only provided to those without a linked account.
On Alexa, this will send an account linking card to the user's Alexa app & communicate to the user they need to go to the app and sign-in.
On Google Assistant, this will ignore the outputSpeech & reprompt and instead use the context from the data object. Google Assistant has built-in language for asking the user to link their account that you can only customize the context.
${context}, I need to link your ${assistant name} account to Google. Is that okay?
The assistant name will be filled out for you by the Google Assistant but you get to set the context at the beginning. The Google Assistant will then also prefix your next response after they respond "yes" or "no".
For a "yes":
Great, your ${assistant name} account is now linked to Google. ${next response}
For a "no":
OK. Just so you know, that means you won't be able to use your account with ${assistant name}. If you change your mind, you can always come back and sign in then. ${next response}
To respond to these, you must provide a response with key SignIn, either on it's own handler or within the context of the current.
Comments
0 comments
Please sign in to leave a comment.