Skip to content

How to get AVS Token 2

Dolan edited this page Apr 23, 2018 · 2 revisions

NOTE: DEPRECATED

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…

  1. Make sure to add https://sakirtemel.github.io/MMM-alexa/ to the list of Redirect URLs for your device in the AVS product.

  2. Go to: https://sakirtemel.github.io/MMM-alexa/ to generate the ‘Code’.

  3. 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.

  4. Send a POST request to: https://api.amazon.com/auth/o2/token

  5. In the Data Form, add your parameters for: client_id client_secret code grant_type redirect_uri

  6. The Code generated is linked to the redirect_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)

  7. 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.

  8. From that you get the refresh_token.

Clone this wiki locally