question

newuser-a69e6bcb-9fa9-4df6-9435-74bf6918fe61 avatar image

SMAPI returns 401 on POST/PUT, but not on GET

I would like to programatically create, retrieve and create skill via the SMAPI. The LWA process is implemented, I have obtained the access/refresh token pair, and I am able to do pretty much any GET operation with no problem.


However, as soon as I try POSTing to v1/skills, I am met with the exception:


{
    "message": "You do not have access to the resource."
}

I have tried passing the Authorization header as both

Authorization: Bearer Atza|...

and

Authorization: Atza|...

But both variants end up the same.


The scopes seemt to be in order. I am requesting

alexa::ask:skills:readwrite alexa::ask:skills:test alexa::ask:models:readwrite alexa::ask:skills:test alexa::ask:models:read alexa::ask:skills:read


The final request URL looks like this:

https://www.amazon.com/ap/oa?client_id=xyba&scope=alexa%3A%3Aask%3Askills%3Areadwrite%20alexa%3A%3Aask%3Askills%3Atest%20alexa%3A%3Aask%3Amodels%3Areadwrite%20alexa%3A%3Aask%3Askills%3Atest%20alexa%3A%3Aask%3Amodels%3Aread%20alexa%3A%3Aask%3Askills%3Aread&response_type=code&redirect_uri=abyx


Indeed, if we look at the permissions that my security profile has obtained, we can see the following:

The request body is not malformed. If I remove one of the parameters, then I get "Request is missing required parameter(s)."


Any help is greatly appreciated.

alexa skills kitsmapi
a.png (175.5 KiB)
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

0 Answers