You need to use ask cli
, I assume you've already installed and configured it on your machine in order to deploy skill. If so - skip the first section:
- Install
ask cli
tool according to ASK CLI Quick Start
- Once it's installed and configured you need to generate auth token using your client-id and secret from your Security Profile, configured to Use SMAPI:
ask util generate-lwa-tokens --client-id <your-client-id> --client-confirmation <your-client-secret>
- It should open the website, click Allow and go back to the console, there should be something like:
The LWA tokens result:
{
"access_token": "Atza|IwEBIJDuJivzzkceXtesWGS5tYIKRZlK0NKp9OWP8TXh4HlFSQxTiMD4V-1QeoSHa8C6(...)",
"refresh_token": "Atzr|IwEBIOyzzw_7(...)",
"token_type": "bearer",
"expires_in": 3600,
"expires_at": "2020-06-03T13:21:04.922Z"
}
- Copy the
access_token
and use it in Authentication header: Authorization: Bearer access_token
in requests from the doc site you've linked.
Hint: you can obtain your vendorId
here:
curl --location --request GET 'https://api.amazonalexa.com/v1/vendors' \
--header 'Authorization: Bearer access_token'
Sample CURL request:
curl --location --request POST 'http://api.amazonalexa.com/v1/skills/api/custom/interactionModel/slotTypes/' \
--header 'Authorization: Bearer access_token' \
--header 'Content-Type: application/json' \
--data-raw '{
"vendorId": "MBT******E",
"slotType": {
"name": "SharedSlot",
"description": "Your shared slot'\''s description"
}
}'
and response:
{
"slotType": {
"id": "amzn1.ask.interactionModel.slotType.e4fc2751-e4be-48c5-9be0-cd193a2ffafb"
}
}