2013年4月17日水曜日

Google Glass APIのデータ形式はjson

今日は時間があったのでSXSWのカンファレンスをyoutubeで見ました。

そこでGoogle GlassのAPIの概要が説明されていたのですが、Google GlassAPIのデータ形式はjsonなのですね!!

やはりというかやっぱjavaScript時代到来ですね。
やっぱjsonは処理しやすいですよね。javaScriptと相性が良い。
個人的にrails + node + backboneが今一番開発しやすいような気がします。

というわけで発表されていたgoogle glass APIまとめです。

Timeline cards

Timeline cards insert
POST /mirror/v1/timeline HTTP1.1
Host: www.googleapis.com
Authorization: Bearer {auth token}
Content-Type: application/json
Content-Length: 29

{
 "text": "Hello, world"
}

Timeline cards update
PUT /mirror/v1/timeline HTTP1.1
Host: www.googleapis.com
Authorization: Bearer {auth token}
Content-Type: application/json
Content-Length: 29

{
 "text": "Hello, world"
}

Card Options

  • Reply
  • Read aloud
card options insert
 
POST /mirror/v1/timeline HTTP1.1
Content-Type: application/json
Content-Length: 87

{
 "text": "Hello, world",
 "cardOptions" : [
 {
  "actions": "READ_ALOUD" 
 }]
}

Timeline cards insert 2
POST /mirror/v1/timeline HTTP1.1
Content-Type: application/json
Content-Length: 234

{
 "text": "Hello, world",
 "cardOptions" : [
 {
  "actions": "CUSTOM",
  "id": "loves",
  "values": [{
   "displayName": "love",
   "iconUrl": "http://hogehoge/love.png"
  }]
 }]
}

Share Entities

Share Entities insert
POST /mirror/v1/timeline HTTP1.1
Authorization: Bearer {AUTH TOKEN}
Content-Type: application/json
Content-Length: 137

{
 "id": "post_on_example",
 "displayName": "Example.com",
 "imageUrls": [
  "iconUrl": "http://hogehoge/post.png"
 ]

}

Subscriptions

POST /mirror/v1/timeline HTTP1.1
Authorization: Bearer {AUTH TOKEN}
Content-Type: application/json
Content-Length: {length}

{
 "collection": "timeline",
 "userToken": "example_user",
 "verifyToken": "some_secret",
 "operation": ["UPDATE"],
 "callbackUrl": "http://hogehoge/notify/callback"
}

上記の仕様はすぐに変更されると思いますが、RESTとjsは学んどきましょう。
rails + node + backboneで簡単なサンプルアプリをつくると勉強にいいかもしれませんね。

さあ、開発者のみなさん。用意はいいですか?
今からGoogle Glassアプリのアイディアをためときましょう。
やろうぜ!!

この記事がお役にたちましたらシェアをお願いします

このエントリーをはてなブックマークに追加

0 件のコメント:

コメントを投稿

Related Posts Plugin for WordPress, Blogger...