Alexa.ChannelController で ERR_UNESCAPED_CHARACTERS

Alexa.ChannelController のテスト中に

Response:
{
  "errorType": "Runtime.UnhandledPromiseRejection",
  "errorMessage": "TypeError [ERR_UNESCAPED_CHARACTERS]: Request path contains unescaped characters",
  "trace": [
    "Runtime.UnhandledPromiseRejection: TypeError [ERR_UNESCAPED_CHARACTERS]: Request path contains unescaped characters",
    "    at process. (/var/runtime/index.js:35:15)",
    "    at process.emit (events.js:210:5)",
    "    at processPromiseRejections (internal/process/promises.js:201:33)",
    "    at processTicksAndRejections (internal/process/task_queues.js:94:32)"
  ]
}
なエラー

エスケープが行われてないとか...

原因は、テストで使用した公式サイトにある↓リクエストデータ
https://developer.amazon.com/ja-JP/docs/alexa/device-apis/alexa-channelcontroller.html#changechannel

{
  "directive": {
    "header": {
      "namespace": "Alexa.ChannelController",
      "name": "ChangeChannel",
      "messageId": "abc-123-def-456",
      "correlationToken": "dFMb0z+PgpgdDmluhJ1LddFvSqZ/jCc8ptlAKulUj90jSqg==",
      "payloadVersion": "3"
    },
    "endpoint": {
      "scope": {
        "type": "BearerToken",
        "token": "access-token-from-skill"
      },
      "endpointId": "device-001",
      "cookie": {}
    },
    "payload": {
      "channel": {
        "number": "1234",
        "callSign": "KSTATION1",
        "affiliateCallSign": "KSTATION2",
        "uri": "someUrl"
      },
      "channelMetadata": {
        "name": "チャンネルの別名",
        "image": "urlToImage"
      }
    }
  }
}
ここにある「チャンネルの別名」がソレらしく、半角文字でないとNGらしい

コメント