参考文档
在用户的时间轴上的每个项目作为JSON 一个TimelineItem
结构表示,如下所述。
{
"kind": "mirror#timelineItem",
"id": string,
"sourceItemId": string,
"canonicalUrl": string,
"bundleId": string,
"isBundleCover": boolean,
"selfLink": string,
"created": datetime,
"updated": datetime,
"displayTime": datetime,
"isPinned": boolean,
"pinScore": integer,
"isDeleted": boolean,
"etag": etag,
"creator": contacts Resource,
"recipients": [
contacts Resource
],
"inReplyTo": string,
"title": string,
"text": string,
"html": string,
"htmlPages": [
string
],
"speakableText": string,
"attachments": [
{
"id": string,
"contentType": string,
"contentUrl": string,
"isProcessingContent": boolean
}
],
"location": locations Resource,
"menuItems": [
{
"id": string,
"action": string,
"values": [
{
"state": string,
"displayName": string,
"iconUrl": string
}
],
"removeWhenSelected": boolean
}
],
"notification": {
"level": string,
"deliveryTime": datetime
}
}
Property name | Value | Description | Notes |
---|---|---|---|
kind |
string |
The type of resource. This is always mirror#timelineItem . |
|
id |
string |
The ID of the timeline item. This is unique within a user's timeline. | |
sourceItemId |
string |
Opaque string you can use to map a timeline item to data in your own service. | writable |
canonicalUrl |
string |
A canonical URL pointing to the canonical/high quality version of the data represented by the timeline item. | writable |
bundleId |
string |
The bundle ID for this item. Services can specify a bundleId to group many items together. They appear under a single top-level item on the device. | writable |
isBundleCover |
boolean |
Whether this item is a bundle cover. If an item is marked as a bundle cover, it will be the entry point to the bundle of items that have the same bundleId as that item. It will be shown only on the main timeline — not within the opened bundle.On the main timeline, items that are shown are:
|
writable |
selfLink |
string |
A URL that can be used to retrieve this item. | |
created |
datetime |
The time at which this item was created, formatted according to RFC 3339. | |
updated |
datetime |
The time at which this item was last modified, formatted according to RFC 3339. | |
displayTime |
datetime |
The time that should be displayed when this item is viewed in the timeline, formatted according to RFC 3339. This user's timeline is sorted chronologically on display time, so this will also determine where the item is displayed in the timeline. If not set by the service, the display time defaults to the updated time. |
writable |
isPinned |
boolean |
When true, indicates this item is pinned, which means it's grouped alongside "active" items like navigation and hangouts, on the opposite side of the home screen from historical (non-pinned) timeline items. You can allow the user to toggle the value of this property with the TOGGLE_PINNED built-in menu item. |
|
pinScore |
integer |
For pinned items, this determines the order in which the item is displayed in the timeline, with a higher score appearing closer to the clock. Note: setting this field is currently not supported. | |
isDeleted |
boolean |
When true, indicates this item is deleted, and only the ID property is set. | |
etag |
etag |
ETag for this item. | |
creator |
nested object |
The user or group that created this item. | writable |
recipients[] |
list |
A list of users or groups that this item has been shared with. | writable |
inReplyTo |
string |
If this item was generated as a reply to another item, this field will be set to the ID of the item being replied to. This can be used to attach a reply to the appropriate conversation or post. | |
title |
string |
The title of this item. | writable |
text |
string |
Text content of this item. | writable |
html |
string |
HTML content for this item. If both text and html are provided for an item, the html will be rendered in the timeline. Allowed HTML elements - You can use these elements in your timeline cards.
Blocked HTML elements: These elements and their contents are removed from HTML payloads.
Other elements: Any elements that aren't listed are removed, but their contents are preserved. |
writable |
htmlPages[] |
list |
Additional pages of HTML content associated with this item. If this field is specified, the item will be displayed as a bundle, with the html field as the cover. It is an error to specify this field without specifying the html field. |
writable |
speakableText |
string |
The speakable version of the content of this item. Along with the READ_ALOUD menu item, use this field to provide text that would be clearer when read aloud, or to provide extended information to what is displayed visually on Glass. If you specified html content, use this property instead of text to specify the text to read aloud. |
writable |
attachments[] |
list |
A list of media attachments associated with this item. As a convenience, you can refer to attachments in your HTML payloads with the attachment or cid scheme. For example:
|
|
attachments[].id |
string |
The ID of the attachment. | |
attachments[].contentType |
string |
The MIME type of the attachment. | |
attachments[].contentUrl |
string |
The URL for the content. | |
attachments[].isProcessingContent |
boolean |
Indicates that the contentUrl is not available because the attachment content is still being processed. If the caller wishes to retrieve the content, it should try again later. | |
location |
nested object |
The geographic location associated with this item. | writable |
menuItems[] |
list |
A list of menu items that will be presented to the user when this item is selected in the timeline. | writable |
menuItems[].id |
string |
The ID for this menu item. This is generated by the application and is treated as an opaque token. | writable |
menuItems[].action |
string |
Controls the behavior when the user picks the menu option. Allowed values are:
|
writable |
menuItems[].values[] |
list |
For CUSTOM items, a list of values controlling the appearance of the menu item in each of its states. A value for the DEFAULT state must be provided. If the PENDING or CONFIRMED states are missing, they will not be shown. |
writable |
menuItems[].values[].displayName |
string |
The name to display for the menu item. | writable |
menuItems[].values[].iconUrl |
string |
URL of an icon to display with the menu item. | writable |
menuItems[].values[].state |
string |
The state that this value applies to. Allowed values are:
|
writable |
menuItems[].removeWhenSelected |
boolean |
If set to true on a CUSTOM menu item, that item will be removed from the menu after it is selected. |
writable |
notification |
nested object |
Controls how notifications for this item are presented on the device. If this is missing, no notification will be generated. | writable |
notification.level |
string |
Describes how important the notification is. Allowed values are:
|
writable |
notification.deliveryTime |
datetime |
The time at which the notification should be delivered. | writable |