Before invoking SMAPI operations, it is necessary to obtain an access token from Login with Amazon to authenticate your request.
If you intend to use node-alexa-smapi you will need to retreive a refresh token, so here are a few ways to retrieve an initial refresh token:
Option 1 use ask util generate-lwa-tokens (for more information see: https://developer.amazon.com/docs/smapi/ask-cli-command-reference.html#util-command)
Option 2 use Postman to create an auth request and retrieve a token: 1- Under authorization select Type "OAuth 2.0" and click on "Get New Access Token". 2- Complete the form with the following data:
- grant type: autorization code
- Callback URL: http://127.0.0.1:9090/cb (should be configured in https://developer.amazon.com/iba-sp/overview.html)
- Auth URL: https://www.amazon.com/ap/oa
- Access Token URL: https://api.amazon.com/auth/o2/token
- Client ID / Client Secret should be obtained by following these instructions: https://developer.amazon.com/docs/smapi/ask-cli-command-reference.html#util-command
- Scope: alexa::ask:skills:readwrite alexa::ask:models:readwrite alexa::ask:skills:test (for more info see: https://developer.amazon.com/docs/smapi/ask-cli-intro.html)
- Client Authentication: Send client credentials in body