Alexa Speciality Exam Deck Flashcards

1
Q

Adaptability

A

Can understand and process what a user says appropriately

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Personalization

A

Remembers interactions with and information about the user

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Availability

A

A skill that is acailable is designed to guide users and keep all options open.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Relatability

A

A skill that is relatable allows the user to feel like they are having a conversation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Utterance

A

What the user says to Alexa to begin or continue using the dialog

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Situation

A

Determine the context. For example, is this a new user or a returning use?

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Prompt

A

Alexas prompt back to the user to continue the conversation.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Response

A

Determine how Alexa will respond to the user.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Which of the following are ways that a user can interact with an Amazon Alexa skill using both voice and non-voice methods? (Choose three.)

A

Pausing a video
Muting the device
Pairing with Bluetooth

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

An Alexa Skill Builder wants a skill to inform the users of the number of times they have launched the skill. What approach should the Builder take to track this information?

A

Persistent attribute
Note: Persistent attributes are only available when you configure the skill instance with a PersistenceAdapter. Calls to the AttributesManager to retrieve and save persistent attributes will throw an error if a PersistenceAdapter has not been configured.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

On Amazon Alexa enabled devices with a screen, which of the following standard built-in intents are handled by Alexa on the skill’s behalf and are not forwarded to the skill? (Choose three.)

A

C. AMAZON.ScrollDownIntent
E. AMAZON.StartOverIntent
F. AMAZON.NavigateHomeIntent

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

An Alexa Skill Builder needs to set up an Amazon Alexa skill beta test. What user identifier should be used to add beta testers?

A

Alexa user email address

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

An Alexa Skill Builder is developing a custom skill to play a live audio stream. What two built-in intents are required to implement the AudioPlayer interface?

A

AMAZON.PauseIntent

AMAZON.ResumeIntent

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

The interaction model for a custom skill has the following limits:

A

Number of intents in a skill – 250
Number of slot types and intents combined – 350
Number of characters allowed in a single slot value – 140
Number of characters allowed for a slot value synonym – 140

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

The interaction model must have:

A
An invocation name specified in Invocation > Skill Invocation Name
        At least one intent with sample utterances defined in Intents
        Slot Types (if any of your custom intents include slots)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

An Alexa Skill Builder has published a skill to the Alexa Skills Store, but soon after realizes that Amazon Alexa is saying an incorrect word in one of the responses.
What is the recommended method for the Builder to correct this issue?

A

Access the In Development version of the skill, alter the intent that was causing the incorrect word, then resubmit the skill for certification.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

An Alexa Skill Builder needs to change the invocation name of a new skill.
What status should the skill be in to make this change?

A

In Development

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

An Amazon Alexa interactive story skill needs to provide users with the option to resume the skill from where users left off when they last used the skill.
Where should the data be stored to ensure that the skill will start at the correct location?

A

In Amazon DynamoDB

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

An Alexa Skill Builder is developing a custom skill and needs to verify that the correct slot values are being passed into the AWS Lambda function.
According to best practices, what is the MOST efficient way to capture this information?

A

CloudWatch Logs should be the easiest way to capture the value.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

An Alexa Skill Builder submitted a child-directed skill for certification that lists the nearest skateboard parks. The Builder ensured that
✑ The skill does not link to an external account
✑ The skill stored the child’s preference by userId
✑ The skill has a valid privacy policy link in the skill Distribution page
Given this information, why will the skill fail certification?

A

The child’s userId cannot be used because of Personally Identifiable Information (PII) restrictions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

The namespace value in the header of the incoming directive for an Amazon Alexa smart home skill specifies the:

A

control message for the directive

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

According to Amazon Alexa best practices, how should an Alexa Skill Builder prevent unintentional requests against a skill’s backend when using AWS Lambda?

A

Provide the Lambda trigger with the Application ID so that it validates on the ask trigger.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

An Alexa Skill Builder would like to improve a skill’s help experience. To do this, the Builder plans to leverage the user’s activity leading up to the help request to contextualize the help response.
Where should the skill obtain the necessary context?

A

Use a session attribute to store the intent name for each request, then use this to provide context to the AMAZON.HelpIntent request.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

An Alexa Skill Builder adds a colleague to a skill using the beta test feature. The colleague logs in to the developer console to edit the interaction model and cannot see the skill.
Why is this happening?

A

The colleague has not been added to the skill’s developer account.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

An Amazon Alexa skill fetches data for users from a third-party API and the wait for the response from that call is variable, often taking up to 5 seconds.
What is the recommended method for notifying users that a skill is working on the request and has not failed to respond?

A

Call the Progressive Response API and send a directive, such as VoicePlayer.Speak

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

An Alexa Skill Builder has created a custom skill about basketball including a HowToPlayBasketball intent. When looking at the Intent History page in the developer console, the Builder sees that a number of users are asking the skill how to play baseball. The Builder wants to add a relevant response directing the user back to the topic of basketball.
How should the Builder implement this?

A

Add AMAZON.FallbackIntent and respond with a message about baseball in the handler

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

An Alexa Skill Builder is using session attributes to maintain a user’s state.
What can the Builder do to ensure that a user’s session is not lost if they take too long to answer a question and the skill exits?

A

Set shouldEndSession to false in the response object to prevent the skill from exiting.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
28
Q

A travel booking skill has slot elicitation for fromCity, toCity, and travelDate inside of a dialog. After going live, the skill is getting negative reviews stating that the skill does not understand the city names when customers try to book travel.
The Alexa Skill Builder adds AMAZON.FallbackIntent to the interaction model with the goal of providing better messaging for out-of-domain utterances.
Why will the addition of AMAZON.FallbackIntent fail to resolve the customer issue?

A

AMAZON.FallbackIntent will not be triggered in the middle of a dialog.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
29
Q

An Alexa Skill Builder is developing a skill that must send an initial welcome email to each new user.
What combination of features would the Builder use to satisfy this requirement? (Choose two.)

A

Alexa Settings API

Customer Profile API

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
30
Q

An Alexa Skill Builder is using Amazon S3 to stream large quantities of static audio and video content throughout the world with an Amazon Alexa skill.
Which additional AWS service will help the Builder decrease latency and improve the reliability of the streaming media content for the global audience?

A

Amazon CloudFront

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
31
Q

An Alexa Skill Builder needs to have knowledge of the previous prompt that was presented to the user in order to give context to the user’s response.
How can the Builder accomplish this?

A

Call the Intent Request History API to identify which prompt was used.

32
Q

What are the prerequisites for implementing account linking for Amazon Alexa smart home skills?

A

OAuth 2.0 with authorization code grant flow

33
Q

An Alexa Skill Builder is developing a skill that enables users to purchase train tickets. The Builder wants to give users the ability to modify the departure time if they are misunderstood, before the skill proceeds to purchase the tickets.
Which option should be used to implement this functionality within the session?

A

Implement AMAZON.CancelIntent so the user can cancel the order, then set shouldEndSession to false, and prompt the user for the next action.

34
Q

An Alexa Skill Builder built a skill using AWS Lambda. The Lambda function works when running the code on a local machine with a runtime of 4.5 seconds, but during skill testing, the Builder receives an error response.
Which collection of steps will address the issue? (Choose two.)

A

Clone the Lambda function to another AWS Region.

Change the default timeout of the Lambda function to 5 seconds.

35
Q

An Alexa Skill Builder wants to name a skill using a company’s branded acronym, “NAT Systems.”
Which invocation name is valid?

A

n. a. t. systems

36
Q

An Alexa Skill Builder is building an interactive storytelling skill where the user can choose their own path through the story. The Builder wants Amazon Alexa to narrate the story and use custom audio for the dialogue for each character, along with various sound effects.
How can these requirements be met?

A

Record custom audio for each segment of the story, then stream audio files stored on Amazon S3 using the AudioPlayer interface for each segment of the story.

37
Q

An Alexa Skill Builder is interested in gathering information about returning users.
What analytics tool in the developer console would provide the Builder with this information?

A

Retention

38
Q

An Alexa Skill Builder needs to display an image and some additional text to users of a skill.
Which approach will work with any Amazon Alexa enabled device?

A

Send a Standard card to the user.

39
Q

An Alexa Skill Builder receives feedback from users that a specific utterance causes Amazon Alexa to trigger the skill’s AMAZON.HelpIntent rather than triggering the correct intent and slot.
How can the Builder reproduce this behavior to troubleshoot the problem?

A

Use the Alexa Simulator tab on the Test page of the developer console to test the utterances the users have reported.

40
Q

An Alexa Skill Builder wants to add a short audio clip to a skill with SSML. The Builder records a 6-second audio clip using a high-end microphone and recording application and exports the file with a bitrate of 48 kbps. The file is then uploaded to a public Amazon S3 bucket.
The Builder then updates the SSML to return:

When testing the skill, Amazon Alexa responds with “There was a problem with the requested skill’s response” every time.
How should the Builder resolve this error?

A

Re-export the audio file to .mp3 instead of .wav

41
Q

During testing of a new Amazon Alexa skill, the skill is repeatedly failing and invoking the function defined in the addErrorHandler method specified on the
SkillBuilder object. Upon inspection of Amazon CloudWatch Logs, the Alexa Skill Builder establishes that the failure is occurring whenever
AMAZON.HelpIntent is being received.
How should this error be corrected?

A

The Builder should ensure that the intent handler is coded so that it tests for AMAZON.HelpIntent in its canHandle method, and when detected, returns true.

42
Q

An Amazon Alexa trip planner skill has several intents and slots. One of the intents is PlanMyTripIntent and some of the slots are fromCity, toCity, departDate, and returnDate. The following is a sample dialog:
User: Ask plan my trip to start a new trip leaving from Seattle.
Alexa: You said you are leaving from Seattle, right?

User: Yes -
Alexa: I’ve saved your trip. Do you want to create another trip?

User: Yes -
What will be invoked upon the user’s final “Yes”?

A

AMAZON.YesIntent

43
Q

An Alexa Skill Builder made changes to an AWS Lambda function that is used as the endpoint for a skill. The Builder discovers that the skill now returns an error when it is launched.
How can the Builder use the Lambda console to trigger the function and debug the code?

A

Create a Lambda test event using the JSON request as input to find the specific error within the code.

44
Q

An Alexa Skill Builder has created a taxi hiring skill. The skill needs to find out when the customer wants a taxi, where the customer is traveling from, and where the customer wants to go. The Builder is currently asking each question individually, in the following order: “Where do you want to take a taxi from” “Where do you want to take a taxi to” “When do you need a taxi”
To ensure the voice interaction is flexible, how should this information be gathered regardless of the order in which the user provides it?

A

Create a single intent with three slots. Use the Dialog.Delegate directive to fill the slots.

45
Q

Which of the following occur when a beta test of a live skill times out? (Choose two.)

A

The beta tester will lose access to the beta skill and will need to reenable the live skill
The beta tester will receive an email saying the beta test has ended

46
Q

When testing an Amazon Alexa skill using the Test page in the developer console, the JSON output is null.
What is the MOST likely cause?

A

The endpoint ARN has not been configure

47
Q

An Alexa Skill Builder published a skill that streams sounds to help users relax. The skill is becoming very popular and is available in many different locales around the world. More than 20.000 users are using the skill every week, and more than 500 users are added daily. The sound files are stored in Amazon S3.
What can the Builder do to ensure low latency and the best possible streaming performance?

A

Use Amazon CloudFront to deliver content and cache the audio files across different geographical regions.

48
Q

A skill that can handle just about any type of request.

For example:

Look up information from a web service
Integrate with a web service to order something (order a car from Uber, order a pizza from Domino's Pizza)
Interactive games
Just about anything else you can think of
A

Custom skill (custom interaction model)

You define the requests the skill can handle (intents) and the words users say to invoke those requests (utterances).

49
Q

A skill that lets a user control and query cloud-enabled smart home devices such as lights, door locks, cameras, thermostats and smart TVs.

For example:

Turn lights on and off
Change the brightness of dimmable lights
Change the color or color temperature of a tunable light
Change the temperature on a thermostat
Query a lock to see if it is currently locked
Ask for a smart home camera feed
Change the volume on a speaker
Change the channel of a TV
A

Smart Home Skill API (pre-built model)

The Smart Home Skill API defines the requests the skill can handle (device directives) and the words users say to invoke those requests (utterances).

50
Q

A skill that lets a user control cloud-enabled video services.

For example:

Play a movie
Find a TV show
Change a channel
Pause, rewind, or fast forward video content
A

Video Skill API (pre-built model)

The Video Skill API defines the requests the skill can handle (device directives) and the words users say to invoke those requests (utterances).

51
Q

A skill that provides original content for a customer’s flash briefing.

A

Flash Briefing Skill API (pre-built model)

The Flash Briefing Skill API defines the words users say to invoke the flash briefing or news request (utterances) and the format of the content so that Alexa can provide it to the customer.

52
Q

A skill that enables users to select, listen to, and control audio content streamed through an Alexa-enabled device.

A

Music Skill API

When you build a music skill, the voice interaction model is defined and handled for you. Alexa interprets user utterances and sends messages to your skill that communicate these requests.

53
Q

There are some important considerations to keep in mind when you plan to include audio files in your skill:

A

If you want to use audio to ask a question, you must include a separate and appropriate re-prompt. You must associate the re-prompt with the question so that you can play it for a customer when necessary.
When it’s the skill’s turn to speak to the customer and you expect the customer to reply, make each turn 90 seconds or less.

54
Q

Use short-form audio

A

Audio clips that are less than 240 seconds are considered short-form audio. Short-form audio allows the skill session to remain open, which means that the customer doesn’t have to re-invoke the skill by saying “Alexa” again. Use short-form audio when you expect additional interaction with the customer after playing the audio clip.

File type: .mp3
Specification: 16000 Hz w/ bitrate (48 kbps)
Length: Up to 240 seconds
55
Q

Use long-form audio

A

If you have an audio-based skill such as a podcast, you use long-form audio. Audio clips that are more than 240 seconds are considered long-form audio. When the audio starts playing, the skill closes. The customer can control the audio by making requests without the invocation name, for example by saying, “Alexa, next.” To interact with the skill again, the customer can invoke the skill by saying, “Alexa” and the invocation name.

Use long-form audio when you expect the user interaction to consist of audio-control requests. Your skill can also add new audio files to the queue for continuous playback, such as with a playlist.

File types: .acc .mp4 .mp3 .hls .pls .m3u
Specification: Bitrates from 16 kbps to 384 kbps
Length: Anything over 240 seconds with no maximum time limit
56
Q

Use speechcons

A

A speechcon is a special word or phrase that is distinctive enough to represent a specific event or convey other information to a customer. For example, a word signaling the successful completion of an action. Speechcons can help bring your skill to life while also connecting with the customer in a way that strengthens your conversation. For more information about using speechcons in your skill, see Speechcon Reference

57
Q

Use audio interstitials

A

An audio interstitial is a sound file that would be played to bridge together two areas of the flow. This includes areas like intros and outros, as well as times of transition. You can use the interstitials to cue the customer to a change in soundscape and help paint an audio picture of where they are heading next.

58
Q

Understand product offerings

A

Subscriptions: customers pay a flat monthly fee to access content or services, such as monthly access to all content channels (sports, news, and comedy) in a podcast service. You charge customers on a recurring basis until they decide to cancel.
Entitlements: you charge a one-time payment for access to a premium feature that is always be available to the customer. For example, customers purchase a theme pack in a trivia skill that they can play over and over again.
Consumables: you require a one-time payment for an experience that customers use once and then it is removed from the skill. For example, you sell a hint in a game or an extra chance to play another turn. You can sell consumables individually, in packages, or only allow repeat purchases after the customer has used up all consumables.

59
Q

Amazon Pay for Alexa Skills

A

Amazon Pay for Alexa Skills uses a voice purchasing flow to sell real-world goods and services (like event tickets, transportation, and flower delivery). Amazon Pay for Alexa Skills enables Alexa users to pay seamlessly using payment information already stored in their Amazon accounts.

An Amazon Payments Merchant account to handle the payment processing flows
An Amazon Developer account to create and launch your skill
Alexa Skills Kit SDK (ASK) SDK to build your skill
60
Q

Create the Interaction Model for Your Skill

A
Intents: An intent represents an action that fulfills a user's spoken request. Intents can optionally have arguments called slots. Intents are specified in a JSON structure called the intent schema.
    Sample utterances: A set of likely spoken phrases mapped to the intents. This should include as many representative phrases as possible.
    Custom slot types: A representative list of possible values for a slot. Custom slot types are used for lists of items that are not covered by one of Amazon's built-in slot types.
    Dialog model (optional): A structure that identifies the steps for a multi-turn conversation between your skill and the user to collect all the information needed to fulfill each intent. This simplifies the code you need to write to ask the user for information.
61
Q

You can use the developer console to define a dialog model. The dialog model is a structure that identifies:

A

The slots that must be filled with valid values in order to fulfill the intent. These are considered required slots.
The prompts Alexa speaks to ask for required slot values and the utterances users can say in reply.
Whether any of the required slots must be also confirmed by the user before continuing.
Whether the entire intent must be confirmed by the user before continuing.
The prompts Alexa speaks to ask for slot and intent confirmations.
Any slot validation rules that the slot value provided by the user must pass to be considered valid. These rules can be used with both required and non-required slots.
The prompts Alexa speaks to ask for a corrected value when the user’s response fails slot validation.

62
Q

Save and build the model

As you create and edit your interaction model and dialog model, save your work with the Save Model button. This saves your data, but does not build the model.
Important: The developer console does not automatically save your work as you make changes. If you close the browser window without clicking Save Model, your work is lost.

When you are ready to test your interaction model, go to any of the sections under Custom, Interaction Model. Then click Build Model to validate, save, and build your interaction model. You can continue to make changes, but they won’t be reflected in the build.

The build happens in two stages:

A

Quick build – The quick build is done in as little as a few seconds, and enables you to begin testing your skill. When the quick build succeeds, the developer console displays a message. After the quick build, the majority of sample utterances, though not necessarily all, work correctly. The following are not available for testing until the full build is done:
The dialog model.
The FallbackIntent.
Anything that’s not specified in the sample utterances and slot values.
Full build – The full build can take up to one minute. After the full build is done, all the parts of the model are built and ready to be tested.

You must successfully build the model, either a quick build or a full build, before you can test it. The developer console displays a success message when each stage of the build is done. You can also check the status of the build with the Alexa Skills Kit Command Line Interface (ASK CLI) get-skill-status command or the Skill Management API (SMAPI) GET skill status request.

63
Q

Test and improve your interaction model

A

As you build your skill, you can test and improve your interaction model.

Check for utterance conflicts that may cause Alexa to send the wrong intent to your skill.
Use the utterance profiler to test individual utterances. You can enter utterances and see how they resolve to the intents and slots.
Use the NLU evaluation tool to create and run a set of tests against your model. With this tool, you create a set of utterances mapped to the intent and slots you expect for each one. Then you run an evaluation and test how well you skill's natural language understanding (NLU) model performs against your expectations. This can be especially useful for regression testing as you iterate on your interaction model.

These tools do not call your endpoint, so you can use them any time after you build your interaction model.

64
Q

Interaction model limits

A

The interaction model for a custom skill has the following limits:

Number of intents in a skill – 250
Number of slot types and intents combined – 350
Number of characters allowed in a single slot value – 140
Number of characters allowed for a slot value synonym – 140
65
Q

audio

A

src

Specifies the URL for the MP3 file. Note the following requirements and limitations:

The MP3 must be hosted at an Internet-accessible HTTPS endpoint. HTTPS is required, and the domain hosting the MP3 file must present a valid, trusted SSL certificate. Self-signed certificates cannot be used.
The MP3 must not contain any customer-specific or other sensitive information.
The MP3 must be a valid MP3 file (MPEG version 2).
For your speech response, the audio file cannot be longer than 240 seconds.
The combined total time for all audio files in the outputSpeech property of the response cannot be more than 240 seconds.
The combined total time for all audio files in the reprompt property of the response cannot be more than 90 seconds.
The bit rate must be 48 kbps. Note that this bit rate gives a good result when used with spoken content, but is generally not a high enough quality for music.
The sample rate must be 22050Hz, 24000Hz, or 16000Hz.

You may need to use converter software to convert your MP3 files to the required codec version (MPEG version 2) and bit rate (48 kbps).

66
Q

Hosting the audio files for your skill

A

The MP3 files you use to provide audio must be hosted on an endpoint that uses HTTPS. The endpoint must provide an SSL certificate signed by an Amazon-approved certificate authority. Many content hosting services provide this. For example, you could host your files at a service such as Amazon Simple Storage Service (Amazon S3) (an Amazon Web Services offering).

We don’t require that you authenticate the requests for the audio files. Therefore, you must not include any customer-specific or sensitive information in these audio files. For example, building a custom MP3 file in response to a user’s request, and including sensitive information within the audio, is not allowed.

For optimal performance, we recommend that you host your MP3 files for SSML responses in close proximity to where your skill is hosted. For example, if the Lambda function for your skill is hosted in the US West (Oregon) region, you will get better performance if you upload your MP3s to a US West (Oregon) S3 bucket.

67
Q

HTTP Live Streaming (HLS) of audio files

A

Alexa supports SSML audio tags that point toward HTTP Live Streaming (HLS) streams, provided that the audio data conforms to the listed specifications. Due to the streaming approach that Alexa uses, there is no benefit to using HLS streams instead of statically served MP3 files. Furthermore, unlike with statically served MP3 files, an SSML response that contains an HLS stream that violates the 240-second duration limit will fail silently. This silent failure means that the playback is stopped before the limit is hit, no error message is generated on the customer device, and the skill does not receive an error request. If your skill uses SSML responses that contain HLS streams, ensure that you take particular care to test the audio returned in its responses.

68
Q

Prerequisites to smart home skill development

A

In order to develop a smart home skill you must have the following:

An Amazon developer account. Sign up is free.
A connected device such as a light, thermostat, camera, lock, or other device with a cloud API to control it.
An Alexa-enabled device such as Amazon Echo.
An AWS account. You host your skill code in an AWS Lambda function.
Knowledge of JSON and one of the supported languages for AWS Lambda: Node.js, Java, Python, C#, or Go.
Understanding of OAuth 2.0.
69
Q

Application-Level State Management

A

Examples of application-level state management include settings that are truly global across your entire application. These are settings that need to apply to all users in all situations. These may include things like environment variables or connection strings.

If you are using AWS Lambda, be aware that any global variables you declare in your Lambda code will get reused by different users when the Lambda container is recycled. This is behavior that you can’t control. But if you don’t plan for it, you’ll discover exciting new bugs as soon as your Lambda starts running at scale under the real user load! This explains why one customer may ask for cat facts, and end up hearing dog facts instead - because a Lambda container initialized with a ‘factType=dog’ variable got recycled. It also explains why you might not have caught these bugs in testing – because you didn’t test under enough load to force container re-use.

If you truly need application-level state management, you can rely on Lambda global variables. This is most beneficial when setting up these variables is costly and involves reading from a slow data store. In cases like these, you can limit this performance hit to only the cases where the global variables are not already initialized.

70
Q

Session-Level State Management

A

To better understand session-level state management, let’s start with a definition of an Alexa session. The blue lights on your Alexa device are your friend! An Alexa session starts when the user invokes your skill, turning on the light ring. This is the request. Your skill will formulate a response which will then be spoken to the user.

With this response, you control what happens next. Your skill’s response will include the shouldEndSession boolean parameter. When set to true, the session ends with the delivery of the response, turning off the blue lights. But if this parameter is false, you’re indicating that Alexa should open the stream for another request following the delivery of the response. The blue light will be on, and your session remains active.

If the user doesn’t respond, the reprompt that you specified will be delivered and the stream will remain open for one last chance at a new request. If the user still doesn’t respond, the stream will close and the session will end when the blue light turns off.

During this time while your skill’s session is active, requests sent to Alexa are directed to the sandbox of your skill. You’ll notice that even utterances like “volume up” are directed to your skill. This is true until your session ends.

One exception to the above is the use of the AudioPlayer interface. If your skill uses this interface, your skill session ends as soon as your skill sends a play directive. Your skill may get reinvoked through one of the built-in intents for playback control or any other invocation pattern, but this results in a new skill session.

You can manage state within the context of your Alexa session using the session object. LaunchRequest, IntentRequest, and SessionEndedRequest all include a session object in the JSON definition. Any session-level data that you need to track can be sent with your response object in the sessionAttributes property as key/value pairs. They will be passed back to you with the next request object.

There are some built-in properties that may also be useful to you: session.user.userID and session.user.accessToken.

UserId is automatically generated by the Alexa service when the user enables your skill. As a result, this value can be used to track the same user from one session to the next. However, if the user disables and re-enables your skill, they will appear to be a new user to you.
AccessToken is returned to you only if your skill uses account linking (and the user has successfully linked your skill to their account).

The Alexa Node.js SDK provides additional tools to make it even easier to work with session state, allowing you to easily switch between session state and user state with a very minor code changes.

71
Q

Session State vs. User State

A

If you have a simple multi-turn game, you may be fine using the Alexa session state to persist the game state while the session is in progress. If you are only relying on the Alexa session state, each new session means the start of a new game.

However, if you want a game to span multiple sessions, you’ll need to manage state at the user level. You can do this in a lightweight, best-effort way by observing the UserID returned in the request body. Just be aware that this ID will change if the user disables and re-enables your skill. That’s what makes this approach best-effort.

The user state is the state that you maintain for the same user across multiple sessions. Compared to the session state, the user state has the ability to offer an improved experience by allowing a game to continue across sessions. In other applications, it becomes essential to track the state at the user level. For example, you may need to share state between multiple applications. For example, your customers may interact with multiple web services, mobile apps, and chatbots in addition to your Alexa skill. If you need to persist any information about the user across these different end points, the Alexa session state will not accomplish this. In this situation, you must manage the state externally.

72
Q

User-Level State Management

A

If you require user-level state management, you’ll have to maintain an external data store to persist this state information. Your external data store could be a DynamoDB table, S3 bucket, or any other external data store. The advantages are many, but they come at a cost. There is a financial cost to running these services. There’s also a performance (latency) cost in reading/writing from external data stores. There are also additional factors to consider, like code complexity, maintenance, scaling, and so on. You will also need to consider the security and privacy implications of persisting potentially sensitive user information.

The process of selecting a specific external data store is beyond the scope of this article. The criteria will be influenced by the different endpoints that need to share the data, performance and availability requirements, etc. For example, you can read about some of the pros and cons of using Dynamo DB vs. S3 in our FAQ.

User-level state management also requires a permanent user identifier. The only way to obtain a user identifier that persists across enabling and disabling your skill is to use account linking.

73
Q

Security

2.2. Skills hosted as web services on your own endpoint

A

The web service must present a valid, trusted certificate when the connection is established and must possess the corresponding private key. Amazon only trusts certificates that have been signed by an Amazon-approved certificate authority.
Self-signed certificates cannot be used for published skills.

The service must verify that incoming requests were sent by the Alexa service. You can do this by validating the request signature as discussed in Verify that the request was sent by Alexa.
    Note: the Java library provided with the Alexa Skills Kit provides a disableRequestSignature flag in the SpeechletServlet class that you can use for testing. If you used this while testing, be sure to set it back to false when you are ready to submit for certification.
    The service must ensure that incoming requests are intended for your service, as discussed in Verify that the request came from your skill.
74
Q

2.3. Skills with Account Linking

A

If your skill needs to connect the identity of the end user with a user in another system (account linking), please verify that your skill follows all the instructions defined in one of the following:

Account Linking for Custom Skills
Account Linking for Smart Home and Other Domains

When submitting your skill, be sure to provide a valid set of account credentials with your testing instructions so our certification team can verify the account linking and functionality of your skill. Your skill must also pass the following account linking criteria:

The skill must use Amazon's account linking feature by redirecting the user to a login page or landing page when enabling the skill with the Alexa app.
The skill's privacy policy and terms of use links displayed in the Alexa app must each open to a valid web page.
If you are the owner of the credential system, your skill must pass the following criteria:
    You must own the domain that presents the login page.
    The main domain URL of the login page must reflect your brand, skill, or developer name. In other words, if the URL for your skill is https://www.example.com/xyz, the example.com portion of the URL must reflect the brand, skill, or developer name.
    The login page must indicate your brand, skill, or developer name in the form of text or an icon.
    The login page must be served over HTTPS.
If you are not the owner of the credential system, your skill must pass the following criteria:
    You must own the landing page that users are directed to when enabling your skill. This landing page must clearly communicate which third-party (3P) accounts are needed to link the account to the skill.
    The landing page must direct the user to the domain login page owned by the OAuth providers and must be served over HTTPS.
    You may not directly handle, store, or transmit credentials on behalf of the user.
If you are using Login with Amazon, your skill must pass the following criteria:
    The login page URL must be from amazon.com and the page must be served over HTTPS.
    The login page must clearly communicate which third-party (3P) accounts are needed to link the account to the skill.
    You must clearly state the customer information your skill is collecting and using. This can be directly on the login page or in your privacy policy.
Tip: For a detailed walk-through for using Login with Amazon with the Alexa Skills Kit, see 5 Steps to Seamlessly Link Your Alexa Skill with Login with Amazon.
For a custom skill, the skill returns the LinkAccount card if a user invokes an intent that requires authorization, but has not yet linked their account.
75
Q

Submission checklist

A

Ensure your skill meets the Alexa policy guidelines.

The policy guidelines help ensure that your skill is appropriate for all customers. Adherence to these guidelines guards the privacy and welfare of Alexa users.

Ensure your skill meets the security requirements for your method of hosting the service for your skill.

Customer trust is important to us. To protect customer data, your skill must meet Amazon's security requirements.

Perform all required functional tests:

These tests verify that the information presented in the Alexa app accurately reflects the core functionality of your skill. This improves the experience when customers initially enable and begin using your skill.

Perform all required voice interface and user experience tests:

These tests verify the quality of your voice user interface. Interacting with a voice interface is a new experience for most customers. A robust interface with useful supportive prompts makes the experience feel more like a conversation.

If your skill includes screen-based interaction, test your skill's screen-based interactions.

If your skill includes reminders, ensure that you use the test instructions to describe how you have implemented reminders functionality in the skill.

If your skill is eligible for the Works With Alexa Program or the Certified for Humans Program, ensure that your device and skill comply with the Works With Alexa Program Guidelines and the Certified for Humans Program Guidelines.

If your skill allows users to make a purchase on Alexa, ensure you follow the Requirements for Skills that Allow Purchases.