mirror api introduction
DESCRIPTION
Introduction to the Mirror API basics for #hack4wear at Campus London on 30th Nov 2013TRANSCRIPT
![Page 1: Mirror API introduction](https://reader033.vdocuments.site/reader033/viewer/2022052411/557b9ec1d8b42aa5758b52a9/html5/thumbnails/1.jpg)
Mirror PIMirrorintroduction
slideshare.net/
linkedin.com/in/
twitter.com/
google.com/+} radeksimko
![Page 3: Mirror API introduction](https://reader033.vdocuments.site/reader033/viewer/2022052411/557b9ec1d8b42aa5758b52a9/html5/thumbnails/3.jpg)
![Page 4: Mirror API introduction](https://reader033.vdocuments.site/reader033/viewer/2022052411/557b9ec1d8b42aa5758b52a9/html5/thumbnails/4.jpg)
How?
![Page 6: Mirror API introduction](https://reader033.vdocuments.site/reader033/viewer/2022052411/557b9ec1d8b42aa5758b52a9/html5/thumbnails/6.jpg)
Insert a new cardPOST /mirror/v1/timeline HTTP/1.1Host: www.googleapis.comAuthorization: Bearer auth tokenContent-Type: application/jsonContent-Length: 26
{ "text": "Hello world" }
![Page 7: Mirror API introduction](https://reader033.vdocuments.site/reader033/viewer/2022052411/557b9ec1d8b42aa5758b52a9/html5/thumbnails/7.jpg)
Card with HTMLPOST /mirror/v1/timeline HTTP/1.1Host: www.googleapis.comAuthorization: Bearer auth tokenContent-Type: application/jsonContent-Length: 26
{ "html": "<article><section><p>This <em>quotation</em>is <strong>strong</strong></p></section></article>" }
![Page 8: Mirror API introduction](https://reader033.vdocuments.site/reader033/viewer/2022052411/557b9ec1d8b42aa5758b52a9/html5/thumbnails/8.jpg)
Updating an existing cardPUT /mirror/v1/timeline/{id} HTTP/1.1Host: www.googleapis.comAuthorization: Bearer auth tokenContent-Type: application/json
{ "text": "Hello world", "location": { ... } "menuItems": [ { "action": "NAVIGATE" } ]}
![Page 9: Mirror API introduction](https://reader033.vdocuments.site/reader033/viewer/2022052411/557b9ec1d8b42aa5758b52a9/html5/thumbnails/9.jpg)
Updating an existing cardPATCH /mirror/v1/timeline/{id} HTTP/1.1Host: www.googleapis.comAuthorization: Bearer auth tokenContent-Type: application/json
{ "text": "Hello world" }
![Page 10: Mirror API introduction](https://reader033.vdocuments.site/reader033/viewer/2022052411/557b9ec1d8b42aa5758b52a9/html5/thumbnails/10.jpg)
Deleting a cardDELETE /mirror/v1/timeline/{id} HTTP/1.1Host: www.googleapis.comAuthorization: Bearer auth token
![Page 11: Mirror API introduction](https://reader033.vdocuments.site/reader033/viewer/2022052411/557b9ec1d8b42aa5758b52a9/html5/thumbnails/11.jpg)
Menu ItemsPOST /mirror/v1/timeline HTTP/1.1Host: www.googleapis.comAuthorization: Bearer auth tokenContent-Type: application/json
{ "text": "Lorem ipsum dolor sit amet.", "speakableText": "Some boring sample words", "menuItems": [ { "action": "READ_ALOUD" }, { "action": "TOGGLE_PINNED" }, ]}
![Page 12: Mirror API introduction](https://reader033.vdocuments.site/reader033/viewer/2022052411/557b9ec1d8b42aa5758b52a9/html5/thumbnails/12.jpg)
Subscriptions APIWhen a user selects a menu item
When a user shares content with a contact
The user's location, every 10 mins
![Page 13: Mirror API introduction](https://reader033.vdocuments.site/reader033/viewer/2022052411/557b9ec1d8b42aa5758b52a9/html5/thumbnails/13.jpg)
Subscribe to a user's locationPOST /mirror/v1/subscriptions HTTP/1.1Authorization: Bearer auth tokenContent-Type: application/jsonContent-Length: length
{ "collection": "location", "operation": [ "UPDATE" ], "callbackUrl": "https://example.com/callback"}
![Page 14: Mirror API introduction](https://reader033.vdocuments.site/reader033/viewer/2022052411/557b9ec1d8b42aa5758b52a9/html5/thumbnails/14.jpg)
Location APIGET /mirror/v1/locations HTTP/1.1Authorization: Bearer auth tokenContent-Type: application/jsonContent-Length: length
{ "id": "latest"}
![Page 15: Mirror API introduction](https://reader033.vdocuments.site/reader033/viewer/2022052411/557b9ec1d8b42aa5758b52a9/html5/thumbnails/15.jpg)
Insert a new contact with callbackPOST /mirror/v1/contacts HTTP/1.1Authorization: Bearer auth tokenContent-Type: application/jsonContent-Length: length
{ "id": "instagram", "displayName": "Instagram", "acceptTypes": [ "image/*" ], "imageUrls": [ "instagram.jpg" ]}
![Page 16: Mirror API introduction](https://reader033.vdocuments.site/reader033/viewer/2022052411/557b9ec1d8b42aa5758b52a9/html5/thumbnails/16.jpg)
When user shares a picturePOST /mirror/v1/subscriptions HTTP/1.1Authorization: Bearer auth tokenContent-Type: application/jsonContent-Length: length
{ "collection": "timeline", "operation": [ "UPDATE" ], "callbackUrl": "https://example.com/callback"}
![Page 17: Mirror API introduction](https://reader033.vdocuments.site/reader033/viewer/2022052411/557b9ec1d8b42aa5758b52a9/html5/thumbnails/17.jpg)
When user shares a picture{ "collection": "timeline", "itemId": "3hidvm0xez6r8_dacdb3103b8b604_h8rpllg", "operation": "UPDATE", "userActions": [ { "type": "SHARE" } ]}
![Page 18: Mirror API introduction](https://reader033.vdocuments.site/reader033/viewer/2022052411/557b9ec1d8b42aa5758b52a9/html5/thumbnails/18.jpg)
When user shares a picture{ "id": "3hidvm0xez6r8_dacdb3103b8b604_h8rpllg", "attachments": [ { "contentType": "image/jpeg", "id": "<ATTACHMENT_ID>" } ], "recipients": [ { "kind": "glass#contact", "source": "api:<SERVICE_ID>", "id": "<CONTACT_ID>", "displayName": "<CONTACT_DISPLAY_NAME>", "imageUrls": [ "<CONTACT_ICON_URL>" ] } ]}
![Page 19: Mirror API introduction](https://reader033.vdocuments.site/reader033/viewer/2022052411/557b9ec1d8b42aa5758b52a9/html5/thumbnails/19.jpg)
GuidelinesDesign for Glass
Keep it timely and relevant
Do not get in the way (CNN, Twitter, GMail)
Avoid the unexpected (time, frequency, location)
![Page 20: Mirror API introduction](https://reader033.vdocuments.site/reader033/viewer/2022052411/557b9ec1d8b42aa5758b52a9/html5/thumbnails/20.jpg)
![Page 21: Mirror API introduction](https://reader033.vdocuments.site/reader033/viewer/2022052411/557b9ec1d8b42aa5758b52a9/html5/thumbnails/21.jpg)
Thanks, stay in touchslideshare.net/
linkedin.com/in/
twitter.com/
google.com/+} radeksimko