时间轴(Timeline)你的用户的时间轴被分为时间表项目。您可以使用API接入和管理项目通过HTTP的REST操作时间表。(Youruser'.) 注意:时间轴的产品最后七天在用户的玻璃和30天镜象API。(Note: Timelineitemslastforsevendaysonauser'sGlassand30daysintheMirrorAPI.)插入一个简单的时间轴项目阅读时间表项目插入一个时间表与媒体项目访问附件捆绑卡用户交互菜单项使用内置的菜单项定义自定义菜单项允许用户固定时间表卡插入一个简单的时间轴项目要插入一个时间表项,POST一个 JSON表示的时间表项目的REST端点。大多数字段都是可选的。最简单的形式,一个时间表项目只包含一个简短的文字消息。这是一个简单的时间表项目如何被插入。(To insert atimelineitem,POSTa JSONrepresentationofatimelineitem ,.)原始HTTP的Java的POST/mirror/v1/timelineHTTP/:orization:Bearer{authtoken}Content-Type:application/jsonContent-Length:26{"text":"Helloworld"}Java的TimelineItemtimelineItem=newTimelineItem();("Helloworld");().insert(timelineItem).execute();在成功时,服务器会返回一个201响应代码创建创建项目的完整副本。对于上面的例子,可能看起来像一个成功的响应:(ess,,essfulresponsemightlooklike:)原始的HTTPHTTP/:Tue,25Sep201223:30:11GMTContent-Type:application/jsonContent-Length:303{ "kind":"glass#timelineItem", "id":"1234567890", "selfLink":"https://ror/v1/timeline/1234567890", "created":"2012-09-25T23:28:", "updated":"2012-09-25T23:28:", "etag":"\"G5BI0RWvj-0jWdBrdWrPZV7xPKw/t25selcGS3uDEVT6FB09hAG-QQ\"", "text":"Helloworld"}插入项目,将出现在用户的时间轴看起来像这样:(Theinserteditemthatwouldappearintheuser'stimelinelookslikethis:)阅读时间表项目(Readingtimelineitems)你的服务可以访问所有的时间表,它创建项目,以及所有共享项目时间表。以下是如何 为您服务是可见的项目列出时间表。(essalltimelineitemsthatitcreated,'showto list thetimelineitemsthatarevisibletoyourservice.)原始HTTP的GET/mirror/v1/timelineHTTP/:orization:Bearer{authtoken}Java的TimelineItemtimelineItem=newTimelineItem();().list().execute();您可以使用其他REST操作, 更新和 删除时间轴项目。(YoucanuseotherRES
google glass api 开发指南(google翻译附英文) 来自淘豆网m.daumloan.com转载请标明出处.