alexa - Can anyone help me with the structure of array of localized attributes in the proactive events API when there are more than one localized attributes?
问题描述
I was playing around with the proactive events but got stuck at the localizedattribute thing. So I was using media content available schema and it has two localizedattribute, and I can't find an example on how to use two of them at once. Any idea? So basically, this works :
{
"timestamp": "2019-01-25T08:41:01.00Z",
"referenceId": "orangfdetango2221800f44-436a-4c47-8d9f-e14356bb010c",
"expiryTime": "2019-01-26T08:20:01.00Z",
"event": {
"name": "AMAZON.MediaContent.Available",
"payload": {
"availability": {
"startTime": "2019-01-23T21:00:00Z",
"method":"DROP"
},
"content": {
"name": "localizedattribute:contentName",
"contentType":"EPISODE"
}
}
},
"localizedAttributes": [
{
"locale": "en-US",
"contentName": "Who Wrote the Bible? - 01/13/2019"
}
],
"relevantAudience": {
"type": "Multicast",
"payload": {}
}
}
But not this because it has two localizedattributes:
{
"timestamp": "2019-01-25T08:41:01.00Z",
"referenceId": "orangfdetango2221800f44-436a-4c47-8d9f-e14356bb010c",
"expiryTime": "2019-01-26T08:20:01.00Z",
"event": {
"name": "AMAZON.MediaContent.Available",
"payload": {
"availability": {
"startTime": "2019-01-25T21:00:00Z",
"provider": {
"name": "localizedattribute:providerName"
},
"method":"STREAM"
},
"content": {
"name": "localizedattribute:contentName",
"contentType":"EPISODE"
}
}
},
"localizedAttributes": [
{
"locale": "en-US",
"providerName": "Lindsborg Covenant Church"
},
{
"locale": "en-US",
"contentName": "Who Wrote the Bible? - 01/13/2019"
}
],
"relevantAudience": {
"type": "Multicast",
"payload": {}
}
}
解决方案
Apparently, it was a simple fix, though I couldn't find it in any documentation.
What needed to be done was changing localized attributes to:
"localizedAttributes": [
{
"locale": "en-US",
"providerName": "Lindsborg Covenant Church",
"contentName": "Who Wrote the Bible? - 01/13/2019"
}
],
推荐阅读
- javascript - 如何将 Bootstrap Burger 菜单功能添加到常规 Bootsrap 菜单?
- python - Dask 分布式确保新工作人员获取由 upload_file 上传的模块
- installation - 用于 Linux 的 Windows 子系统上的 Rust 安装失败:无法重命名组件文件
- java - JHipster Spring boot:org.hibernate.HibernateException:无法访问 lob 流
- ruby-on-rails - 不允许的参数:has_many 中的办公室:通过 Rails 5 中的关联
- apache-spark - 使用 Spark 结构化流的流标准化
- java - 数组动态初始化后无法识别
- javascript - 无法在 Javascript 中定义正确的 RegEx
- python - 计算距离度量后的返回索引
- javascript - SweetAlert2 关闭后滚动到初始元素