Tony Stark
Tony Stark

Reputation: 54

Test CanFullfillmentRequest in alexa mobile app or echo device during development mode

I'm creating a alexa skill, in which i want to trigger all my commands without invocation name, i have implement CanFullfillmentRequest by following (https://developer.amazon.com/en-US/docs/alexa/custom-skills/implement-canfulfillintentrequest-for-name-free-interaction.html#invoke-and-test-the-skill) this url and test it from simulator using json file.

now i want to test this in mobile app environment.

How do i test this?

Is there only way to submit my skill and test this feature on live mode? Or there is any other way to test this.

#name-free-intrection

Upvotes: 0

Views: 42

Answers (1)

German
German

Reputation: 10402

The only way to test a skill that implements CanFulfillIntentRequest and is not live yet is to simulate the request by crafting one and sending it to your skill.

Create a new .json file containing the input JSON with the request type set to CanFulfillIntentRequest.

The following is a sample .json file for the request. Substitute the appropriate values for your skill. Because you cannot test CanFulfillIntentRequest with an Alexa-enabled device, the purpose of this file is to duplicate the content of an actual CanFulfillIntentRequest from Alexa for testing with ASK CLI, or in the Alexa Simulator.

{
  "session":{
    "new": true,
    "sessionId":"SessionId.[unique-value-here]",
    "application":{
      "applicationId":"amzn1.ask.skill.[unique-value-here]"
    },
    "attributes":{
      "key": "string value"
    },
    "user":{
      "userId":"amzn1.ask.account.[unique-value-here]"
    }
  },
  "request":{
    "type":"CanFulfillIntentRequest",
    "requestId":"EdwRequestId.[unique-value-here]",
    "intent":{
      "name":"MyNameIsIntent",
      "slots":{
        "name":{
          "name":"name",
          "value":"Jeff"
        }
      }
    },
    "locale":"en-US",
    "timestamp":"2017-10-03T22:02:29Z"
  },
  "context":{
    "AudioPlayer":{
      "playerActivity":"IDLE"
    },
    "System":{
      "application":{
        "applicationId":"amzn1.ask.skill.[unique-value-here]"
      },
      "user":{
        "userId":"amzn1.ask.account.[unique-value-here]"
      },
      "device":{
        "supportedInterfaces":{

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

More info: https://developer.amazon.com/en-US/docs/alexa/custom-skills/implement-canfulfillintentrequest-for-name-free-interaction.html#create-the-json-for-testing-your-skill

Upvotes: 1

Related Questions