询问cli SMAPI node.js接口失败

问题描述

我试图通过nodejs模块获取Ask-Cli的一些指标。这是我的命令和错误

ask smapi get-skill-metrics --skill-id amzn1.ask.skill.xxxxx --start-time 2020-10-14T12:45:00Z --end-time 2020-10-19T12:45:00Z --period PT1H --metric uniqueCustomers --stage live --skill-type custom --locale en-US > metrics.json 

[Error]: { "name": "AskSdkModelRuntime.Defaultapiclient Error" } 

解决方法

是的,我的VPN阻止了该请求。现在可以使用,这里是一个示例数据集。现在弄清楚它的含义:

Operation: getSkillMetricsV1
Payload:
{
  "skillId": "amzn1.ask.skill.xxxx-xx-xx-xx-xxxx","startTime": "2020-10-14T12:45:00Z","endTime": "2020-10-19T12:45:00Z","period": "PT1H","metric": "uniqueCustomers","stage": "live","skillType": "custom","intent": null,"locale": "en-US","maxResults": null,"nextToken": null
}

Response:
{
  "body": {
    "metric": "uniqueCustomers","timestamps": [
      "2020-10-14T12:00:00Z","2020-10-14T13:00:00Z","2020-10-19T12:00:00Z"
    ],"values": [
      36,120,79,46 ]
  },"headers": [  ],"statusCode": 200
}