Skip to content

Instantly share code, notes, and snippets.

View ankkal's full-sized avatar

Ankit Kala ankkal

  • Amazon
  • Bangalore
View GitHub Profile
Field Description
Do you allow users to create an account or link to an existing account with you? Select
Field Description
Do you allow users to create an account or link to an existing account with you? Select
Field Description
Do you allow users to create an account or link to an existing account with you? Select
Field Description
Do you allow users to create an account or link to an existing account with you? Select
//Add this code inside your Intent Handler
if (handlerInput.requestEnvelope.context.System.user.accessToken !== undefined) {
accessToken = handlerInput.requestEnvelope.context.System.user.accessToken;
try {
var tokenOptions = buildHttpGetOptions(accessToken);
var response = await httpGet(tokenOptions);
console.log({ response });
if (handlerInput.requestEnvelope.context.System.user.accessToken === undefined) {
return handlerInput.responseBuilder
.speak("to start using this skill, please use the companion app to authenticate")
.reprompt("to start using this skill, please use the companion app to authenticate")
.withLinkAccountCard()
.getResponse();
}
@ankkal
ankkal / BodyTemplate1.json
Created June 26, 2018 10:56
BodyTemplate1.json
{
"body": {
"version": "1.0",
"response": {
"outputSpeech": {
"type": "SSML",
"ssml": "<speak>hello and welcome to game skill ! Say help to hear some options.</speak>"
},
"card": {
"type": "Standard",
//Place this inside the getnewfacthandler code inside the handler function
const request = handlerInput.requestEnvelope.request;
// SLOT: planet
if (request.intent.slots.planet &&
request.intent.slots.planet.value &&
request.intent.slots.planet.value !== '?'
) {
const planet = request.intent.slots.planet;
@ankkal
ankkal / index.js
Last active August 13, 2019 19:02
Display Directive and Video Directive Sample
/* eslint-disable func-names */
/* eslint-disable no-console */
// IMPORTANT: Please note that this template uses Dispay Directives,
// Display Interface for your skill should be enabled through the Amazon developer console
// See this screenshot - https://alexa.design/enabledisplay
const Alexa = require('ask-sdk');
const GetNewFactHandler = {
canHandle(handlerInput) {
@ankkal
ankkal / DisplaySampleCodeV2.js
Last active December 23, 2020 03:14
V2 Display Code
// IMPORTANT: Display Interface for your skill should be enabled through the Amazon developer console
// See this screenshot - https://alexa.design/enabledisplay
/* HELPER FUNCTIONS */
// returns true if the skill is running on a device with a display (show|spot)
function supportsDisplay(handlerInput) {
var hasDisplay =
handlerInput.requestEnvelope.context &&
handlerInput.requestEnvelope.context.System &&