question

Stephen Potter avatar image
Stephen Potter asked

Anyone got voice forward consent for country/postal code working?

Has anyone successfully implemented voice-forward consent for country/postal code?

I can send the Connections.StartConnection directive and receive the SessionResumedRequest fine, but I consistently get a result status of 'REDIRECT_TO_APP'.

alexa skillspermissions
10 |5000

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

Andy Whitworth avatar image
Andy Whitworth answered

I just tried this and got it working. I just returned the following directive:

{
   "type": "Connections.StartConnection",
   "uri": "connection://AMAZON.AskForPermissionsConsent/2",
   "input": {
      "@type": "AskForPermissionsConsentRequest",
      "@version": "2",
      "permissionScopes": [
        {
           "permissionScope": "alexa:devices:all:address:country_and_postal_code:read", 
           "consentLevel": "ACCOUNT" 
        }
      ]
   },
   "token": "example-token"
}         

I was then asked if I wanted to give consent (via voice) and when confirmed, received the following SessionResumedRequest:

"request": {
   
        "type": "SessionResumedRequest",
        "requestId": "amzn1.echo-api.request.a4ea8f3e-8be9-4e87-b457-c172e4a8ce36",
        "timestamp": "2023-03-10T11:51:44Z",
        "locale": "en-GB",
        "cause": {
   
            "type": "ConnectionCompleted",
            "token": "example-token",
            "status": {
   
                "code": "200",
                "message": "Ok"
            },
            "result": {
   
                "permissionScopes": [
                    {
   
                        "consentLevel": "ACCOUNT",
                        "permissionScope": "alexa:devices:all:address:country_and_postal_code:read"
                    }
                ],
                "status": "ACCEPTED"
            }
        }
    }


I didn't do anything special in my skill config, just enabled the "Country/Region & Postal Code Only" permissions in the dev console Permissions page.


2 comments
10 |5000

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

Stephen Potter avatar image Stephen Potter commented ·
Thank you Andy! Good to know it works. I'll take another look at my call from the Python SDK.
1 Like 1 ·
Stephen Potter avatar image Stephen Potter Stephen Potter commented ·

To close this: my issue was that I was testing in the ASK console. The console always returns the status REDIRECT_TO_APP, whereas an Alexa device invokes a permissions dialogue with the user, followed by a proper ACCEPTED/DENIED status.

0 Likes 0 ·
Sai Krishna Rajesh Chittoor avatar image
Sai Krishna Rajesh Chittoor answered

Hi @Stephen Potter Could you resolve this? I am facing the same issue. I use Alexa.NET (C#).

2 comments
10 |5000

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

Stephen Potter avatar image Stephen Potter commented ·

No I was unable to figure this out. The docs say:

"REDIRECT_TO_APP: Possible reasons for this outcome are that the user couldn't be recognized, the required level of authentication couldn't be achieved, the user turned off the personalization toggle, or the permission scope isn't available for voice consent."

I'm not using personalization, so it's not clear why this is returned. Any luck on your side?

0 Likes 0 ·
Sai Krishna Rajesh Chittoor avatar image Sai Krishna Rajesh Chittoor Stephen Potter commented ·

None, I had moved to some different work when I returned to this now I get Internal Error

"cause": {
"type": "ConnectionCompleted",
"token": "73468c53-e5bb-4f00-9093-c22aead0de18",
"status": {
"code": "500",
"message": "Internal error."
}
}
}
0 Likes 0 ·