3

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.

kevin godfrey
  • 153
  • 1
  • 11
  • 2
    And you're sure you have a good access token? – LetMyPeopleCode Feb 22 '21 at 16:32
  • I used the curl command to get my access token as described on this page - [link](https://developer.amazon.com/docs/app-submission-api/auth.html) and I also used `ask util generate-lwa-tokens` command according to this page [link](https://developer.amazon.com/en-US/docs/alexa/smapi/get-access-token-smapi.html#get-lwa-credentials) – kevin godfrey Feb 23 '21 at 08:16
  • and I got my client-id, client secret from my skills permissions tab, and my security profile. – kevin godfrey Feb 23 '21 at 08:29
  • any luck on the progress? – kyrlon Dec 21 '22 at 21:40

0 Answers0