Skip to content

Bug report : Sending a voice forward consent start connection directive returns error "ask_sdk_core/response_helper.py directive.object_type has no attribute 'object_type'" #206

@soulaimanedev

Description

@soulaimanedev

CONTEXT : In my alexa skill I want to implement the voice forward consent directive. But when I send a start connection directive with the list of permissions that I want the user to approve or deny, I receive an error that says :

ERROR MESSAGE :

File "/var/task/ask_sdk_core/response_helper.py", line 130, in add_directive
directive.object_type == "VideoApp.Launch"):
AttributeError: 'dict' object has no attribute 'object_type'

STEPS TO REPRODUCE : here's the response object with what I think is the proper directive format

start_connection_directive = {
            "type": "Connections.StartConnection",
            "uri": "connection://AMAZON.AskForPermissionsConsent/2",
            "input": { 
                '@type': 'AskForPermissionsConsentRequest', 
                '@version': '2', 
                'permissionScopes': [{ 
                    'permissionScope': 'alexa::profile:given_name:read', 
                    'consentLevel': 'PERSON'
                }]
             }
        }
    
    return (
                handler_input.response_builder
                    .add_directive(start_connection_directive)
                    .speak('i need your name')
                    .ask('speak_output')
                    .response
            )

** Environment :**

  • Operating System and version: I use amazon resources ( an amazon hosted skill )

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions