|
ApiDocumentation
同学网 API 文档 15210246172
Featured API更新记录2009-12-31
2009-08-06
关键词说明
基本概念用户验证如需要验证用户,验证方式为 HTTP Basic 验证。 用户 id用户 id 在个人网址中,例如:http://tongxue.com/tongxue 蓝色的部分即为用户 id。 使用 API 的简单途径如果你的系统中有 cURL,就可以通过非常简单的方式使用这些API了。 示例:
curl http://api.tongxue.com/statuses/public_timeline.php
curl -u loginname:password http://api.tongxue.com/statuses/user_timeline.php
curl -u loginname:password http://api.tongxue.com/statuses/friends_timeline.php
curl -u loginname:password -d status="消息内容" http://api.tongxue.com/statuses/update.xml API应用认证通过认证的应用,在每条消息后会有 '通过 YOUR_APP_NAME' 的信息,YOUR_APP_NAME是你的应用名,并链接到应用的发布网址。 你的应用希望通过认证?请:
说明:
API 方法说明消息相关的方法显示随便看看的消息路径: http://api.tongxue.com/statuses/public_timeline.php 参数:
示例: http://api.tongxue.com/statuses/public_timeline.php?count=10
示例: http://api.tongxue.com/statuses/public_timeline.json?callback=getStatuses 显示用户和好友的消息路径: http://api.tongxue.com/statuses/friends_timeline.php 参数:
示例: http://api.tongxue.com/statuses/friends_timeline.php?id=tongxue
示例: http://api.tongxue.com/statuses/friends_timeline.php?count=10
示例: http://api.tongxue.com/statuses/friends_timeline.xml?since_id=6IAZmgy1TzA
示例: http://api.tongxue.com/statuses/friends_timeline.xml?max_id=6IAZmgy1TzA
示例: http://api.tongxue.com/statuses/friends_timeline.json?page=3
示例: http://api.tongxue.com/statuses/friends_timeline.json?callback=getStatuses
显示用户的消息路径: http://api.tongxue.com/statuses/user_timeline.php 参数:
示例: http://api.tongxue.com/statuses/user_timeline.php?id=tongxue 或 http://api.tongxue.com/statuses/user_timeline/tongxue.php
示例: http://api.tongxue.com/statuses/user_timeline.php?count=10
示例: http://api.tongxue.com/statuses/user_timeline.xml?since_id=6IAZmgy1TzA1
示例: http://api.tongxue.com/statuses/user_timeline.xml?max_id=6IAZmgy1TzA
示例: http://api.tongxue.com/statuses/user_timeline.json?page=3
示例: http://api.tongxue.com/statuses/user_timeline.json?callback=getStatuses
显示指定消息路径: http://api.tongxue.com/statuses/show.php 参数:
示例: curl -u loginname:password http://api.tongxue.com/statuses/show.php?id = 17db80f740171d1c57ce588073fbccfc 显示发给当前用户的消息路径: http://api.tongxue.com/statuses/replies.php 参数:
示例: http://api.tongxue.com/statuses/replies.php?count=10
示例: http://api.tongxue.com/statuses/replies.xml?since_id=6IAZmgy1TzA
示例: http://api.tongxue.com/statuses/replies.xml?max_id=6IAZmgy1TzA
示例: http://api.tongxue.com/statuses/replies.json?page=3
发布消息路径: http://api.tongxue.com/statuses/update.php 方法:POST 参数:
转发消息转发 实际上是发布一条新消息,使用的是发布消息接口,我们推荐的实现是:
删除消息路径: http://api.tongxue.com/statuses/destroy.php 方法:POST 参数:
示例: http://api.tongxue.com/statuses/destroy/6IAZmgy1TzA.xml 照片相关的方法New!同学网上传API模拟HTML的file input上传照片,也就是 HTTP POST 时 Content-Type 设置为 multipart/form-data。参考RFC1867 http://www.ietf.org/rfc/rfc1867.txt 照片上传路径:http://api.tongxue.com/statuses/photos/upload.php 方法:POST 参数:
搜索相关的方法公开搜索路径:http://api.tongxue.com/search/public_timeline.php 参数:
示例:http://api.tongxue.com/search/public_timeline.xml?q=tongxue 或 http://api.tongxue.com/search/public_timeline/%E9%A5%AD%E5%90%A6.xml,这里 %E9%A5%AD%E5%90%A6 是同学网的UTF8编码。
示例: http://api.tongxue.com/search/public_timeline.xml?max_id=6IAZmgy1TzA 热词New!返回当前的同学网热词。 路径:http://api.tongxue.com/trends.php 用户相关的方法显示好友列表路径: http://api.tongxue.com/statuses/users/followings.php 参数:
示例: http://api.tongxue.com/statuses/users/followings.xml?id=tongxue
示例: http://api.tongxue.com/statuses/users/followings.xml?page=3 显示关注者列表路径: http://api.tongxue.com/statuses/users/followers.php 参数:
示例: http://api.tongxue.com/statuses/users/followers.xml?id=tongxue
示例: http://api.tongxue.com/statuses/users/followers.json?page=3 显示用户详细信息路径: http://api.tongxue.com/statuses/users/show.php 参数:
示例: http://api.tongxue.com/statuses/users/show.xml?id=tongxue 站内信相关的方法显示用户收到的站内信路径: http://api.tongxue.com/direct_messages.php 参数:
示例: http://api.tongxue.com/direct_messages.xml?count=10
示例: http://api.tongxue.com/direct_messages.xml?since_id=12345
示例: http://api.tongxue.com/direct_messages.xml?max_id=6IAZmgy1TzA
示例: http://api.tongxue.com/direct_messages.json?page=3 显示用户发的站内信路径: http://api.tongxue.com/direct_messages/sent.php 参数:
示例: http://api.tongxue.com/direct_messages/sent.xml?count=10
示例: http://api.tongxue.com/direct_messages/sent.xml?since_id=12345
示例: http://api.tongxue.com/direct_messages/sent.xml?max_id=6IAZmgy1TzA
示例: http://api.tongxue.com/direct_messages/sent.json?page=3 发送站内信路径: http://api.tongxue.com/direct_messages/new.php 方法:POST 参数:
删除站内信路径: http://api.tongxue.com/direct_messages/destroy.php 方法:POST 参数:
示例: http://api.tongxue.com/direct_messages/destroy.xml?id=102 收藏相关的方法显示用户的收藏列表路径: http://api.tongxue.com/statuses/favorites.php 参数:
示例: http://api.tongxue.com/statuses/favorites.xml
示例: http://api.tongxue.com/statuses/favorites.xml?count=10
示例: http://api.tongxue.com/statuses/favorites.xml?page=3
收藏某条消息路径: http://api.tongxue.com/statuses/favorites/create.php 方法:POST 参数:
删除收藏路径: http://api.tongxue.com/statuses/favorites/destroy.php 方法:POST 参数:
示例: http://api.tongxue.com/statuses/favorites/destroy.php?id=kdjfe866djf 朋友关系方法添加朋友路径: http://api.tongxue.com/statuses/followings/create.php 方法:POST 参数:
示例: http://api.tongxue.com/statuses/followings/create.php?id=tongxue 删除朋友路径: http://api.tongxue.com/statuses/followings/destroy.php 方法:POST 参数:
示例: http://api.tongxue.com/statuses/followings/destroy.php?id=tongxue 判断朋友关系是否存在路径: http://api.tongxue.com/statuses/followings/exists.php 参数:
示例: http://api.tongxue.com/statuses/followings/exists.php?user_a=tongxue&user_b=liangyue 朋友和关注者方法New!显示朋友id列表路径: http://api.tongxue.com/statuses/followings/ids.php 参数:
示例: http://api.tongxue.com/statuses/followings/ids.php?id=tongxue 显示关注者id列表路径: http://api.tongxue.com/statuses/followers/ids.php 参数:
示例: http://api.tongxue.com/statuses/followers/ids.php?id=tongxue 提醒相关方法获得提醒数目路径: http://api.tongxue.com/notifications/index.php 参数:
示例: http://api.tongxue.com/notifications/index.xml?id=tongxue
示例: http://api.tongxue.com/notifications/index.json?callback=getStatuses 返回值:
对某个类型的提醒清零路径: http://api.tongxue.com/notifications/clear.php 参数:
示例: http://api.tongxue.com/notifications/clear.xml?id=tongxue 或 http://api.tongxue.com/notifications/clear.php?id=tongxue
示例: http://api.tongxue.com/notifications/clear.json?callback=getStatuses
返回值:
黑名单方法加入黑名单路径: http://api.tongxue.com/blocks/create.php 参数:
示例: http://api.tongxue.com/blocks/create.xml?id=tongxue 解除黑名单路径: http://api.tongxue.com/blocks/destroy.php 参数:
示例: http://api.tongxue.com/blocks/destroy.xml?id=tongxue 账号方法验证用户检验用户名密码是否正确 路径: http://api.tongxue.com/account/verify_credentials.php 参数:无 保存搜索相关的方法New!显示登录用户的搜索保存列表路径: http://api.tongxue.com/saved_searches.php 显示指定的搜索词路径: http://api.tongxue.com/saved_searches/show/id.php 参数:
示例: http://api.tongxue.com/saved_searches/show/12345.xml 保存搜索词路径: http://api.tongxue.com/saved_searches/create.php 方法:POST 参数:
删除搜索词路径: http://api.tongxue.com/saved_searches/destroy/id.php 方法:POST 参数:
示例: http://api.tongxue.com/saved_searches/destroy/12345.json 或 http://api.tongxue.com/saved_searches/destroy/12345.xml 地图功能获得用户最近check in的地点列表路径: http://api.tongxue.com/place/user_checkin_list.php 注意 :此方法需要验证用户 参数:
用户check in到某一个地点路径: http://api.tongxue.com/place/user_checkin.php 注意 :此方法需要验证用户 参数:
辅助方法测试API用指定格式返回一个 ok 值,返回的 HTTP code 为 200 路径: http://api.tongxue.com/help/test.php 参数:无 返回的参数模块消息模块消息模块由消息的信息组成,其中用一个用户模块来描述消息的发起人 <status>
用户基本信息模块用户基本信息模块由用户的基本信息组成,其中用一个消息模块来描述此用户最新的一条消息 <user>
用户扩展信息模块用户扩展信息模块,较详细的表示了用户的各项信息。(以后还会继续补充) <user>
站内信模块站内信模块由站内信的各项属性组成,其中由sender模块表示发信人信息,recipient模块表示收信人信息 <direct_message>
返回的参数属性值created_source描述:1: 原始发,2: 转载,3: 留言, 4: 回复消息, 5: 关注, 6: 上传照片到相册, 7: 头像, 8: 同时 in_reply_to_profile_link描述: 回复用户的个性域名 personal_link描述: 用户的个性域名,如果为空的话,则为用户ID gender描述: 1 是男,2 是女 create_at描述: 元素的创建时间 示例: Fri Apr 10 12:59:35 +0000 2009 description描述: 用户的自述 示例: 默认值为空 favorited描述: 表示当前消息是否已被收藏 示例: true, false favorites_count描述: 当前用户的收藏数 示例: 0, 268 following描述: 表示被验证用户是否已经把当前用户加为好友了 示例: true, false followers_count描述: 当前用户的被关注数 示例: 0, 2013 followings_count描述: 当前用户的好友数 示例: 0, 801 name描述: 当前用户的昵称 示例: 同学网, 阿正 id描述: 元素的独立id 示例: 4L0aUggHfq8 (消息id), tongxue (用户id) in_reply_to_screen_name描述: 消息所回复的用户昵称 示例: (空值), 同学网 in_reply_to_status_id描述: 被回复的消息id 示例: (空值), 4L0aUggHfq8 in_reply_to_user_id描述: 消息所回复的用户id 示例: (空值), tongxue location描述: 用户的所在地 示例: 北京, 上海 notifications描述: 表示被验证的用户是否接收当前用户的消息通知 示例: true, false profile_image_url描述: 当前用户的头像地址 示例: protected描述: 表示当前用户是否设置了“需要我批准才能查看我的消息” 示例: true, false screen_name描述: 当前用户的昵称 示例: 同学网, 阿正 source描述: 消息的发布途径,假如没有事先定好的source参数,使用:10000,来自于API 示例: 网页, 手机上网 statuses_count描述: 当前用户的消息数 示例: 0, 2068 text描述: 消息的内容 示例: 同学网排行榜新增最新动态,可以看到刚刚给自己打过标签的人。 truncated描述: 表示当前消息是否需要截断 示例: true, false url描述: 用户个人信息中的网站地址 意见反馈请访问同学网开发者论坛 |
收藏返回为空??
place_id(必须) , 要check in的地点id。 如何获得此id?