1

I love REST APIs, use them all the time at work and home, and finding new public ones that provide all kinds of data. I even have one that talks with my Tesla. I develop mostly in Python, and use Postman for a lot of initial digging into REST API calls.

However, I am a bit perplexed on how one might ask Alexa how to do something and get a response? I looked through some of the questions found on Stack Overflow and did some Googling, which only added to the confusion. After some initial reading, I have seen references to skills (I know of them, that I have used them, but all within the Alexa app), but every result mentions skill building or interfacing, and then talk to the skill? Not as easy as some others, but not surprised by this given how huge and complex Amazon Alexa universe is.

So, am I making a mountain out of a ant-hill? .. or is there an easy way to setup a token or such in my account and use it to authenticate and perform calls?

If there is a prerequisite reading list or a good website the explains this process.. I would greatly appreciate info from the community.

I found this 3-year-old articles, solution seems kinda clunky, but still digging... How can I trigger Alexa intent with clicks rather than voice?

-- Thank you!

jewettg
  • 1,098
  • 11
  • 20

2 Answers2

0

You can find your answer in the Alexa Skills Documentation.

You must be aware that you can access some of the features available in the Alexa device. The main interface here is a voice. And yes, you have to create a skill to obtain an access key for API calls.

slawciu
  • 775
  • 4
  • 15
  • Appreciate your answer .. I was trying to bypass the "voice" part.. kind like you can with some of the automation possible in the App (routines).. where you can write what you intend to say to Alexa (it is silently said) and Alexa does that thing. I wanted to do that via the API, so I can launch routines without a whole bunch of hassle. That being said: is their a Alexa for dummies that kind explains with some detail about how to work with the REST API, skills, etc..? – jewettg Apr 20 '23 at 14:53
  • Look at the [Proactive events](https://developer.amazon.com/en-US/docs/alexa/smapi/proactive-events-api.html) docs and some sample [code](https://github.com/alexa/alexa-cookbook/tree/master/feature-demos/skill-demo-proactive-events) - the project is archived but it has some clues how to use API – slawciu Apr 21 '23 at 12:29
0

If you've already created an Alexa skill, then yes, it's possible to programmatically send an arbitrary JSON message to your skill's back-end Lambda function without the need to speak or interact with a physical Echo device. The way you can achieve this is via the "Skill Messaging API":

https://developer.amazon.com/docs/smapi/skill-messaging-api-reference.html

A successful Skill Messaging API call will result in your Lambda function receiving a Messaging.MessageReceived request which will contain the JSON you sent to the API endpoint. Your skill's back-end can then process that information as needed.

To be clear though, the one thing you cannot do in response to a Messaging.MessageReceived request, is wake the Echo device to have it initiate a conversation with the user. Interactions with an Echo device must still begin with a user verbally or physically interacting with the device in question.

KirkC
  • 141
  • 6