SOLVED | Alexa Directive & Event blocks, how do I use this?

Hey guys,

Now that Voiceflow has removed the User Permission block.

I am trying to get the user’s email address using Voice-Forward Consent, after asking the user if they want to receive an email, I added a Directive block with the following JSON

   "type": "Connections.StartConnection",
   "uri": "connection://AMAZON.AskForPermissionsConsent/2",
   "input": {
      "@type": "AskForPermissionsConsentRequest",
      "@version": "2",
      "permissionScopes": [
           "permissionScope": "alexa::profile:email:read", 
           "consentLevel": "ACCOUNT" 
   "token": ""

And then I added a Custom Code block with the following code

_response = {
  shouldEndSession: undefined

But I keep getting the following error message:
“ShouldEndSession must be undefined when onCompletion is not SEND_ERRORS_ONLY in Connections.StartConnection directive”

What I am hoping to get is:
A prompt from Alexa to ask permission from the user to give access to their email address by replying “I Approve” or “No”

Any example on how to use Directive & Custom event blocks would be amazing.

Thank you

Hey @andre,

you want to change your response to:

_response = {
  shouldEndSession: null

You can find more info on our devs docs here: