question

newuser-bfb98bc0-9d7b-4e4d-a6ab-317c9f3f83ed avatar image

canFulfillIntentRequest "Skill endpoint returned an invalid response"

I've setup a new skill following this example skill for the canFulfillIntentRequest.

https://github.com/PaulCutsinger/Sample-For-Can-Fulfill-Intent-Request

I have enabled the required interface.

I'm using beta version of the SDK.

I've tested the skill using both the developer portal and the CLI tool.

I'm exposing the endpoint url using the Bespoken proxy so I can verify with the debugger.

I observed the following in my console output on my local machine.

The filled slots: {"voiceExpert":{"name":"voiceExpert","value":"Anna","resolutions":{"resolutionsPerAuthority":[{"authority":"amzn1.er-authority.echo-sdk.amzn1.ask.skill.54841bf0-1e88-4319-9dc7-ecbda6a98945.VOICE_EXPERTS","status":{"code":"ER_SUCCESS_MATCH"},"values":[{"value":{"name":"Anna Van Brookhoven","id":"dad826f08868120aa6e5e75a371e9b25"}}]}]},"confirmationStatus":"NONE"}}
in CFIR AboutIntentHandler {"voiceExpert":{"synonym":"Anna","value":"Anna Van Brookhoven","id":"dad826f08868120aa6e5e75a371e9b25","isValidated":true}}
in CFIR AboutIntentHandler YES
INFO  2018-08-20T15:31:58.385Z ResponseReceived ID: 1534779117443
VERB  2018-08-20T15:31:58.385Z Payload:
{
  "version": "1.0",
  "response": {
    "canFulfillIntent": {
      "canFulfill": "YES",
      "slots": {
        "voiceExpert": {
          "canUnderstand": "YES",
          "canFulfill": "YES"
        }
      }
    }
  },
  "userAgent": "ask-node/2.1.0-beta.4 Node/v10.2.1",
  "sessionAttributes": {}
}

Using the developer portal I observed that the skill returned the following.

{
    "status": "SUCCESSFUL",
    "result": {
        "skillExecutionInfo": {
            "invocationRequest": {
                "endpoint": "https://famous-wells-6Qpw1n.bespoken.link",
                "body": {
                    "version": "1.0",
                    "session": {
                        "new": false,
                        "sessionId": "amzn1.echo-api.session.afef329c-5682-4623-bb36-1f65d04e69cb",
                        "application": {
                            "applicationId": "amzn1.ask.skill.54841bf0-1e88-4319-9dc7-ecbda6a98945"
                        },
                        "user": {
                            "userId": "amzn1.ask.account.AHMR5XME5BU4NI2FGVDLQKFVHFPXQE5DO4KYPYCCVHIXNW3OMQVOUWOECN6NBVC6BCGA76UII57AUPXAIDLDK77LCJ6H4L7KXNE6X54RCNVDAKNYOCBTRSEG2HB43X2PRFNGVZSUB66QFXPILSIMJL2I242LTZPIRMJ62FNLCLTO4SAZJ73VCT6GDC7RWFMC3NNTTGG2ALHF4PQ"
                        }
                    },
                    "context": {
                        "System": {
                            "application": {
                                "applicationId": "amzn1.ask.skill.54841bf0-1e88-4319-9dc7-ecbda6a98945"
                            },
                            "user": {
                                "userId": "amzn1.ask.account.AHMR5XME5BU4N..."
                            },
                            "device": {
                                "deviceId": "amzn1.ask.device.AHXFF...",
                                "supportedInterfaces": {}
                            },
                            "apiEndpoint": "https://api.eu.amazonalexa.com",
                            "apiAccessToken": "eyJ0e..."
                        }
                    },
                    "request": {
                        "type": "CanFulfillIntentRequest",
                        "requestId": "amzn1.echo-api.request.0bf154b3-c43c-4776-825c-27425c12522f",
                        "timestamp": "2018-08-20T15:22:29Z",
                        "locale": "en-US",
                        "intent": {
                            "name": "aboutIntent",
                            "confirmationStatus": "NONE",
                            "slots": {
                                "voiceExpert": {
                                    "name": "voiceExpert",
                                    "value": "Anna",
                                    "resolutions": {
                                        "resolutionsPerAuthority": [
                                            {
                                                "authority": "amzn1.er-authority.echo-sdk.amzn1.ask.skill.54841bf0-1e88-4319-9dc7-ecbda6a98945.VOICE_EXPERTS",
                                                "status": {
                                                    "code": "ER_SUCCESS_MATCH"
                                                },
                                                "values": [
                                                    {
                                                        "value": {
                                                            "name": "Anna Van Brookhoven",
                                                            "id": "dad826f08868120aa6e5e75a371e9b25"
                                                        }
                                                    }
                                                ]
                                            }
                                        ]
                                    },
                                    "confirmationStatus": "NONE"
                                }
                            }
                        }
                    }
                }
            },
            "invocationResponse": null,
            "metrics": null
        },
        "error": {
            "message": "Skill endpoint returned an invalid response."
        }
    }
}
alexa skills kitcanfulfillintentrequest
10 |5000

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

Amazon_Bernardo Bezerra avatar image
Amazon_Bernardo Bezerra answered

Hi and thank you for posting.

In order to test your skill against the CanFulfillIntentRequest, you need to send a JSON that simulates a request sent by Alexa.

Can you please share your JSON so I can take a better look at it?

Regards,
Barry

10 |5000

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

newuser-be98a721-371d-443f-8fa2-27a5e24c16b0 avatar image
newuser-be98a721-371d-443f-8fa2-27a5e24c16b0 answered

Could you please share the api or amazon docs that request sent by alexa

1 comment
10 |5000

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

Amazon_Bernardo Bezerra avatar image Amazon_Bernardo Bezerra ♦♦ commented ·

Hello and thank you for your message.

This page shows how to implement the CanfulfillIntentRequest.

Regards,
Barry

0 Likes 0 ·