微博开放平台
微连接
移动应用
网站接入
电商服务商
电商商家
数据服务
数据服务
合作伙伴
微博支付
轻应用
粉丝服务
文档
推广
我的应用
登录
weibo
开发文档
首页
平台政策与指引
概述
平台公约
新手指南
开发者协议
应用运营管理规范
微连接分级管理办法
应用审核产品指南
应用安全开发注意事项
平台应用设计规范
微服务接入指南
微博登录接入
用微博帐号登录
授权机制
移动应用接入
移动应用介绍
移动应用SSO授权
微博Deep Link
媒体接入平台
头条文章开放接口
视频上传开放接口
电商接入平台
电商服务商接入
电商商家端接入
电商平台能力接口
粉丝服务平台
粉丝服务平台
新手接入指南
微信开发者迁移指南
接收消息
发送消息
自定义菜单
用户管理
生成带参数的二维码
Fans Service Platform
商业接口
商业数据接入指南
订阅服务手册(中文版)
订阅服务手册(英文版)
商业接口-REST API
商业数据常见问题
网站接入
网站接入介绍
微博API
微博API
接口访问频次权限
资源下载
SDK
微博标识下载
常见问题
联系我们
工具箱
链入页面
链出更改
特殊页面
查看源代码
跳转到:
导航
,
搜索
根据下列原因,你没有权限编辑本页:
您刚才请求的操作只有这个用户组中的用户才能使用:
用户
您可以查看并复制此页面的源代码:
=Subscription Service User's Guide= ==Overview== The subscription service of Weibo Platform makes the applications get the datas more efficiently. According to the subscription filters like keywords, users, and domains applications specified, the applications will be delivered the new datas that match the filters in real-time by the Weibo Platform, without needing to poll the APIs as before. <font size="2" style="font-weight:bold">Advantages:</font> ● The data is for the real-time. ● Save the network resources. ● Provide the more full data. ● Get the data more efficiently. ==Filters== <font size="2" style="font-weight:bold">● Push according to data types:</font> Either statuses or comments can be subscribed. A subscription can’t subscribe both of them. Default are statuses. <font size="2" style="font-weight:bold">● Push according to users:</font> The max number is up to 10000 userids for each subscription. When subscribe for statuses, statuses created by the users specified will be delivered. When subscribe for comments, the statuses which are created by the users specified, the comments to the statuses will be delivered. <font size="2" style="font-weight:bold">● Push according to keywords:</font> The max number is up to 20000 keywords for each subscription. When subscribe for statuses, statuses which contain one of the keywords specified will be delivered. When subscribe for comments, comments which contain one of the keywords specified will be delivered or the statuses which are commented contain one of the keywords specified, the comments will be delivered. <font size="2" style="font-weight:bold">● Push according to domains:</font> The max number is up to 20 domains for each subscription. When subscribe for statuses, statuses which contain the short links that one of the short links which original link contains one of the domains specified will be delivered. When subscribe for comments, the statuses which are commented contain the short links that one of the short links which original link contains one of the domains specified, the comments will be delivered. <font size="2" style="font-weight:bold">● Push according to applications:</font> The application can only be delivered the statuses or comments which were created by the application itself. Or be delivered the datas created by all the applications on Weibo Platform. <font size="2" style="font-weight:bold">● Push according to media types:</font> Only when the statuses are subscribed is the filter valid. There are five media types: ‘original’, ‘repost’, ‘video, ‘music’, ‘picture’. The statuses which fit the media types specified will be delivered. <font size="2" style="font-weight:bold">● Push according to a percentage specified:</font> The datas of a percentage of the full datas that fit all the filters above will be delivered. Default is 1 percent. <font size="2" style="font-weight:bold">● Push according to a time range specified:</font> Applications can specify the start time and the end time of the pushing. Pushing server will be ready when arrives at the start time. And the pushing will be terminated when arrives at the end time. If not specified, the start time is equal the time the subscription was created. And the pushing has no end. When the pushing server is ready, applications can connect the pushing APIs to get the datas. ==Steps== Using the subscription service, there are several steps as follows: {{center|http://www.sinaimg.cn/blog/developer/wiki/pics/subscription_en.png}} <font size="2" style="font-weight:bold">① Creates a subscription:</font> Developers fill out the [http://www.sinaimg.cn/blog/developer/wiki/picchart/subscriptionform_en.doc subscription service application form], providing filters and other information. Weibo Platform will create the subscription according to the information provided in the form. Multiple subscriptions can be created for each application. <font size="2" style="font-weight:bold">② Set subscribed keywords and users:</font> If ‘no’ is selected in the fields of ‘Users’ and ‘Keywords’ in the [http://www.sinaimg.cn/blog/developer/wiki/picchart/subscriptionform_en.doc subscription service application form],applications need ignore this step. If ‘yes’ is selected, the keyword and user subscription list must not be empty. Call the API to subscribe keywords and users: [[C/2/subscribe/update_subscribe/en|subscribe/update_subscribe]] The IP address to call the API must be one of the IP list provided when created the subscription. Otherwise, the error response ‘Ip is limited’ will be returned. If just parameter ‘subid’ is passed, the subscription information included the keywords and users list will be returned. The length of each keyword can’t exceed 34 Chinese characters. The number of keywords parameter ‘add_keywords’ specified can’t exceed 20 per request. And the number of users parameter ‘add_uids’ specified can’t exceed 50 per request. The total number of keywords or users subscribed can’t exceed 20000 for each subscription.The keywords and users can’t be subscribed repeatedly. Weibo Platform may protect some keywords and users when needed. Protected keywords and users can’t be subscribed. If a keyword is protected, the keywords that contain the protected keyword can’t be subscribed. The keywords and the datas filtered are not case-sensitive and don’t distinguish between Simplified and Traditional Chinese. <font size="2" style="font-weight:bold">③ Pushing server is ready:</font> If developers did not provide the start time of the pushing, the start time is equal the time the subscription was created. Pushing server will be ready when arrives at the start time. <font size="2" style="font-weight:bold">④ Application connects and pushing starts:</font> Only when the pushing server is ready can applications connect the pushing APIs, then pushing starts. Applications will receive the error information if the pushing server is not ready. The pushing APIs are as follows: ● Subscribing statuses, connect the API:[[C/2/datapush/status/en|datapush/status]] ● Subscribing comments, connect the API:[[C/2/datapush/comment/en|datapush/comment]] See [[示例代码|java example]] for connecting the APIs. The new subscription service has been released and it provides more stability. We strongly suggest developers use the new subscription service (the old subscription service can still be used now). To subscribe statuses or comments, connect to the pushing API :[[C/2/commercial/push/en|commercial/push]] See [[新版示例代码|java example]] for connecting the new APIs. <font size="2" style="font-weight:bold">⑤ Application receives data:</font> Statuses or comments will be delivered to the application after connecting the pushing APIs successfully. The statuses or comments are JSON UTF-8 encoded datas. Every whole message is separated by \r\n and is less than 4096 bytes. Therefore, to make sure you get the whole message, break out each message on \r\n boundaries. See the [[responses]] for details. <font size="2" style="font-weight:bold">⑥ Pushing ends:</font> If the end time is not specified, the pushing has no end. The pushing will be terminated when arrives at the end time. The subscription can’t be restarted. ==Specifications for old subscription service== Applications keep a persistent HTTP request to pushing APIs:‘/datapush/status’ and ‘/datapush/comment’ to get datas. Parameter subid must be passed to indicate which subscription datas should be delivered. [[Error_code_definitions|Error codes]] will be returned when request in a wrong way. In order to reduce the server pressure, pushing server will disconnect every ten minutes, so that the pushing APIs have to be re-requested with the data ID application hold when disconnected as the value of since_id parameter to be passed like ‘/datapush/status?subid=xxx&since_id=XXX’ . Applications can continue to get datas from the point that disconnected. Consequently, applications should reserve the data ID when disconnected. Because the subscription service is real-time, Weibo Platform only store datas for five minutes when disconnect. If the disconnected time exceeds five minutes, since_id parameter will not be supported. In that case, the error response ‘param since_id is illegal’ will be returned if since_id to be passed. When the application uses the subscription service illegally, the subscription of the application will be suspended, that is the datas will not be delivered. The subscription can be restarted when the problems to be resolved. Then applications need to re-request the pushing APIs with the persistent HTTP connection. In addition, the IP address to request the pushing APIs must be one of the IP list provided when created the subscription. Otherwise, the error response ‘Ip is limited’ will be returned. ==Specifications for new subscription service== Applications keep a persistent HTTP request to pushing APIs:‘/commercial/push’ to get data. Parameter subid must be passed to indicate which subscription data should be delivered. [[New_error_code_definitions|Error codes]] will be returned when request in a wrong way. When the application uses the subscription service illegally, the subscription of the application will be suspended, that is the datas will not be delivered. The subscription can be restarted when the problems to be resolved. Then applications need to re-request the pushing APIs with the persistent HTTP connection. In addition, the IP address to request the pushing APIs must be one of the IP list provided when created the subscription. Otherwise, the error response ‘Ip is limited’ will be returned. More information can be found in [[C/2/commercial/push/en|commercial/push]]. ==Statuses== The service statuses will be displayed in the ‘Developer Management Center’ as follows: {{center|http://www.sinaimg.cn/blog/developer/wiki/picchart/subscription_start.png}} There are five statuses: in preparation, ready, start, suspension, termination. <font size="2" style="font-weight:bold">● in preparation:</font> After the subscription is created, the pushing server will be ‘in preparation’ when not arrives at the start time of the pushing specified by the application. If the start time is not specified, there will not have the ‘in preparation’ status. The pushing server will enter the status of ‘ready’ immediately after the subscription is created. <font size="2" style="font-weight:bold">● ready:</font> After the subscription is created, only when the start time of the pushing specified by the application has already arrived at and the application has not connected the pushing APIs, will the pushing server be the status of ‘ready’. When the start time of pushing is not specified and the application has not connected the pushing APIs, the pushing server will be the status of ‘ready’ too. <font size="2" style="font-weight:bold">● start:</font> When the pushing server is at the status of ‘ready’ and the application has connected the pushing APIs, the pushing server will enter the status of ‘start’. <font size="2" style="font-weight:bold">● suspension:</font> When the application uses the subscription service illegally, the subscription of the application will be suspended by Weibo Platform. Then the pushing server will enter the status of ‘suspension’. <font size="2" style="font-weight:bold">● termination:</font> The pushing will be terminated when arrives at the end time of pushing specified by the application. If not specified, the pushing has no end. When the pushing terminates, the pushing server will enter the status of ‘termination’, that is the subscription is expired and can’t be restarted again. {{Languages|订阅服务手册}} {{#a:nobtns|noheading}}
该页面使用的模板:
模板:Center
(
查看源代码
)
模板:Languages
(
查看源代码
)
模板:Languages/Lang
(
查看源代码
)
模板:Languages/Title
(
查看源代码
)
模板:Nmbox
(
查看源代码
)
返回到
订阅服务手册/en
。
反馈
分享
顶部