Test
第124行: | 第124行: | ||
===V1接口到V2接口=== | ===V1接口到V2接口=== | ||
− | + | 列出V1接口和V2接口的对应关系20 | |
+ | |||
+ | <div class="wiki_kit"> | ||
+ | |||
+ | {|width="100%" border="0" cellspacing="0" cellpadding="0" class="wiki_table" | ||
+ | <html><colgroup><col class="tbF1"/><col class="tbF2" /><col /></colgroup></html> | ||
+ | !colspan="3" scope="col" style="text-align:center;"|<span id="新旧接口对应表">新旧接口对应表</span> | ||
+ | |- | ||
+ | |style="text-align:center;"|新版V2接口 | ||
+ | |style="text-align:center;"|对应老版V1接口 | ||
+ | |style="text-align:center;"|接口名称 | ||
+ | |- | ||
+ | |[[2/statuses/public_timeline|statuses/public_timeline]] | ||
+ | |[[statuses/public_timeline|statuses/public_timeline]] | ||
+ | |获取最新的公共微博 | ||
+ | |- | ||
+ | |[[2/statuses/friends_timeline|statuses/friends_timeline]] | ||
+ | |[[statuses/friends_timeline|statuses/friends_timeline]] | ||
+ | |获取当前登录用户及其所关注用户的最新微博 | ||
+ | |- | ||
+ | |[[2/statuses/home_timeline|statuses/home_timeline]] | ||
+ | | | ||
+ | |获取当前登录用户及其所关注用户的最新微博 | ||
+ | |- | ||
+ | |[[2/statuses/friends_timeline/ids|statuses/friends_timeline/ids]] | ||
+ | | | ||
+ | |获取当前登录用户及其所关注用户的最新微博的ID | ||
+ | |- | ||
+ | |[[2/statuses/user_timeline|statuses/user_timeline]] | ||
+ | |[[statuses/user_timeline|statuses/user_timeline]] | ||
+ | |获取用户发布的微博 | ||
+ | |- | ||
+ | |[[2/statuses/user_timeline/ids|statuses/user_timeline/ids]] | ||
+ | | | ||
+ | |获取用户发布的微博的ID {{Icon_new2}} | ||
+ | |- | ||
+ | |[[2/statuses/repost_timeline|statuses/repost_timeline]] | ||
+ | |[[statuses/repost_timeline|statuses/repost_timeline]] | ||
+ | |返回一条原创微博的最新转发微博 | ||
+ | |- | ||
+ | |[[2/statuses/repost_timeline/ids|statuses/repost_timeline/ids]] | ||
+ | | | ||
+ | |获取一条原创微博的最新转发微博的ID {{Icon_new2}} | ||
+ | |- | ||
+ | |[[2/statuses/repost_by_me|statuses/repost_by_me]] | ||
+ | |[[statuses/repost_by_me|statuses/repost_by_me]] | ||
+ | |返回用户转发的最新微博 | ||
+ | |- | ||
+ | |[[2/statuses/mentions|statuses/mentions]] | ||
+ | |[[statuses/mentions|statuses/mentions]] | ||
+ | |获取@当前用户的最新微博 | ||
+ | |- | ||
+ | |[[2/statuses/mentions/ids|statuses/mentions/ids]] | ||
+ | | | ||
+ | |获取@当前用户的最新微博的ID {{Icon_new2}} | ||
+ | |- | ||
+ | |[[2/statuses/bilateral_timeline|statuses/bilateral_timeline]] | ||
+ | | | ||
+ | |获取双向关注用户的最新微博 {{Icon_new2}} | ||
+ | |- | ||
+ | |[[2/statuses/show|statuses/show]] | ||
+ | |[[statuses/show|statuses/show]] | ||
+ | |根据ID获取单条微博信息 | ||
+ | |- | ||
+ | |[[2/statuses/querymid|statuses/querymid]] | ||
+ | | | ||
+ | |通过id获取mid | ||
+ | |- | ||
+ | |[[2/statuses/queryid|statuses/queryid]] | ||
+ | | | ||
+ | |通过mid获取id | ||
+ | |- | ||
+ | |[[2/statuses/hot/repost_daily|statuses/hot/repost_daily]] | ||
+ | | | ||
+ | |按天返回热门转发榜 | ||
+ | |- | ||
+ | |[[2/statuses/hot/repost_weekly|statuses/hot/repost_weekly]] | ||
+ | | | ||
+ | |按周返回热门转发榜 | ||
+ | |- | ||
+ | |[[2/statuses/hot/comments_daily|statuses/hot/comments_daily]] | ||
+ | | | ||
+ | |按天返回当前用户关注人的热门微博评论榜 | ||
+ | |- | ||
+ | |[[2/statuses/hot/comments_weekly|statuses/hot/comments_weekly]] | ||
+ | | | ||
+ | |按周返回热门评论榜 | ||
+ | |- | ||
+ | |[[2/statuses/count|statuses/count]] | ||
+ | |[[statuses/counts |statuses/counts ]] | ||
+ | |批量获取指定微博的转发数评论数 | ||
+ | |- | ||
+ | |[[2/statuses/repost|statuses/repost]] | ||
+ | |[[statuses/repost|statuses/repost]] | ||
+ | |转发一条微博信息 | ||
+ | |- | ||
+ | |[[2/statuses/destroy|statuses/destroy]] | ||
+ | |[[statuses/destroy|statuses/destroy]] | ||
+ | |删除微博信息 | ||
+ | |- | ||
+ | |[[2/statuses/update|statuses/update]] | ||
+ | |[[statuses/update|statuses/update]] | ||
+ | |发布一条微博信息 | ||
+ | |- | ||
+ | |[[2/statuses/upload|statuses/upload]] | ||
+ | |[[statuses/upload |statuses/upload ]] | ||
+ | |上传图片并发布一条微博 | ||
+ | |- | ||
+ | |[[2/statuses/upload_url_text|statuses/upload_url_text]] | ||
+ | | | ||
+ | |发布一条微博同时指定上传的图片或图片url {{Icon_adv}} | ||
+ | |- | ||
+ | |[[2/emotions|emotions]] | ||
+ | |[[emotions|emotions]] | ||
+ | |获取官方表情 | ||
+ | |- | ||
+ | |[[2/comments/show|comments/show]] | ||
+ | |[[statuses/comments|statuses/comments]] | ||
+ | |获取某条微博的评论列表 | ||
+ | |- | ||
+ | |[[2/comments/by_me|comments/by_me]] | ||
+ | |[[statuses/comments_by_me|statuses/comments_by_me]] | ||
+ | |我发出的评论列表 | ||
+ | |- | ||
+ | |[[2/comments/to_me|comments/to_me]] | ||
+ | |[[statuses/comments_to_me|statuses/comments_to_me]] | ||
+ | |我收到的评论列表 | ||
+ | |- | ||
+ | |[[2/comments/timeline|comments/timeline]] | ||
+ | |[[statuses/comments_timeline|statuses/comments_timeline]] | ||
+ | |获取用户发送及收到的评论列表 | ||
+ | |- | ||
+ | |[[2/comments/mentions|comments/mentions]] | ||
+ | | | ||
+ | |获取@到我的评论 | ||
+ | |- | ||
+ | |[[2/comments/show_batch|comments/show_batch]] | ||
+ | | | ||
+ | |批量获取评论内容 | ||
+ | |- | ||
+ | |[[2/comments/create|comments/create]] | ||
+ | |[[statuses/comment|statuses/comment]] | ||
+ | |评论一条微博 | ||
+ | |- | ||
+ | |[[2/comments/destroy|comments/destroy]] | ||
+ | |[[statuses/comment_destroy/:id|statuses/comment_destroy/:id]] | ||
+ | |删除一条评论 | ||
+ | |- | ||
+ | |[[2/comments/destroy_batch|comments/destroy_batch]] | ||
+ | |[[statuses/comment/destroy_batch|statuses/comment/destroy_batch]] | ||
+ | |批量删除评论 | ||
+ | |- | ||
+ | |[[2/comments/reply|comments/reply]] | ||
+ | |[[statuses/reply|statuses/reply]] | ||
+ | |回复一条评论 | ||
+ | |- | ||
+ | |[[2/users/show|users/show]] | ||
+ | |[[users/show|users/show]] | ||
+ | |获取用户信息 {{Icon_new2}} | ||
+ | |- | ||
+ | |[[2/users/domain_show|users/domain_show]] | ||
+ | | | ||
+ | |通过个性域名获取用户信息 | ||
+ | |- | ||
+ | |[[2/users/counts|users/counts]] | ||
+ | | | ||
+ | |批量获取用户的粉丝数、关注数、微博数 | ||
+ | |- | ||
+ | |[[2/friendships/friends|friendships/friends]] | ||
+ | | | ||
+ | |获取用户的关注列表 | ||
+ | |- | ||
+ | |[[2/friendships/friends/in_common|friendships/friends/in_common]] | ||
+ | | | ||
+ | |获取共同关注人列表 | ||
+ | |- | ||
+ | |[[2/friendships/friends/bilateral|friendships/friends/bilateral]] | ||
+ | | | ||
+ | |获取双向关注列表 | ||
+ | |- | ||
+ | |[[2/friendships/friends/bilateral/ids|friendships/friends/bilateral/ids]] | ||
+ | | | ||
+ | |获取双向关注UID列表 | ||
+ | |- | ||
+ | |[[2/friendships/friends/ids|friendships/friends/ids]] | ||
+ | |[[friends/ids|friends/ids]] | ||
+ | |获取用户关注对象UID列表 | ||
+ | |- | ||
+ | |[[2/friendships/followers|friendships/followers]] | ||
+ | |[[friendships/show|friendships/show]]、[[friendships/exists|friendships/exists]] | ||
+ | |获取用户粉丝列表 | ||
+ | |- | ||
+ | |[[2/friendships/followers/ids|friendships/followers/ids]] | ||
+ | |[[followers/ids|followers/ids]] | ||
+ | |获取用户粉丝UID列表 | ||
+ | |- | ||
+ | |[[2/friendships/followers/active|friendships/followers/active]] | ||
+ | | | ||
+ | |获取用户优质粉丝列表 | ||
+ | |- | ||
+ | |[[2/friendships/friends_chain/followers|friendships/friends_chain/followers]] | ||
+ | | | ||
+ | |获取我的关注人中关注了指定用户的人 | ||
+ | |- | ||
+ | |[[2/friendships/show|friendships/show]] | ||
+ | |[[friendships/exists|friendships/exists]] | ||
+ | |获取两个用户关系的详细情况 | ||
+ | |- | ||
+ | |[[2/friendships/create|friendships/create]] | ||
+ | |[[friendships/create|friendships/create]] | ||
+ | |关注某用户 | ||
+ | |- | ||
+ | |[[2/friendships/destroy|friendships/destroy]] | ||
+ | |[[friendships/destroy|friendships/destroy]] | ||
+ | |取消关注某用户 | ||
+ | |- | ||
+ | |[[2/friendships/remark/update|friendships/remark/update]] | ||
+ | |[[user/friends/update_remark|user/friends/update_remark]] | ||
+ | |更新关注人备注 {{Icon_adv}} | ||
+ | |- | ||
+ | |[[2/account/get_privacy|account/get_privacy]] | ||
+ | |[[account/get_privacy|account/get_privacy]] | ||
+ | |获取隐私设置信息 | ||
+ | |- | ||
+ | |[[2/account/profile/school_list|account/profile/school_list]] | ||
+ | | | ||
+ | |获取所有学校列表 | ||
+ | |- | ||
+ | |[[2/account/rate_limit_status|account/rate_limit_status]] | ||
+ | |[[account/rate_limit_status|account/rate_limit_status]] | ||
+ | |获取当前用户API访问频率限制 | ||
+ | |- | ||
+ | |[[2/account/get_uid|account/get_uid]] | ||
+ | |[[account/verify_credentials|account/verify_credentials]] | ||
+ | |OAuth授权之后获取用户UID(作用相当于旧版接口的 [[account/verify_credentials]]) | ||
+ | |- | ||
+ | |[[2/account/end_session|account/end_session]] | ||
+ | |[[account/end_session|account/end_session]] | ||
+ | |退出登录 | ||
+ | |- | ||
+ | |[[2/favorites|favorites]] | ||
+ | |[[favorites|favorites]] | ||
+ | |获取当前用户的收藏列表 | ||
+ | |- | ||
+ | |[[2/favorites/ids|favorites/ids]] | ||
+ | | | ||
+ | |获取当前用户的收藏列表的ID {{Icon_new2}} | ||
+ | |- | ||
+ | |[[2/favorites/show|favorites/show]] | ||
+ | | | ||
+ | |获取单条收藏信息 | ||
+ | |- | ||
+ | |[[2/favorites/by_tags|favorites/by_tags]] | ||
+ | | | ||
+ | |获取当前用户某个标签下的收藏列表 | ||
+ | |- | ||
+ | |[[2/favorites/tags|favorites/tags]] | ||
+ | | | ||
+ | |当前登录用户的收藏标签列表 | ||
+ | |- | ||
+ | |[[2/favorites/by_tags/ids|favorites/by_tags/ids]] | ||
+ | | | ||
+ | |获取当前用户某个标签下的收藏列表的ID {{Icon_new2}} | ||
+ | |- | ||
+ | |[[2/favorites/create|favorites/create]] | ||
+ | |[[favorites/create|favorites/create]] | ||
+ | |添加收藏 | ||
+ | |- | ||
+ | |[[2/favorites/destroy|favorites/destroy]] | ||
+ | |[[favorites/destroy|favorites/destroy]] | ||
+ | |删除收藏 | ||
+ | |- | ||
+ | |[[2/favorites/destroy_batch|favorites/destroy_batch]] | ||
+ | |[[favorites/destroy_batch|favorites/destroy_batch]] | ||
+ | |批量删除收藏 | ||
+ | |- | ||
+ | |[[2/favorites/tags/update|favorites/tags/update]] | ||
+ | | | ||
+ | |更新收藏标签 | ||
+ | |- | ||
+ | |[[2/favorites/tags/update_batch|favorites/tags/update_batch]] | ||
+ | | | ||
+ | |更新当前用户所有收藏下的指定标签 | ||
+ | |- | ||
+ | |[[2/favorites/tags/destroy_batch|favorites/tags/destroy_batch]] | ||
+ | | | ||
+ | |删除当前用户所有收藏下的指定标签 | ||
+ | |- | ||
+ | |[[2/trends|trends]] | ||
+ | |[[trends|trends]] | ||
+ | |获取某人话题 | ||
+ | |- | ||
+ | |[[2/trends/is_follow|trends/is_follow]] | ||
+ | | | ||
+ | |是否关注某话题 | ||
+ | |- | ||
+ | |[[2/trends/hourly|trends/hourly]] | ||
+ | |[[trends/hourly|trends/hourly]] | ||
+ | |返回最近一小时内的热门话题 | ||
+ | |- | ||
+ | |[[2/trends/daily|trends/daily]] | ||
+ | |[[trends/daily|trends/daily]] | ||
+ | |返回最近一天内的热门话题 | ||
+ | |- | ||
+ | |[[2/trends/weekly|trends/weekly]] | ||
+ | |[[trends/weekly|trends/weekly]] | ||
+ | |返回最近一周内的热门话题 | ||
+ | |- | ||
+ | |[[2/trends/follow|trends/follow]] | ||
+ | |[[trends/follow|trends/follow]] | ||
+ | |关注某话题 | ||
+ | |- | ||
+ | |[[2/trends/destroy|trends/destroy]] | ||
+ | |[[trends/destroy|trends/destroy]] | ||
+ | |取消关注的某一个话题 | ||
+ | |- | ||
+ | |[[2/tags|tags]] | ||
+ | |[[tags|tags]] | ||
+ | |返回指定用户的标签列表 | ||
+ | |- | ||
+ | |[[2/tags/tags_batch|tags/tags_batch]] | ||
+ | | | ||
+ | |批量获取用户标签 | ||
+ | |- | ||
+ | |[[2/tags/suggestions|tags/suggestions]] | ||
+ | |[[tags/suggestions|tags/suggestions]] | ||
+ | |返回系统推荐的标签列表 | ||
+ | |- | ||
+ | |[[2/tags/create|tags/create]] | ||
+ | |[[tags/create|tags/create]] | ||
+ | |添加用户标签 | ||
+ | |- | ||
+ | |[[2/tags/destroy|tags/destroy]] | ||
+ | |[[tags/destroy|tags/destroy]] | ||
+ | |删除用户标签 | ||
+ | |- | ||
+ | |[[2/tags/destroy_batch|tags/destroy_batch]] | ||
+ | |[[tags/destroy_batch|tags/destroy_batch]] | ||
+ | |批量删除用户标签 | ||
+ | |- | ||
+ | |[[2/register/verify_nickname|register/verify_nickname]] | ||
+ | |[[account/verify_credentials|account/verify_credentials]] | ||
+ | |验证昵称是否可用 | ||
+ | |- | ||
+ | |[[2/search/suggestions/users|search/suggestions/users]] | ||
+ | | | ||
+ | |搜用户搜索建议 | ||
+ | |- | ||
+ | |[[2/search/suggestions/statuses|search/suggestions/statuses]] | ||
+ | | | ||
+ | |搜微博搜索建议 | ||
+ | |- | ||
+ | |[[2/search/suggestions/schools|search/suggestions/schools]] | ||
+ | | | ||
+ | |搜学校搜索建议 | ||
+ | |- | ||
+ | |[[2/search/suggestions/companies|search/suggestions/companies]] | ||
+ | | | ||
+ | |搜公司搜索建议 | ||
+ | |- | ||
+ | |[[2/search/suggestions/apps|search/suggestions/apps]] | ||
+ | | | ||
+ | |搜应用搜索建议 | ||
+ | |- | ||
+ | |[[2/search/suggestions/at_users|search/suggestions/at_users]] | ||
+ | | | ||
+ | |@联想搜索 | ||
+ | |- | ||
+ | |[[2/search/topics|search/topics]] | ||
+ | | | ||
+ | |搜索某一话题下的微博 {{Icon_adv}} | ||
+ | |- | ||
+ | |[[2/suggestions/users/hot|suggestions/users/hot]] | ||
+ | |[[users/hot|users/hot]] | ||
+ | |获取系统推荐用户 | ||
+ | |- | ||
+ | |[[2/suggestions/users/may_interested|suggestions/users/may_interested]] | ||
+ | |[[users/suggestions|users/suggestions]] | ||
+ | |获取用户可能感兴趣的人 | ||
+ | |- | ||
+ | |[[2/suggestions/users/by_status|suggestions/users/by_status]] | ||
+ | | | ||
+ | |根据微博内容推荐用户 | ||
+ | |- | ||
+ | |[[2/suggestions/statuses/hot|suggestions/statuses/hot]] | ||
+ | | | ||
+ | |获取微博精选推荐 {{Icon_new2}} | ||
+ | |- | ||
+ | |[[2/suggestions/statuses/reorder|suggestions/statuses/reorder]] | ||
+ | | | ||
+ | |主Feed微博按兴趣推荐排序 | ||
+ | |- | ||
+ | |[[2/suggestions/statuses/reorder/ids|suggestions/statuses/reorder/ids]] | ||
+ | | | ||
+ | |主Feed微博按兴趣推荐排序的微博ID | ||
+ | |- | ||
+ | |[[2/suggestions/favorites/hot|suggestions/favorites/hot]] | ||
+ | | | ||
+ | |热门收藏 | ||
+ | |- | ||
+ | |[[2/suggestions/users/not_interested|suggestions/users/not_interested]] | ||
+ | | | ||
+ | |不感兴趣的人 | ||
+ | |- | ||
+ | |[[2/remind/unread_count|remind/unread_count]] | ||
+ | |[[statuses/unread|statuses/unread]] | ||
+ | |获取某个用户的各种消息未读数 {{Icon_new2}} | ||
+ | |- | ||
+ | |[[2/remind/set_count|remind/set_count]] | ||
+ | |[[statuses/reset_count|statuses/reset_count]] | ||
+ | |对当前登录用户某一种消息未读数进行清零 {{Icon_adv}} {{Icon_new2}} | ||
+ | |- | ||
+ | |[[2/short_url/shorten|short_url/shorten]] | ||
+ | |[[short_url/shorten|short_url/shorten]] | ||
+ | |长链转短链 {{Icon_new2}} | ||
+ | |- | ||
+ | |[[2/short_url/expand|short_url/expand]] | ||
+ | |[[short_url/expand|short_url/expand]] | ||
+ | |短链转长链 {{Icon_new2}} | ||
+ | |- | ||
+ | |[[2/short_url/clicks|short_url/clicks]] | ||
+ | | | ||
+ | |获取短链接的总点击数 {{Icon_new2}} | ||
+ | |- | ||
+ | |[[2/short_url/referers|short_url/referers]] | ||
+ | | | ||
+ | |获取一个短链接点击的referer来源和数量 {{Icon_new2}} | ||
+ | |- | ||
+ | |[[2/short_url/locations|short_url/locations]] | ||
+ | | | ||
+ | |获取一个短链接点击的地区来源和数量 {{Icon_new2}} | ||
+ | |- | ||
+ | |[[2/short_url/share/counts|short_url/share/counts]] | ||
+ | |[[short_url/share/counts|short_url/share/counts]] | ||
+ | |获取短链接在微博上的微博分享数 {{Icon_new2}} | ||
+ | |- | ||
+ | |[[2/short_url/share/statuses|short_url/share/statuses]] | ||
+ | |[[short_url/share/statuses|short_url/share/statuses]] | ||
+ | |获取包含指定单个短链接的最新微博内容 {{Icon_new2}} | ||
+ | |- | ||
+ | |[[2/short_url/comment/counts|short_url/comment/counts]] | ||
+ | |[[short_url/comment/counts|short_url/comment/counts]] | ||
+ | |获取短链接在微博上的微博评论数 {{Icon_new2}} | ||
+ | |- | ||
+ | |[[2/short_url/comment/comments|short_url/comment/comments]] | ||
+ | |[[short_url/comment/comments|short_url/comment/comments]] | ||
+ | |获取包含指定单个短链接的最新微博评论 {{Icon_new2}} | ||
+ | |- | ||
+ | |[[2/short_url/info|short_url/info]] | ||
+ | | | ||
+ | |批量获取短链接的富内容信息 {{Icon_adv}} {{Icon_new2}} | ||
+ | |- | ||
+ | |[[2/notification/send|notification/send]] | ||
+ | | | ||
+ | |给一个或多个用户发送一条新的状态通知 {{Icon_adv}} {{Icon_new2}} | ||
+ | |- | ||
+ | |[[2/common/code_to_location|common/code_to_location]] | ||
+ | | | ||
+ | |通过地址编码获取地址名称 {{Icon_new2}} | ||
+ | |- | ||
+ | |[[2/common/get_city|common/get_city]] | ||
+ | | | ||
+ | |获取城市列表 {{Icon_new2}} | ||
+ | |- | ||
+ | |[[2/common/get_province|common/get_province]] | ||
+ | | | ||
+ | |获取省份列表 {{Icon_new2}} | ||
+ | |- | ||
+ | |[[2/common/get_country|common/get_country]] | ||
+ | | | ||
+ | |获取国家列表 {{Icon_new2}} | ||
+ | |- | ||
+ | |[[2/common/get_timezone|common/get_timezone]] | ||
+ | | | ||
+ | |获取时区配置表 {{Icon_new2}} | ||
+ | |- | ||
+ | |[[2/place/public_timeline|place/public_timeline]] | ||
+ | | | ||
+ | |获取公共的位置动态 {{Icon_adv}} | ||
+ | |- | ||
+ | |[[2/place/friends_timeline|place/friends_timeline]] | ||
+ | | | ||
+ | |获取用户好友的位置动态 | ||
+ | |- | ||
+ | |[[2/place/user_timeline|place/user_timeline]] | ||
+ | | | ||
+ | |获取某个用户的位置动态 | ||
+ | |- | ||
+ | |[[2/place/poi_timeline|place/poi_timeline]] | ||
+ | | | ||
+ | |获取某个位置地点的动态 | ||
+ | |- | ||
+ | |[[2/place/nearby_timeline|place/nearby_timeline]] | ||
+ | | | ||
+ | |获取某个位置周边的动态 | ||
+ | |- | ||
+ | |[[2/place/statuses/show|place/statuses/show]] | ||
+ | | | ||
+ | |获取动态的详情 | ||
+ | |- | ||
+ | |[[2/place/users/show|place/users/show]] | ||
+ | | | ||
+ | |获取LBS位置服务内的用户信息 | ||
+ | |- | ||
+ | |[[2/place/users/checkins|place/users/checkins]] | ||
+ | | | ||
+ | |获取用户签到过的地点列表 | ||
+ | |- | ||
+ | |[[2/place/users/photos|place/users/photos]] | ||
+ | | | ||
+ | |获取用户的照片列表 | ||
+ | |- | ||
+ | |[[2/place/users/tips|place/users/tips]] | ||
+ | | | ||
+ | |获取用户的点评列表 | ||
+ | |- | ||
+ | |[[2/place/users/todos|place/users/todos]] | ||
+ | | | ||
+ | |获取用户的todo列表 {{Icon_adv}} | ||
+ | |- | ||
+ | |[[2/place/pois/show|place/pois/show]] | ||
+ | | | ||
+ | |获取地点详情 | ||
+ | |- | ||
+ | |[[2/place/pois/users|place/pois/users]] | ||
+ | | | ||
+ | |获取在某个地点签到的人的列表 | ||
+ | |- | ||
+ | |[[2/place/pois/tips|place/pois/tips]] | ||
+ | | | ||
+ | |获取地点点评列表 | ||
+ | |- | ||
+ | |[[2/place/pois/photos|place/pois/photos]] | ||
+ | | | ||
+ | |获取地点照片列表 | ||
+ | |- | ||
+ | |[[2/place/pois/search|place/pois/search]] | ||
+ | | | ||
+ | |按省市查询地点 | ||
+ | |- | ||
+ | |[[2/place/pois/category|place/pois/category]] | ||
+ | | | ||
+ | |获取地点分类 | ||
+ | |- | ||
+ | |[[2/place/nearby/pois|place/nearby/pois]] | ||
+ | | | ||
+ | |获取附近地点 | ||
+ | |- | ||
+ | |[[2/place/nearby/users|place/nearby/users]] | ||
+ | | | ||
+ | |获取附近发位置微博的人 | ||
+ | |- | ||
+ | |[[2/place/nearby/photos|place/nearby/photos]] | ||
+ | | | ||
+ | |获取附近照片 | ||
+ | |- | ||
+ | |[[2/place/nearby_users/list|place/nearby_users/list]] | ||
+ | | | ||
+ | |获取附近的人 {{Icon_adv}} | ||
+ | |- | ||
+ | |[[2/place/pois/create|place/pois/create]] | ||
+ | | | ||
+ | |添加地点 {{Icon_adv}} | ||
+ | |- | ||
+ | |[[2/place/pois/add_checkin|place/pois/add_checkin]] | ||
+ | | | ||
+ | |签到 | ||
+ | |- | ||
+ | |[[2/place/pois/add_photo|place/pois/add_photo]] | ||
+ | | | ||
+ | |添加照片 | ||
+ | |- | ||
+ | |[[2/place/pois/add_tip|place/pois/add_tip]] | ||
+ | | | ||
+ | |添加点评 | ||
+ | |- | ||
+ | |[[2/place/pois/add_todo|place/pois/add_todo]] | ||
+ | | | ||
+ | |添加todo {{Icon_adv}} | ||
+ | |- | ||
+ | |[[2/place/nearby_users/create|place/nearby_users/create]] | ||
+ | | | ||
+ | |用户添加自己的位置 {{Icon_adv}} | ||
+ | |- | ||
+ | |[[2/place/nearby_users/destroy|place/nearby_users/destroy]] | ||
+ | | | ||
+ | |用户删除自己的位置 {{Icon_adv}} | ||
+ | |- | ||
+ | |[[2/location/base/get_map_image|location/base/get_map_image]] | ||
+ | |[[base/get_map_image|base/get_map_image]] | ||
+ | |生成一张静态的地图图片 | ||
+ | |- | ||
+ | |[[2/location/geo/ip_to_geo|location/geo/ip_to_geo]] | ||
+ | |[[geocode/ip_to_geo|geocode/ip_to_geo]] | ||
+ | |根据IP地址返回地理信息坐标 | ||
+ | |- | ||
+ | |[[2/location/geo/address_to_geo|location/geo/address_to_geo]] | ||
+ | |[[geocode/address_to_geo|geocode/address_to_geo]] | ||
+ | |根据实际地址返回地理信息坐标 | ||
+ | |- | ||
+ | |[[2/location/geo/geo_to_address|location/geo/geo_to_address]] | ||
+ | |[[geocode/geo_to_address|geocode/geo_to_address]] | ||
+ | |根据地理信息坐标返回实际地址 | ||
+ | |- | ||
+ | |[[2/location/geo/gps_to_offset|location/geo/gps_to_offset]] | ||
+ | | | ||
+ | |根据GPS坐标获取偏移后的坐标 | ||
+ | |- | ||
+ | |[[2/location/geo/is_domestic|location/geo/is_domestic]] | ||
+ | | | ||
+ | |判断地理信息坐标是否是国内坐标 | ||
+ | |- | ||
+ | |[[2/location/pois/show_batch|location/pois/show_batch]] | ||
+ | | | ||
+ | |批量获取POI点的信息 | ||
+ | |- | ||
+ | |[[2/location/pois/search/by_location|location/pois/search/by_location]] | ||
+ | |[[pois/round |pois/round ]] | ||
+ | |根据关键词按地址位置获取POI点的信息 | ||
+ | |- | ||
+ | |[[2/location/pois/search/by_geo|location/pois/search/by_geo]] | ||
+ | |[[pois/keyword|pois/keyword]] | ||
+ | |根据关键词按坐标点范围获取POI点的信息 | ||
+ | |- | ||
+ | |[[2/location/pois/search/by_area|location/pois/search/by_area]] | ||
+ | |[[pois/view|pois/view]] | ||
+ | |根据关键词按矩形区域获取POI点的信息 | ||
+ | |- | ||
+ | |[[2/location/pois/add|location/pois/add]] | ||
+ | |[[pois/add_poi|pois/add_poi]]、[[pois/get_poi|pois/get_poi]] | ||
+ | |提交一个新增的POI点信息 | ||
+ | |- | ||
+ | |[[2/location/mobile/get_location|location/mobile/get_location]] | ||
+ | |[[loc/get_location|loc/get_location]] | ||
+ | |根据移动基站WIFI等数据获取当前位置信息 | ||
+ | |- | ||
+ | |[[2/location/line/drive_route|location/line/drive_route]] | ||
+ | |[[navigation/route|navigation/route]] | ||
+ | |根据起点与终点数据查询自驾车路线信息 | ||
+ | |- | ||
+ | |[[2/location/line/bus_route|location/line/bus_route]] | ||
+ | |[[bus/transfer|bus/transfer]] | ||
+ | |根据起点与终点数据查询公交乘坐路线信息 | ||
+ | |- | ||
+ | |[[2/location/line/bus_line|location/line/bus_line]] | ||
+ | |[[bus/line|bus/line]] | ||
+ | |根据关键词查询公交线路信息 | ||
+ | |- | ||
+ | |[[2/location/line/bus_station|location/line/bus_station]] | ||
+ | |[[bus/station|bus/station]] | ||
+ | |根据关键词查询公交站点信息 | ||
+ | |- | ||
+ | |[[location/citycode|location/citycode]] | ||
+ | | | ||
+ | |城市代码对应表 | ||
+ | |- | ||
+ | |[[location/citycode_bus|location/citycode_bus]] | ||
+ | | | ||
+ | |公交城市代码表 | ||
+ | |- | ||
+ | |[[location/category|location/category]] | ||
+ | | | ||
+ | |分类代码对应表 | ||
+ | |- | ||
+ | |[[location/error2|location/error2]] | ||
+ | | | ||
+ | |地理位置信息接口错误代码及解释 | ||
+ | |} | ||
+ | |||
+ | |||
+ | {|width="100%" border="0" cellspacing="0" cellpadding="0" class="wiki_table" | ||
+ | <html><colgroup><col class="tbF1"/><col class="tbF2" /><col /></colgroup></html> | ||
+ | !colspan="3" scope="col"|<span id="OAuth2">OAuth2([[OAuth2|开发指南]])</span> | ||
+ | |- | ||
+ | |[[oauth2/authorize]] | ||
+ | |请求用户授权Token | ||
+ | |- | ||
+ | |[[OAuth2/access_token|oauth2/access_token]] | ||
+ | |获取授权过的Access Token | ||
+ | |- | ||
+ | |[[oauth2/get_oauth2_token]] | ||
+ | |OAuth1.0的Access Token更换至OAuth2.0的Access Token | ||
+ | |} | ||
+ | |||
+ | __NOTOC__ |
2012年8月13日 (一) 14:42的版本
新接口切换概述
随着开放平台地进一步开放,V1版接口(旧版接口)无论性能、功能都已经无法满足广大开发者的需求,因此微博开放平台对V1版接口进行了全面地升级得到全新的V2版接口(新版接口)。
而原有的V1版接口将在近期全面下线,本文将为所有仍使用V1版接口的已审核上线应用提供切换引导,帮助您更快地完成切换。
为什么要升级到V2版接口
V2版较V1版接口的优势
- 1、更多功能
- a)V2较V1新增约200个接口,增强的关系接口、推荐接口、搜索话题接口、短链接口、热门微博接口、位置服务接口、通知接口、通用服务接口、社交电视接口;
- b)另外,SCOPE授权功能、好友分组接口、邀请接口、社交化接口也即将开放。
- 2、更高效
- a)微博、评论、用户等返回值增加trim开关;
- b)微博评论、转发数可以随微博返回值直接返回;
- c)用户返回值增加互粉好友数、是否关注我、是否被我关注等信息;
- d)timeline类接口未来将全部增加筛选过滤功能(feature)和应用隔离功能(base_app)。
- 3、更规范
- a)统一参数、返回值字段,全部小写字母,单词和单词之间用“_”链接;
- b)核心字段:微博、评论、用户、关系全部标准化;
- c)统一的新错误返回值格式及错误码,V2错误码地址:http://open.weibo.com/wiki/Error_code。
- 4、更可控
- a)放弃rest风格的接口URI,全部采用:域+版本号+资源类+接口名+返回值格式+参数,如图:
- b)将接口分为两级权限:普通、高级,使得优质应用得以使用更高级接口;
- c)添加了接口授权管理系统:接口可以分组打包,并对应用开放权限申请及授权管理;
V1禁止调用时间
- 1、2012年7月24日,禁止所有“未审核应用”调用V1接口;
- 2、2012年8月25日,禁止所有用户量在1000以下的“已审核应用”调用V1接口;
- 3、2012年9月前后,禁止所有应用调用V1接口;
V1到V2怎么切换
简述
V1切换到V2主要需要完成OAuth1.0到OAuth2.0的过度及完成V1原有接口与V2中新接口的对应替换。
OAuth1.0到OAuth2.0
- 1、OAuth2.0简述
- OAuth2.0是较OAuth1.0更简单更安全的授权方式,同时支持Web,桌面和移动应用。是未来新浪微博开放平台最主要的用户身份验证和授权方式。
- 2、切换前准备
- 请先阅读OAuth2.0开发指南。
- OAuth2.0授权方式与OAuth1.0相比,引入授权回调页与绑定域名,简化了授权流程,同时也提升了授权的安全性。
- 在实现OAuth2.0授权方式前,针对不同的应用我们需要设置应用的授权回调页或进行域名的绑定,用于获得授权成功后返回的code,再通过code获取access_token。
- 使用开发者帐号登录http://open.weibo.com,进入“我的应用”控制台需要切换的应用进行设置:
- 1)网站接入类
- 点击控制台导航“网站信息”,在网站基本信息中查看网站域名。如果您的网站应用还未验证所有权,会提示您进行所有权验证,点击进入验证页面完成所有权验证。
- 注意:验证时填写的网站域名即为您的应用的绑定域名
- 2)站内应用
- 站内应用已经是OAuth2.0授权方式,无需做改动。
- 2)站内应用
- 3)客户端应用 & 其他应用
- 点击控制台导航“应用信息”—> “高级信息”,进行授权回调页或域名的绑定。设置回调页不需要二审,方便您进行测试开发。绑定域名需要进行二审,二审时线上应用不受影响,绑定域名增加应用的安全性,同时该域名下的所有页面都可作为授权回调页。
- 注意:客户端也需要设置授权回调页或绑定域名,在程序中以webview的方式进行调用授权页面返回code,具体实现参考相应的客户端SDK:http://open.weibo.com/wiki/SDK 。
- 3)客户端应用 & 其他应用
- 3、OAuth2.0授权实现
- 主要流程(请先阅读OAuth2.0开发指南):
- 1)引导需要授权的用户访问如下地址:
https://api.weibo.com/oauth2/authorize?client_id=YOUR_APP_KEY&response_type=code&redirect_uri=YOUR_REGISTERED_REDIRECT_URI
- 注意:redirect_uri必须为绑定域名下网页或设置的回调地址。
- 本地测试技巧:可以通过绑定hosts指向本地测试代码。例如,您应用的redirect_uri为:http://aa.abc.com/index.php ,而您对应的本地地址为http://127.0.0.1/index.php,则您可以将hosts绑定成:127.0.0.1 aa.abc.com 。
- 2)如果用户同意授权,页面跳转至 YOUR_REGISTERED_REDIRECT_URI/?code=CODE
- 注意:每次返回的code值都是不一样的且在换取access_token后失效。
- 3)使用code换取access_token
https://api.weibo.com/oauth2/access_token?client_id=YOUR_ APP_KEY &client_secret=YOUR_APP_SECRET&grant_type=authorization_code&redirect_uri=YOUR_REGISTERED_REDIRECT_URI&code=CODE
- 注意:必须使用POST方式提交,其中client_id=YOUR_APP_KEY&client_secret=YOUR_APP_SECRET可以使用basic方式加入header中。
- 返回值
- {"access_token":"SlAV32hkKG","remind_in":"3600","expires_in":3600,"uid":"1902538057"}
- 注意:OAuth2.0的access_token较OAuth1.0具有一定的有效期,当access_token过期时需要引导用户重新授权。应用的授权有效期可以访问接口访问权限说明或在应用控制台查看。
- 可能遇到的问题:
- 1)如何判断access_token是否过期?
- 首先,在每次用户授权时,将expires_in(单位:秒)加上当时系统时间存入数据库,在每次调用接口前将数据库中存的时间与当前时间比较,小于当前则引导用户重新授权,大于则正常调用接口;
- 其次,每次调用接口时,如果使用的access_token已过期,平台会返回错误码为21332的错误,此时需引导用户重新授权。
- 可能遇到的问题:
- 2)如何将OAuth1.0授权用户过度到OAuth2.0?
- 4)使用获得的OAuth2.0 Access Token调用API
- 读取接口一般使用GET方式提交,如:
https://api.weibo.com/2/statuses/home_timeline.json?access_token=SlAV32hkKG&count=20
- 写入接口必须使用POST方式提交,如:
V1接口到V2接口
列出V1接口和V2接口的对应关系20
OAuth2(开发指南) | ||
---|---|---|
oauth2/authorize | 请求用户授权Token | |
oauth2/access_token | 获取授权过的Access Token | |
oauth2/get_oauth2_token | OAuth1.0的Access Token更换至OAuth2.0的Access Token |