我正在开发一个燃料聊天机器人,从谷歌驱动器获得文件的内容,以建立画廊。我正在使用JSON API (Fuel chatbot)来获取JSON响应。我在驱动器中的文件:https://drive.google.com/file/d/0Bx79Tkj95Q3iNmVHOFN0Q3BITE0/view我想得到如下的JSON响应:
{
"messages": [
{
"attachment":{
"type":"template",
"payload":{
"template_type":"generic",
"elements":[
{
"title":"Classic White T-Shirt",
"image_url":"http://petersapparel.parseapp.com/img/item100-thumb.png",
"subtitle":"Soft white cotton t-shirt is back in style",
"buttons":[
{
"type":"web_url",
"url":"https://petersapparel.parseapp.com/view_item?item_id=100",
"title":"View Item"
},
{
"type":"web_url",
"url":"https://petersapparel.parseapp.com/buy_item?item_id=100",
"title":"Buy Item"
}
]
},
{
"title":"Classic Grey T-Shirt",
"image_url":"http://petersapparel.parseapp.com/img/item101-thumb.png",
"subtitle":"Soft gray cotton t-shirt is back in style",
"buttons":[
{
"type":"web_url",
"url":"https://petersapparel.parseapp.com/view_item?item_id=101",
"title":"View Item"
},
{
"type":"web_url",
"url":"https://petersapparel.parseapp.com/buy_item?item_id=101",
"title":"Buy Item"
}
]
}
]
}
}
}
]
}
我尝试通过URL获取文件的内容:
https://www.googleapis.com/drive/v3/files/0Bx79Tkj95Q3iNmVHOFN0Q3BITE0/export?mimeType=application/vnd.google-apps.file但是我得到了回复

对于获得JSON响应,您有什么建议吗?
发布于 2017-08-16 19:10:14
考虑此documentation,然后再次测试。
您的错误是:
403:超过每日限制
已达到您的项目的礼貌API限制。
{“错误”:{“错误”:{“域”:"usageLimits",“原因”:"dailyLimitExceeded",“消息”:“超过每日限制”},“代码”:403,“消息”:“超过每日限制”}}
建议的操作:请求额外的配额。
基于SO post,您可以执行以下操作来消除错误。
您将看到客户端ID和客户端密码值。您将使用这些值来启用与您的项目和Google API的通信。
如果您还没有使用它,请参阅Google+ iOS SDK and documentation以获得完整的演练。名为"write moments“的任务在实现上类似,它演示了如何在使用Google+的iOS项目中连接和使用SDK。
您需要指定plus.me的作用域才能获取配置文件信息。
希望这能有所帮助。
https://stackoverflow.com/questions/45697174
复制相似问题