how to send a http request to my alexa skill and get a response from it?

Viewed 917

Objective - I created a basic Alexa skill using the Alexa hosted option, and I want to send an HTTP request to my Alexa back end in text or in JSON and get the response as a text without using an Alexa device.

question 1- is this even possible with the Alexa hosted option

question 2 - if it's possible will my user-id be Alexa skill messaging client id or the client id from my security profile?

my progress - so I did a bit of research on this and found this page:

https://developer.amazon.com/en-US/docs/alexa/smapi/send-a-message-request-to-a-skill.html

but I keep encountering two problems ie. when I try to make a post request. 1 - It says "type": "BAD_REQUEST", "message": "One or more parameters received are not in the correct format.", which I think is probably caused by this line - MESSAGE='{"data":{ "sample message": "Sample Message"}, "expiresAfterSeconds": 60}'

2 - when I change my message to MESSAGE='{"data":{}' ie. an empty message. it says {"type":"NOT_FOUND","message":"Invalid user id."}

I tried both client id's ie. the one that my Alexa skill provides and the one which I created in my security profile but the outcome remains the same. and thus my question is this is even possible to do with the Alexa-hosted option.

0 Answers
Related