First off, I'm new to Alexa skill development, so I have much to learn. I've been banging my head off the desk trying to figure this out. I've found various tutorials and have gone over the information provided by Amazon for accessing the Customer Profile API via an Alexa skill but still can't manage to obtain the customer's phone number.
I'm using the AWS console in-line code editor (Cloud9). Most, if not all, instructions use something like 'axios', 'request', or 'https' modules which I don't think is possible unless you use the ask-cli (please correct me if I'm wrong). Also, I followed a tutorial to initially create the skill which had me use Skillinator.io to create an AWS Lambda template based on the skill's JSON in the Amazon Developer console. The format of the code in the Customer Profile API tutorials does not match what was provided by the Skillinator.io tool. The way the Intent handlers are set up is different, which is where I believe my confusion is coming from. Here's an example:
Skillinator.io code:
<code>const handlers ={'LaunchRequest':function(){ welcomeOutput ='Welcome to the Alexa Skills Kit!'; welcomeReprompt ='You can say, Hello!';this.emit(':ask', welcomeOutput, welcomeReprompt);},};
Tutorial code:
<code>constLaunchRequestHandler={ canHandle(handlerInput){return handlerInput.requestEnvelope.request.type ==='LaunchRequest';}, handle(handlerInput){const speechText ='Welcome to the Alexa Skills Kit!';return handlerInput.responseBuilder .speak(speechText).reprompt(speechText).withSimpleCard('Hello World', speechText).getResponse();}};
Can anyone shed some light and help me understand why there is a difference in the way the handlers are formatted, and how (if possible) to create the request to the Customer Profile API and obtain the customer's phone number using the Skillinator.io template and AWS Lambda code editor?
I've already completed the steps for the necessary permissions/account linking.
Thanks in advance.