canFulfillIntentRequest
The canFulfillIntentRequest node is designed to work only for Alexa devices.
CanFulfillIntentRequest
With CanFulfillIntentRequest, you can include your skill in a pool of possible skills that can handle name-free skill interactions. The user can ask Alexa to perform a task, without naming the skill that should fulfill the request.
How does Name-free interaction work?
Name-free interaction enables customers to interact with Alexa without invoking a specific skill by name, which helps facilitate greater interaction with Alexa because customers do not always know which skill is appropriate.
When Alexa receives a request from a customer without a skill name, Alexa tries to find a match within the built-in intents. If none of the built-in intents matches the request, Alexa will try to find a match within the enabled skills. (CanFulfillIntentRequest should be enabled for this)
For example, if a user requests Alexa, play relaxing sounds with crickets, Alexa's built-in features can't handle the request, so the system looks for third party skills to fulfill it. The system will then send CanFullIntentRequests to the skills it believes might be able to fulfill the request. According to the response to these requests (yes, no or maybe), your skill will receive an IntentRequest just as if it the skill was invoked by the customer directly.
Enabling CanFulfillIntentRequest for a Skill
Open your skill in the developer console.
Go to https://developer.amazon.com/settings/console/home? and login.
Select Alexa > Alexa Skills Kit.
Select your skill from the Alexa skills list.
Go to the Build > Custom > Interfaces page, and enable the CanFulfillIntentRequest interface
Can Fullfill Intent Node
You can make use the services of CanFulfillIntentRequest in Orbita projects by placing the Can Fullfill Intent Node and connecting it to the Response node as shown below.
You should publish the skill to Alexa after adding and deploying Can Fullfill Intent Node in Experience Designer.
The Can Fullfill Intent Node listens to the CanFulfillIntentRequests made by Alexa. The Can Fullfill Intent Node will then search for the intents within the project/skill. If the requested intent is found in the project/skill, then the corresponding response will be sent to Alexa.
In Orbita, you can only have one Can Fullfill Intent Node in a project.
Sample Canfullfill request
{
"session":{
"new": true,
"sessionId":"SessionId.4505e78b-3770-4a4e-9289-94af3028eaaa",
"application":{
"applicationId":"amzn1.ask.skill.218afcd2-fbc8-4c6b-b54e-8ec1edea4d6d"
},
"attributes":{
"key": "string value"
},
"user":{
"userId":"amzn1.ask.account.AH6N37WDVVL2VLUJDOSPVKNVZ5EF7TUYIVDNLKTDKPFGDAKD6MQ7HSVXNMTAXNAER45N3Y7KTIC3XLGM2W3G7JN3XXQ3D67TGMLOELSFHBN6N7OFTWYF5ENNH4JFSJOD52AFNNJ7W3BTA43K46C2WJHOSG274QEEJBUHEH6B6E3AJ5GJ3TWGVLRZU7GIB7F7RRS2ENV6CU5TGKY"
}
},
"request":{
"type":"CanFulfillIntentRequest",
"requestId":"EdwRequestId.b1a08947-236d-4774-9e6e-88fe05b30d81",
"intent":{
"name":"MyNameIsIntent",
"slots":{
"name":{
"name":"name",
"value":"Jeff"
}
}
},
"locale":"en-US",
"timestamp":"2020-07-14T22:02:29Z"
},
"context":{
"AudioPlayer":{
"playerActivity":"IDLE"
},
"System":{
"application":{
"applicationId":"amzn1.ask.skill.218afcd2-fbc8-4c6b-b54e-8ec1edea4d6d"
},
"user":{
"userId":"amzn1.ask.account.AH6N37WDVVL2VLUJDOSPVKNVZ5EF7TUYIVDNLKTDKPFGDAKD6MQ7HSVXNMTAXNAER45N3Y7KTIC3XLGM2W3G7JN3XXQ3D67TGMLOELSFHBN6N7OFTWYF5ENNH4JFSJOD52AFNNJ7W3BTA43K46C2WJHOSG274QEEJBUHEH6B6E3AJ5GJ3TWGVLRZU7GIB7F7RRS2ENV6CU5TGKY"
},
"device":{
"supportedInterfaces":{
}
}
}
},
"version":"1.0"
}
Sample output json if Alexa can fulfill the request.
{
"status": "SUCCESSFUL",
"result": {
"skillExecutionInfo": {
"invocationRequest": {
"endpoint": "https://c6b3338c46f9.ngrok.io/oeapi/9071c3b5.a5252/alexa",
"body": {
"session": {
"new": true,
"sessionId": "SessionId.4505e78b-3770-4a4e-9289-94af3028eaaa",
"application": {
"applicationId": "amzn1.ask.skill.218afcd2-fbc8-4c6b-b54e-8ec1edea4d6d"
},
"attributes": {
"key": "string value"
},
"user": {
"userId": "amzn1.ask.account.AH6N37WDVVL2VLUJDOSPVKNVZ5EF7TUYIVDNLKTDKPFGDAKD6MQ7HSVXNMTAXNAER45N3Y7KTIC3XLGM2W3G7JN3XXQ3D67TGMLOELSFHBN6N7OFTWYF5ENNH4JFSJOD52AFNNJ7W3BTA43K46C2WJHOSG274QEEJBUHEH6B6E3AJ5GJ3TWGVLRZU7GIB7F7RRS2ENV6CU5TGKY"
}
},
"request": {
"type": "CanFulfillIntentRequest",
"requestId": "EdwRequestId.b1a08947-236d-4774-9e6e-88fe05b30d81",
"intent": {
"name": "OrbitaFlowMessages",
"slots": {
"name": {
"name": "name",
"value": "Jeff"
}
}
},
"locale": "en-US",
"timestamp": "2020-07-14T22:02:29Z"
},
"context": {
"AudioPlayer": {
"playerActivity": "IDLE"
},
"System": {
"application": {
"applicationId": "amzn1.ask.skill.218afcd2-fbc8-4c6b-b54e-8ec1edea4d6d"
},
"user": {
"userId": "amzn1.ask.account.AH6N37WDVVL2VLUJDOSPVKNVZ5EF7TUYIVDNLKTDKPFGDAKD6MQ7HSVXNMTAXNAER45N3Y7KTIC3XLGM2W3G7JN3XXQ3D67TGMLOELSFHBN6N7OFTWYF5ENNH4JFSJOD52AFNNJ7W3BTA43K46C2WJHOSG274QEEJBUHEH6B6E3AJ5GJ3TWGVLRZU7GIB7F7RRS2ENV6CU5TGKY"
},
"device": {
"supportedInterfaces": {}
}
}
},
"version": "1.0"
}
},
"invocationResponse": {
"body": {
"version": "1.0",
"response": {
"canFulfillIntent": {
"canFulfill": "YES"
}
},
"sessionAttributes": {
"orbitaSessionId": "5f158976-c76e-48b5-952f-143cbdd5971c"
}
}
},
"metrics": {
"skillExecutionTimeInMilliseconds": 596
}
},
"error": null
}
}
Sample output json if Alexa cannot fulfill the request.
{
"status": "SUCCESSFUL",
"result": {
"skillExecutionInfo": {
"invocationRequest": {
"endpoint": "https://c6b3338c46f9.ngrok.io/oeapi/9071c3b5.a5252/alexa",
"body": {
"session": {
"new": true,
"sessionId": "SessionId.4505e78b-3770-4a4e-9289-94af3028eaaa",
"application": {
"applicationId": "amzn1.ask.skill.218afcd2-fbc8-4c6b-b54e-8ec1edea4d6d"
},
"attributes": {
"key": "string value"
},
"user": {
"userId": "amzn1.ask.account.AH6N37WDVVL2VLUJDOSPVKNVZ5EF7TUYIVDNLKTDKPFGDAKD6MQ7HSVXNMTAXNAER45N3Y7KTIC3XLGM2W3G7JN3XXQ3D67TGMLOELSFHBN6N7OFTWYF5ENNH4JFSJOD52AFNNJ7W3BTA43K46C2WJHOSG274QEEJBUHEH6B6E3AJ5GJ3TWGVLRZU7GIB7F7RRS2ENV6CU5TGKY"
}
},
"request": {
"type": "CanFulfillIntentRequest",
"requestId": "EdwRequestId.b1a08947-236d-4774-9e6e-88fe05b30d81",
"intent": {
"name": "MyNameIsIntent",
"slots": {
"name": {
"name": "name",
"value": "Jeff"
}
}
},
"locale": "en-US",
"timestamp": "2020-07-14T22:02:29Z"
},
"context": {
"AudioPlayer": {
"playerActivity": "IDLE"
},
"System": {
"application": {
"applicationId": "amzn1.ask.skill.218afcd2-fbc8-4c6b-b54e-8ec1edea4d6d"
},
"user": {
"userId": "amzn1.ask.account.AH6N37WDVVL2VLUJDOSPVKNVZ5EF7TUYIVDNLKTDKPFGDAKD6MQ7HSVXNMTAXNAER45N3Y7KTIC3XLGM2W3G7JN3XXQ3D67TGMLOELSFHBN6N7OFTWYF5ENNH4JFSJOD52AFNNJ7W3BTA43K46C2WJHOSG274QEEJBUHEH6B6E3AJ5GJ3TWGVLRZU7GIB7F7RRS2ENV6CU5TGKY"
},
"device": {
"supportedInterfaces": {}
}
}
},
"version": "1.0"
}
},
"invocationResponse": {
"body": {
"version": "1.0",
"response": {
"canFulfillIntent": {
"canFulfill": "NO"
}
},
"sessionAttributes": {
"orbitaSessionId": "1248e61b-76a3-46fd-8fae-c215aff21169"
}
}
},
"metrics": {
"skillExecutionTimeInMilliseconds": 615
}
},
"error": null
}
}
Reference: