How to get skill ID from Alexa request in node.js - alexa

I am using node.js, Alexa sdk with express for handling requests and responses. How can I get skill id from the response which is alexa sending to my endpoint?

The skill Id is the application id inside the session object.
alexaResponse.session.application.applicationId

Related

Call Alexa SKill over API request

Is possible to call a skill from Alexa using an API?
When I search about this i find things about use API inside skill code from developer.amazon.com, but in this case we use API in skill. Not the API calling this skill from a request
Is possible to do this?
Short answer: Not today
Why? Because using Alexa requires an account and no API is available to login as a user on Alexa. Maybe one day, that would be helpful.

Azure AD Account Linking Alexa Skills Kit

I'm try to link my azure environment to Alexa. I'm using Auth Code Grant with HTTPBasic. After entering Authorization URI, Token URI, Client ID and Client Secret, the Link account page in alexa skill redirects to login.microsoftonline.com. After logging in, I'm redirected to skills.amazon.com which says Unable to link account to your skill. For the alexa endpoint, I'm using an Azure Function App. I'm able to get access tokens when testing on Postman. Has anyone encountered any similar issues? Is this a bug in alexa skills kit or Azure AD?
Here is a blog post that walks through using an Azure Function to back an Alexa Skill and Azure AD. https://blogs.msdn.microsoft.com/premier_developer/2018/01/25/amazon-alexa-skills-authenticated-by-azure-active-directory-and-backed-by-an-azure-function/ It does need to be updated with the following:
You can ignore the sections about the "front end" app registration.
In Alexa account linking section update URLs to use login.microsoftonline.com instead of login.windows.net
ClientId to be the Application Id of the "back end" app registration
The ?resource= has to be set and has to be the same as the audience parameter for the JWT bearer options.
The client secret (key) that is used can not be one that "Never Expires". Use a 1 or 2 year duration.

Exporting Google action to Alexa skill

I have a google action which I am trying to export as an Alexa skill using these instructions. https://dialogflow.com/docs/integrations/alexa-exporter
The Alexa Skills Kit console asks for an HTTPS service endpoint, but I don't know what to set here
Is it the same as the Webhook fulfillment URL in dialogflow ?
Also when I try opening the https webhook url in the browser I get this error -
Action Error: no matching intent handler for: null
This does not "export a Google Action" for use as a Skill.
What it does is let you use Dialogflow to help define the user Intents, phrases, and Slot Entities that the legacy Skill Console expected. In particular it does not send your Alexa voice commands to Dialogflow for processing. The "fulfillment" section for Dialogflow is not used for Alexa handling.
Alexa still expects either an AWS Lambda or an HTTPS webhook to be specified where you will do the processing using its JSON format.

Alexa Custom Skill Development HTTP Error 405 in Response

I am developing a custom skill in Alexa, and just trying to return a hard coded response on a https service endpoint on port 8443 based on my sample utterances and intent schema defined on Amazon Alexa Console.
While testing from Alexa Service Emulator i am getting error There was an error calling the remote endpoint, which returned HTTP 405 : Method Not Allowed
While accessing the endpoint URL from POSTMEN i do get below mentioned response
{"response":{"shouldEndSession":true,"outputSpeech":{"text":"All appliance are working as expected","type":"PlainText"}},"sessionAttributes":{},"version":"1.0"}
I am finding it hard to understand where i am doing wrong.
Alexa is pretty picky when it comes to hosting skills externally. It sounds like this could be the issue. It can be done, you just have the follow the rules Alexa defines.
From the docs
The service must support HTTP over SSL/TLS, leveraging an Amazon-trusted certificate.
The service must accept requests on port 443
For testing, Amazon accepts different methods for providing a certificate.
For details, see the “About the SSL Options” section of Registering and Managing Custom Skills in the Developer Portal.

Google API Error: redirect_uri_mismatch

I have registered my application's client ID and client secret
for my web application running on GoogleAppEngine.
My app uses the Directory API to sync user info with Google Apps.
Sending API request and response works OK,
but some users can't get a response from the server.
API's response is:
redirect_uri_mismatch
Is there a restriction on the number of users when using Directory API ?
The user has an administrator role in the Google Apps domain.
You have to enter the scheme for URIs: http or https

Resources