question

Apoena Oliveira Machado avatar image
Apoena Oliveira Machado asked

Interceptor and redirect

First question is if interceptor can be assign just for one intent. Second question is about redirect to another intent from interceptor.

I created a respose interceptor that check if user won the game and redirect from interceptor to another intent. The APL template of intent before interceptor is displayed but the audio that alexa speak is from the intent i redirected. And the APL template of redirected intent is not displayed.

alexaaplask sdk
10 |5000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

Jason@Amazon avatar image
Jason@Amazon answered

The interceptors run for all requests in the SDK - if you want to do any work in regards to modifying the response, you will need to handle this yourself, as the interceptors generally don't pass code around to different intent handlers.

Any time you want to change the response based on the request, you handle this on your endpoint - you don't necessarily have to have a single intent handler for each intent, so you could have an intent handler that calls another function based on the request and parameters within that request.

10 |5000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.