<html><body> <style> body, h1, h2, h3, div, span, p, pre, a { margin: 0; padding: 0; border: 0; font-weight: inherit; font-style: inherit; font-size: 100%; font-family: inherit; vertical-align: baseline; } body { font-size: 13px; padding: 1em; } h1 { font-size: 26px; margin-bottom: 1em; } h2 { font-size: 24px; margin-bottom: 1em; } h3 { font-size: 20px; margin-bottom: 1em; margin-top: 1em; } pre, code { line-height: 1.5; font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace; } pre { margin-top: 0.5em; } h1, h2, h3, p { font-family: Arial, sans serif; } h1, h2, h3 { border-bottom: solid #CCC 1px; } .toc_element { margin-top: 0.5em; } .firstline { margin-left: 2 em; } .method { margin-top: 1em; border: solid 1px #CCC; padding: 1em; background: #EEE; } .details { font-weight: bold; font-size: 14px; } </style> <h1><a href="mirror_v1.html">Google Mirror API</a> . <a href="mirror_v1.subscriptions.html">subscriptions</a></h1> <h2>Instance Methods</h2> <p class="toc_element"> <code><a href="#delete">delete(id)</a></code></p> <p class="firstline">Deletes a subscription.</p> <p class="toc_element"> <code><a href="#insert">insert(body)</a></code></p> <p class="firstline">Creates a new subscription.</p> <p class="toc_element"> <code><a href="#list">list()</a></code></p> <p class="firstline">Retrieves a list of subscriptions for the authenticated user and service.</p> <p class="toc_element"> <code><a href="#update">update(id, body)</a></code></p> <p class="firstline">Updates an existing subscription in place.</p> <h3>Method Details</h3> <div class="method"> <code class="details" id="delete">delete(id)</code> <pre>Deletes a subscription. Args: id: string, The ID of the subscription. (required) </pre> </div> <div class="method"> <code class="details" id="insert">insert(body)</code> <pre>Creates a new subscription. Args: body: object, The request body. (required) The object takes the form of: { # A subscription to events on a collection. "kind": "mirror#subscription", # The type of resource. This is always mirror#subscription. "notification": { # A notification delivered by the API. # Container object for notifications. This is not populated in the Subscription resource. "itemId": "A String", # The ID of the item that generated the notification. "collection": "A String", # The collection that generated the notification. "verifyToken": "A String", # The secret verify token provided by the service when it subscribed for notifications. "userToken": "A String", # The user token provided by the service when it subscribed for notifications. "userActions": [ # A list of actions taken by the user that triggered the notification. { # Represents an action taken by the user that triggered a notification. "type": "A String", # The type of action. The value of this can be: # - SHARE - the user shared an item. # - REPLY - the user replied to an item. # - REPLY_ALL - the user replied to all recipients of an item. # - CUSTOM - the user selected a custom menu item on the timeline item. # - DELETE - the user deleted the item. # - PIN - the user pinned the item. # - UNPIN - the user unpinned the item. # - LAUNCH - the user initiated a voice command. In the future, additional types may be added. UserActions with unrecognized types should be ignored. "payload": "A String", # An optional payload for the action. # # For actions of type CUSTOM, this is the ID of the custom menu item that was selected. }, ], "operation": "A String", # The type of operation that generated the notification. }, "updated": "A String", # The time at which this subscription was last modified, formatted according to RFC 3339. "collection": "A String", # The collection to subscribe to. Allowed values are: # - timeline - Changes in the timeline including insertion, deletion, and updates. # - locations - Location updates. # - settings - Settings updates. "verifyToken": "A String", # A secret token sent to the subscriber in notifications so that it can verify that the notification was generated by Google. "userToken": "A String", # An opaque token sent to the subscriber in notifications so that it can determine the ID of the user. "operation": [ # A list of operations that should be subscribed to. An empty list indicates that all operations on the collection should be subscribed to. Allowed values are: # - UPDATE - The item has been updated. # - INSERT - A new item has been inserted. # - DELETE - The item has been deleted. # - MENU_ACTION - A custom menu item has been triggered by the user. "A String", ], "id": "A String", # The ID of the subscription. "callbackUrl": "A String", # The URL where notifications should be delivered (must start with https://). } Returns: An object of the form: { # A subscription to events on a collection. "kind": "mirror#subscription", # The type of resource. This is always mirror#subscription. "notification": { # A notification delivered by the API. # Container object for notifications. This is not populated in the Subscription resource. "itemId": "A String", # The ID of the item that generated the notification. "collection": "A String", # The collection that generated the notification. "verifyToken": "A String", # The secret verify token provided by the service when it subscribed for notifications. "userToken": "A String", # The user token provided by the service when it subscribed for notifications. "userActions": [ # A list of actions taken by the user that triggered the notification. { # Represents an action taken by the user that triggered a notification. "type": "A String", # The type of action. The value of this can be: # - SHARE - the user shared an item. # - REPLY - the user replied to an item. # - REPLY_ALL - the user replied to all recipients of an item. # - CUSTOM - the user selected a custom menu item on the timeline item. # - DELETE - the user deleted the item. # - PIN - the user pinned the item. # - UNPIN - the user unpinned the item. # - LAUNCH - the user initiated a voice command. In the future, additional types may be added. UserActions with unrecognized types should be ignored. "payload": "A String", # An optional payload for the action. # # For actions of type CUSTOM, this is the ID of the custom menu item that was selected. }, ], "operation": "A String", # The type of operation that generated the notification. }, "updated": "A String", # The time at which this subscription was last modified, formatted according to RFC 3339. "collection": "A String", # The collection to subscribe to. Allowed values are: # - timeline - Changes in the timeline including insertion, deletion, and updates. # - locations - Location updates. # - settings - Settings updates. "verifyToken": "A String", # A secret token sent to the subscriber in notifications so that it can verify that the notification was generated by Google. "userToken": "A String", # An opaque token sent to the subscriber in notifications so that it can determine the ID of the user. "operation": [ # A list of operations that should be subscribed to. An empty list indicates that all operations on the collection should be subscribed to. Allowed values are: # - UPDATE - The item has been updated. # - INSERT - A new item has been inserted. # - DELETE - The item has been deleted. # - MENU_ACTION - A custom menu item has been triggered by the user. "A String", ], "id": "A String", # The ID of the subscription. "callbackUrl": "A String", # The URL where notifications should be delivered (must start with https://). }</pre> </div> <div class="method"> <code class="details" id="list">list()</code> <pre>Retrieves a list of subscriptions for the authenticated user and service. Args: Returns: An object of the form: { # A list of Subscriptions. This is the response from the server to GET requests on the subscription collection. "items": [ # The list of subscriptions. { # A subscription to events on a collection. "kind": "mirror#subscription", # The type of resource. This is always mirror#subscription. "notification": { # A notification delivered by the API. # Container object for notifications. This is not populated in the Subscription resource. "itemId": "A String", # The ID of the item that generated the notification. "collection": "A String", # The collection that generated the notification. "verifyToken": "A String", # The secret verify token provided by the service when it subscribed for notifications. "userToken": "A String", # The user token provided by the service when it subscribed for notifications. "userActions": [ # A list of actions taken by the user that triggered the notification. { # Represents an action taken by the user that triggered a notification. "type": "A String", # The type of action. The value of this can be: # - SHARE - the user shared an item. # - REPLY - the user replied to an item. # - REPLY_ALL - the user replied to all recipients of an item. # - CUSTOM - the user selected a custom menu item on the timeline item. # - DELETE - the user deleted the item. # - PIN - the user pinned the item. # - UNPIN - the user unpinned the item. # - LAUNCH - the user initiated a voice command. In the future, additional types may be added. UserActions with unrecognized types should be ignored. "payload": "A String", # An optional payload for the action. # # For actions of type CUSTOM, this is the ID of the custom menu item that was selected. }, ], "operation": "A String", # The type of operation that generated the notification. }, "updated": "A String", # The time at which this subscription was last modified, formatted according to RFC 3339. "collection": "A String", # The collection to subscribe to. Allowed values are: # - timeline - Changes in the timeline including insertion, deletion, and updates. # - locations - Location updates. # - settings - Settings updates. "verifyToken": "A String", # A secret token sent to the subscriber in notifications so that it can verify that the notification was generated by Google. "userToken": "A String", # An opaque token sent to the subscriber in notifications so that it can determine the ID of the user. "operation": [ # A list of operations that should be subscribed to. An empty list indicates that all operations on the collection should be subscribed to. Allowed values are: # - UPDATE - The item has been updated. # - INSERT - A new item has been inserted. # - DELETE - The item has been deleted. # - MENU_ACTION - A custom menu item has been triggered by the user. "A String", ], "id": "A String", # The ID of the subscription. "callbackUrl": "A String", # The URL where notifications should be delivered (must start with https://). }, ], "kind": "mirror#subscriptionsList", # The type of resource. This is always mirror#subscriptionsList. }</pre> </div> <div class="method"> <code class="details" id="update">update(id, body)</code> <pre>Updates an existing subscription in place. Args: id: string, The ID of the subscription. (required) body: object, The request body. (required) The object takes the form of: { # A subscription to events on a collection. "kind": "mirror#subscription", # The type of resource. This is always mirror#subscription. "notification": { # A notification delivered by the API. # Container object for notifications. This is not populated in the Subscription resource. "itemId": "A String", # The ID of the item that generated the notification. "collection": "A String", # The collection that generated the notification. "verifyToken": "A String", # The secret verify token provided by the service when it subscribed for notifications. "userToken": "A String", # The user token provided by the service when it subscribed for notifications. "userActions": [ # A list of actions taken by the user that triggered the notification. { # Represents an action taken by the user that triggered a notification. "type": "A String", # The type of action. The value of this can be: # - SHARE - the user shared an item. # - REPLY - the user replied to an item. # - REPLY_ALL - the user replied to all recipients of an item. # - CUSTOM - the user selected a custom menu item on the timeline item. # - DELETE - the user deleted the item. # - PIN - the user pinned the item. # - UNPIN - the user unpinned the item. # - LAUNCH - the user initiated a voice command. In the future, additional types may be added. UserActions with unrecognized types should be ignored. "payload": "A String", # An optional payload for the action. # # For actions of type CUSTOM, this is the ID of the custom menu item that was selected. }, ], "operation": "A String", # The type of operation that generated the notification. }, "updated": "A String", # The time at which this subscription was last modified, formatted according to RFC 3339. "collection": "A String", # The collection to subscribe to. Allowed values are: # - timeline - Changes in the timeline including insertion, deletion, and updates. # - locations - Location updates. # - settings - Settings updates. "verifyToken": "A String", # A secret token sent to the subscriber in notifications so that it can verify that the notification was generated by Google. "userToken": "A String", # An opaque token sent to the subscriber in notifications so that it can determine the ID of the user. "operation": [ # A list of operations that should be subscribed to. An empty list indicates that all operations on the collection should be subscribed to. Allowed values are: # - UPDATE - The item has been updated. # - INSERT - A new item has been inserted. # - DELETE - The item has been deleted. # - MENU_ACTION - A custom menu item has been triggered by the user. "A String", ], "id": "A String", # The ID of the subscription. "callbackUrl": "A String", # The URL where notifications should be delivered (must start with https://). } Returns: An object of the form: { # A subscription to events on a collection. "kind": "mirror#subscription", # The type of resource. This is always mirror#subscription. "notification": { # A notification delivered by the API. # Container object for notifications. This is not populated in the Subscription resource. "itemId": "A String", # The ID of the item that generated the notification. "collection": "A String", # The collection that generated the notification. "verifyToken": "A String", # The secret verify token provided by the service when it subscribed for notifications. "userToken": "A String", # The user token provided by the service when it subscribed for notifications. "userActions": [ # A list of actions taken by the user that triggered the notification. { # Represents an action taken by the user that triggered a notification. "type": "A String", # The type of action. The value of this can be: # - SHARE - the user shared an item. # - REPLY - the user replied to an item. # - REPLY_ALL - the user replied to all recipients of an item. # - CUSTOM - the user selected a custom menu item on the timeline item. # - DELETE - the user deleted the item. # - PIN - the user pinned the item. # - UNPIN - the user unpinned the item. # - LAUNCH - the user initiated a voice command. In the future, additional types may be added. UserActions with unrecognized types should be ignored. "payload": "A String", # An optional payload for the action. # # For actions of type CUSTOM, this is the ID of the custom menu item that was selected. }, ], "operation": "A String", # The type of operation that generated the notification. }, "updated": "A String", # The time at which this subscription was last modified, formatted according to RFC 3339. "collection": "A String", # The collection to subscribe to. Allowed values are: # - timeline - Changes in the timeline including insertion, deletion, and updates. # - locations - Location updates. # - settings - Settings updates. "verifyToken": "A String", # A secret token sent to the subscriber in notifications so that it can verify that the notification was generated by Google. "userToken": "A String", # An opaque token sent to the subscriber in notifications so that it can determine the ID of the user. "operation": [ # A list of operations that should be subscribed to. An empty list indicates that all operations on the collection should be subscribed to. Allowed values are: # - UPDATE - The item has been updated. # - INSERT - A new item has been inserted. # - DELETE - The item has been deleted. # - MENU_ACTION - A custom menu item has been triggered by the user. "A String", ], "id": "A String", # The ID of the subscription. "callbackUrl": "A String", # The URL where notifications should be delivered (must start with https://). }</pre> </div> </body></html>