[Docs] Alexa CanFulfillIntentRequest


#1

Learn more about how to implement the Alexa CanFulfillIntentRequest feature in your Jovo project.


This is a companion discussion topic for the original entry at https://www.jovo.tech/docs/amazon-alexa/canfulfill

#2

Hey,

I am having trouble with CanFulfillIntentRequest I have followed the instructions above with the following issues:

  • CanFulfillIntentRequest does not return a valid response

Here is the response I receive from Alexa:

{
  "session":{
    "new": true,
    "sessionId":"SessionId.1ef4a7c9-07f1-42b1-8798-9e00001bfcb1",
    "application":{
      "applicationId":"amzn1.ask.skill.d3cb6156-f160-401c-ab25-fa04fc5c3861"
    },
    "attributes":{
      "key": "string value"
    },
    "user":{
      "userId":"amzn1.ask.account.AGFBGMJPGUGT2HFEAHITSXUUABA4VZ7YOTIW3VMTPPJPSBH2O5FRS5RUIPHFMXG5UG4OV6TTIR5QVNKMT5XCHCYHVGRU7ISYFHZ7ZO22LLFJDXJDSZ5IBMP3H6VRAPREBH56YODZW5I5T5DBMLJPWXUAJ6M2YDQP275YCMJDUOCSQTKDOOYTSG7QVGRE7FIOSF2SUHD7F2CNTRQ"
    }
  },
  "request":{
    "type":"CanFulfillIntentRequest",
    "requestId":"EdwRequestId.07f343d9-5fe2-4eca-bae9-b21bb276d0f0",
    "intent":{
      "name":"LAUNCH"
    },
    "locale":"en-US",
    "timestamp":"2017-10-03T22:02:29Z"
  },
  "context":{
    "AudioPlayer":{
      "playerActivity":"IDLE"
    },
    "System":{
      "application":{
        "applicationId":"amzn1.ask.skill.d3cb6156-f160-401c-ab25-fa04fc5c3861"
      },
      "user":{
        "userId":"amzn1.ask.account.AGFBGMJPGUGT2HFEAHITSXUUABA4VZ7YOTIW3VMTPPJPSBH2O5FRS5RUIPHFMXG5UG4OV6TTIR5QVNKMT5XCHCYHVGRU7ISYFHZ7ZO22LLFJDXJDSZ5IBMP3H6VRAPREBH56YODZW5I5T5DBMLJPWXUAJ6M2YDQP275YCMJDUOCSQTKDOOYTSG7QVGRE7FIOSF2SUHD7F2CNTRQ"
      },
      "device":{
        "supportedInterfaces":{

        }
      }
    }
  },
  "version":"1.0"
}

Response

{
	"status": "SUCCESSFUL",
	"result": {
		"skillExecutionInfo": {
			"invocationRequest": {
				"endpoint": "arn:aws:lambda:us-east-1:604715680480:function:voice-dry-cleaner-dot-com-V3-APL",
				"body": {
					"session": {
						"new": true,
						"sessionId": "SessionId.1ef4a7c9-07f1-42b1-8798-9e00001bfcb1",
						"application": {
							"applicationId": "amzn1.ask.skill.d3cb6156-f160-401c-ab25-fa04fc5c3861"
						},
						"attributes": {
							"key": "string value"
						},
						"user": {
							"userId": "amzn1.ask.account.AGFBGMJPGUGT2HFEAHITSXUUABA4VZ7YOTIW3VMTPPJPSBH2O5FRS5RUIPHFMXG5UG4OV6TTIR5QVNKMT5XCHCYHVGRU7ISYFHZ7ZO22LLFJDXJDSZ5IBMP3H6VRAPREBH56YODZW5I5T5DBMLJPWXUAJ6M2YDQP275YCMJDUOCSQTKDOOYTSG7QVGRE7FIOSF2SUHD7F2CNTRQ"
						}
					},
					"request": {
						"type": "CanFulfillIntentRequest",
						"requestId": "EdwRequestId.07f343d9-5fe2-4eca-bae9-b21bb276d0f0",
						"intent": {
							"name": "LAUNCH"
						},
						"locale": "en-US",
						"timestamp": "2017-10-03T22:02:29Z"
					},
					"context": {
						"AudioPlayer": {
							"playerActivity": "IDLE"
						},
						"System": {
							"application": {
								"applicationId": "amzn1.ask.skill.d3cb6156-f160-401c-ab25-fa04fc5c3861"
							},
							"user": {
								"userId": "amzn1.ask.account.AGFBGMJPGUGT2HFEAHITSXUUABA4VZ7YOTIW3VMTPPJPSBH2O5FRS5RUIPHFMXG5UG4OV6TTIR5QVNKMT5XCHCYHVGRU7ISYFHZ7ZO22LLFJDXJDSZ5IBMP3H6VRAPREBH56YODZW5I5T5DBMLJPWXUAJ6M2YDQP275YCMJDUOCSQTKDOOYTSG7QVGRE7FIOSF2SUHD7F2CNTRQ"
							},
							"device": {
								"supportedInterfaces": {}
							}
						}
					},
					"version": "1.0"
				}
			},
			"invocationResponse": {
				"body": {
					"version": "1.0",
					"response": {
						"canFulfillIntent": {}
					}
				}
			},
			"metrics": {
				"skillExecutionTimeInMilliseconds": 86
			}
		},
		"error": null
	}
}

Zoom-In On Failure

"invocationResponse": {
	"body": {
	        "version": "1.0",
	        "response": {
		"canFulfillIntent": {}
		}
	}
},

Expected Response

"invocationResponse": {
	"body": {
	        "version": "1.0",
	        "response": {
		"canFulfillIntent": {
                    canFulfill: "YES"
                    }
		}
	}
},

Any ideas of why I do not receive canFulfill in my response?


CanFulfillIntentRequest
#3

Hi @Voice_First,

Thank you for raising this issue! Fixed in Jovo 2.1.5: https://github.com/jovotech/jovo-framework/blob/master/CHANGELOG.md#215-2019-03-27


#4

Hi, following up on this. I have all the latest in Jovo cli and frameworks.

In the alexa console, using Manual JSON I get a response back which LOOKS good:

Mine:

Expected:

They look identical!
However, the functional test says it doesn’t. Any thoughts as to other causes?


#5

Hi, this still is not working properly. Expected, from the docs (https://developer.amazon.com/docs/custom-skills/understand-name-free-interaction-for-custom-skills.html#response-to-canfulfillintentrequest):

{
    "version":"1.0",
    "response":{
        "canFulfillIntent": {
            "canFulfill": "YES",
            "slots":{
                "slotName1": {
                    "canUnderstand": "YES",
                    "canFulfill": "YES"
                },
               "slotName2": {
                    "canUnderstand": "YES",
                    "canFulfill": "YES"
                }
            }
        }
    }
}
And.. current output looks like this:
{
	"version": "1.0",
	"response": {
		"canFulfillIntent": {
			"canFulfill": "YES",
			"slots": {
				"slotName": "color",
				"canUnderstandSlot": "YES",
				"canFulfillSlot": "YES"
			}
		}
	}
}

So the slots are not being formatted properly.

Please note that this only happens when using the optional this.canFulfillSlot command prior to this.canFulfillRequest


#6

Additional feedback from Functional Test results:


#7

Hi Dave, thanks for pointing out this bug :bug:. This should work now after doing jovo update!