Webhook response back to Alexa?

smithbill

New member
I've created a simple 'Hello World' skill in my Amazon Alexa Developer Console - all it does is call an Endpoint HTTPS url which is a MacroDroid webhook url.

So I can say "Alexa, ask hello world" and it just triggers the MacroDroid webhook.

However, although my webhook triggers and my macro runs, Alexa keeps responding by saying "There was a problem with the requested skill's response"

I'm not really interested in getting a response providing my macro runs, but is there something extra needed from the MacroDroid webhook to tell Alexa it completed successfully?
 

tanutanu

Well-known member
I've created a simple 'Hello World' skill in my Amazon Alexa Developer Console - all it does is call an Endpoint HTTPS url which is a MacroDroid webhook url.

So I can say "Alexa, ask hello world" and it just triggers the MacroDroid webhook.

However, although my webhook triggers and my macro runs, Alexa keeps responding by saying "There was a problem with the requested skill's response"

I'm not really interested in getting a response providing my macro runs, but is there something extra needed from the MacroDroid webhook to tell Alexa it completed successfully?
Do you handle the webhook response and pass it to Alexsa correctly? If you don't need any return from MD side via webhook, Alexa needs the response to work in the post action.
I'm not sure your implementation details but I guess you might have some handling mistakes:unsure:
 

smithbill

New member
Do you handle the webhook response and pass it to Alexsa correctly? If you don't need any return from MD side via webhook, Alexa needs the response to work in the post action.
I'm not sure your implementation details but I guess you might have some handling mistakes:unsure:
Hi, I think the problem, as mentioned in the 'Handle Requests Sent by Alexa' information you linked, is where it says:

"When you create a custom skill...The code you write for this service needs to:
  • Return an appropriate response"

I am guessing that the webhook call to my MacroDroid macro, doesn't actually return any response. So my Alexa skill is sat there expecting some sort of success/failure return, but gets nothing.

Assuming that's right - is it possible for a MacroDroid webhook to return a success/failure response? Or some setting in my Alexa skill that says 'dont bother waiting for a response' from this Endpoint?

I have no intermediate 'code' (and I don't really want any). I just want the Alexa Skill to invoke the Endpoint webhook URL in order to execute my MacroDroid macro, and end (hence it's in the Skill Endpoint)
 

tanutanu

Well-known member
Hi, I think the problem, as mentioned in the 'Handle Requests Sent by Alexa' information you linked, is where it says:

"When you create a custom skill...The code you write for this service needs to:
  • Return an appropriate response"

I am guessing that the webhook call to my MacroDroid macro, doesn't actually return any response. So my Alexa skill is sat there expecting some sort of success/failure return, but gets nothing.

Assuming that's right - is it possible for a MacroDroid webhook to return a success/failure response? Or some setting in my Alexa skill that says 'dont bother waiting for a response' from this Endpoint?

I have no intermediate 'code' (and I don't really want any). I just want the Alexa Skill to invoke the Endpoint webhook URL in order to execute my MacroDroid macro, and end (hence it's in the Skill Endpoint)
Probably your are right and I think so as far as reading the Amazon document.
If Alexa server side API can catch the message via MD http get action, you might be able to handle it as the response. Otherwise looking for a call back feature to timeout waiting MD responding.
Sorry, I don't have any experiences to make Alexa skills without 3rd party wrapper API. So I can't say exactly but I would do when I try🤔
 

MacroDroidDev

Administrator
Staff member
The call to a MacroDroid webhook will return a 200 HTTP code when it is successful, so I don't think the issue is anything to do with MacroDroid.

Incidentally there will be an Alexa trigger coming soon, so you should be able to do what you want directly in MacroDroid soon. I don't have an accurate date for this but I hope it will be early in the new year.
 

tanutanu

Well-known member
The call to a MacroDroid webhook will return a 200 HTTP code when it is successful, so I don't think the issue is anything to do with MacroDroid.

Incidentally there will be an Alexa trigger coming soon, so you should be able to do what you want directly in MacroDroid soon. I don't have an accurate date for this but I hope it will be early in the new year.
Does it also support external input devices such as Echo dot, or calling Alexa API as same as installed Alexa app?
Now I'm using a 3rd party app, Say it, when I make Alexa say something as a TTS output channel. It's much better to do it via MD builtin feature:) Thanks, Jamie!

OP seems to initiate his action as a remote function call on a cellphone from another Alexa device. In this case(also my Echo dot), how does MD upcoming feature hook to handle the user speech input command? Currently I'm using some 3rd party skill or Alexa builtin IFTTT cooperation feature to do it.
 
Last edited:

smithbill

New member
Oh, this sounds interesting. So are you saying I'll be able to bark some command at my Echo Dot (or any Alexa device?) and have it execute a MacroDroid macro without having to mess around with webhooks? That's what I'm trying to achieve so I can launch apps etc on my phone just by instructing Alexa on my EchoDot to do it.

Won't that require an 'Alexa Skill' of some kind to interface Alexa to MacroDroid?
 
Top