ソーシャルグラフを操作する API の整理
ユーザ A が B に friend request を送り、B が承認すれば A と B は friend になる
- friend を取得
GET /
http://developers.facebook.com/docs/reference/api/user//friends
- 受け取った friend request を取得 (FQL)
SELECT uid_from FROM friend_request WHERE uid_to=
http://developers.facebook.com/docs/reference/fql/friend_request/
read_requests - Provides read access to the user's friend requests
http://developers.facebook.com/docs/authentication/permissions
- テストユーザの friend request を操作
POST /test_user_id_1/friends/test_user_id_2
POST /test_user_id_2/friends/test_user_id_1http://developers.facebook.com/docs/test_users/
- test_user_id_1 の権限による呼び出しで test_user_id_1 から test_user_id_2 へ friend request が送られる
- test_user_id_2 の権限による呼び出しで request が承認される
ユーザ A が B を follow すると、 A 視点で B は friend、B 視点で A は follower になる
ユーザ B が protected だった場合、A は B に対して follow request を送ることができる
- friend を取得
GET /1/friends/ids.xml?user_id=
http://dev.twitter.com/doc/get/friends/ids
- follower を取得
GET /1/followers/ids.xml?user_id=
http://dev.twitter.com/doc/get/followers/ids
- follow する
POST /1/friendships/create.xml
http://dev.twitter.com/doc/post/friendships/create
- follow をやめる
POST /1/friendships/destroy.xml
http://dev.twitter.com/doc/post/friendships/destroy
- follow しているか否かを取得する
GET /1/friendships/exists.xml?user_a=
http://dev.twitter.com/doc/get/friendships/exists&user_b=
- 受け取った follow request を取得
GET /1/friendships/incoming.xml
http://dev.twitter.com/doc/get/friendships/incoming
- 送った follow request を取得
GET /1/friendships/outgoing.xml
http://dev.twitter.com/doc/get/friendships/outgoing
- 受け取った follow request を承認
POST /1/friendships/accept.xml
http://a2.twimg.com/a/1296525272/javascripts/api.bundle.js から発掘(非公式)
POST /1/friendships/accept_all.xml
- 受け取った follow request を否認
POST /1/friendships/deny.xml
http://a2.twimg.com/a/1296525272/javascripts/api.bundle.js から発掘(非公式)
POST /1/friendships/deny_all.xml
- 送った follow request を削除
POST /1/friendships/cancel.xml
http://a2.twimg.com/a/1296525272/javascripts/api.bundle.js から発掘(非公式)
- おすすめユーザを取得
GET /1/users/recommendations.xml?user_id=
http://a2.twimg.com/a/1296525272/javascripts/api.bundle.js から発掘(非公式)
(おまけ) OpenSocial 1.1
- relationships を作成する
POST /rest/people/@self/@friends
http://opensocial-resources.googlecode.com/svn/spec/1.1/Social-API-Server.xml#People-Service-CreateRelationship
- 指定されたユーザに invitation が送られる