ASK CLIでスキル内商品の情報を取得するコマンドいろいろ
スキル内商品が日本でもはじまりました。しかしASK CLIやSMAPIで管理している人としては、「どういうJSONをどこにおいたらいいの?」という疑問がでてきます。 ということで、もろもろのコマンドをまとめました。 スキ […]
広告ここから
広告ここまで
目次
スキル内商品が日本でもはじまりました。しかしASK CLIやSMAPIで管理している人としては、「どういうJSONをどこにおいたらいいの?」という疑問がでてきます。
ということで、もろもろのコマンドをまとめました。
スキル内商品の一覧取得
Vendor IDが必要ですので、あらかじめAmazonの開発者コンソールから取得しておきます。
$ ask api  list-isp-for-vendor --vendor-id YOUR_VENDOR_ID
{
  "inSkillProductSummaryList": [
    {
      "editableState": "EDITABLE",
      "lastUpdated": "2018-11-28T00:45:10.010Z",
      "nameByLocale": {
        "en-US": "Five Hint Pack"
      },
      "pricing": {
        "amazon.com": {
          "defaultPriceListing": {
            "currency": "USD",
            "price": 0.99,
            "primeMemberPrice": 0.8
          },
          "releaseDate": "2018-10-01T00:00:00Z"
        }
      },
      "productId": "amzn1.adg.product.xxxxxxxxx",
      "purchasableState": "PURCHASABLE",
      "referenceName": "Five_Hint_Pack",
      "stage": "development",
      "status": "COMPLETE",
      "type": "CONSUMABLE"
    }
  ]
}
スキル内商品の詳細取得
ASK CLIでデプロイする際に利用するJSONはask api get-ispから取得できます。
$ ask api get-isp -i amzn1.adg.product.xxxxxx --stage development
{
  "version": "1.0",
  "type": "CONSUMABLE",
  "referenceName": "Five_Hint_Pack",
  "publishingInformation": {
    "locales": {
      "en-US": {
        "name": "Five Hint Pack",
        "summary": "The Five Hint Pack will give you five hints to help you solve our questions.",
        "description": "The Five Hint Pack will give you five hints to help you solve our questions.",
        "smallIconUri": "https://s3.amazonaws.com/CAPS-SSE/echo_developer/b",
        "largeIconUri": "https://s3.amazonaws.com/CAPS-SSE/echo_developer/7",
        "examplePhrases": [
          "TODO: REPLACE THIS WITH SAMPLE UTTERANCE FOR HOW USERS WILL BUY OR INVOKE THIS PRODUCT - 'Alexa, buy product name'  Or 'Alexa, play product name'"
        ],
        "keywords": [
          "TODO: REPLACE THIS WITH ARRAY OF KEYWORDS TO BE USED FOR SEARCH INDEXING THE PRODUCT"
        ],
        "customProductPrompts": {
          "purchasePromptDescription": "This will give you five hints to help you solve our questions.",
          "boughtCardDescription": "You have successfully purchased the five hint pack!"
        }
      }
    },
    "distributionCountries": [
      "US"
    ],
    "pricing": {
      "amazon.com": {
        "releaseDate": "2018-10-01T00:00Z",
        "defaultPriceListing": {
          "price": 0.99,
          "currency": "USD"
        }
      }
    },
    "taxInformation": {
      "category": "SOFTWARE"
    }
  },
  "privacyAndCompliance": {
    "locales": {
      "en-US": {
        "privacyPolicyUrl": "https://localhost/privacy.html"
      }
    }
  },
  "testingInstructions": "TODO: REPLACE THIS WITH TESTING INSTRUCTIONS FOR THE CERTIFICATION TEAM SO THEY KNOW HOW TO PURCHASE AND USE THIS PRODUCT",
  "purchasableState": "PURCHASABLE"
}
--stageについては、ask list-isp-for-vendorで確認するのが手っ取り早いかもしれません。