-
Notifications
You must be signed in to change notification settings - Fork 51
How to get AVS Token 2
Here is the new way to get an AVS token:
$ npm run avs-token-helper
$ npm run avs-refreshToken-helper
This is another way of getting a refresh token as pointed out by @NilSkilz Link to original discussion: https://github.com/dolanmiu/MMM-awesome-alexa/issues/14
Just to document my process somewhat…
-
Make sure to add https://sakirtemel.github.io/MMM-alexa/ to the list of Redirect URLs for your device in the AVS product.
-
Go to: https://sakirtemel.github.io/MMM-alexa/ to generate the ‘Code’.
-
Once you have the
Code
, download a REST console in Chrome such as https://chrome.google.com/webstore/detail/advanced-rest-client/hgmloofddffdnphfgcellkdfbfbjeloo, or https://chrome.google.com/webstore/detail/postman/fhbjgbiflinjbdggehcddcbncdddomop?hl=en. -
Send a
POST
request to: https://api.amazon.com/auth/o2/token -
In the
Data Form
, add your parameters for:client_id
client_secret
code
grant_type
redirect_uri
-
The
Code
generated is linked to theredirect_uri
- so it needs to be the same one, in this case https://sakirtemel.github.io/MMM-alexa/. (Use this as it’s url encoded:https%3A%2F%2Fsakirtemel.github.io%2FMMM-alexa%2F
) -
The code is single use, so if something goes wrong and it doesn’t work, you’ll need to generate a new code to try again.
-
From that you get the
refresh_token
.