C/2/datapush/edit

跳转到: 导航, 搜索
(以“{{Api_desc_business| uri=datapush/edit| desc=Subscribe keywords and users.| httpMethod=POST| needAuth=False| rateLimit={{B_rate_limit}}| params={{api_args|subid|true...”为内容创建页面)
 
 
(未显示1个用户的8个中间版本)
第1行: 第1行:
 
{{Api_desc_business|
 
{{Api_desc_business|
 
uri=datapush/edit|
 
uri=datapush/edit|
desc=Subscribe keywords and users.|
+
desc=订阅关键词、用户。|
 
httpMethod=POST|
 
httpMethod=POST|
 
needAuth=False|
 
needAuth=False|
 
rateLimit={{B_rate_limit}}|
 
rateLimit={{B_rate_limit}}|
params={{api_args|subid|true|int|Subscription ID (See the [[description]] for more information).}}
+
params={{api_args|subid|true|int|订阅ID([[详情]])}}
{{api_args|add_keywords|false|string|Add keywords that will be subscribed. The keywords should be separated by semiangle comma, and are limited by 20 keywords per call.}}
+
{{api_args|add_keywords|false|string|添加要订阅的关键词,最多指定20个关键词,由英文半角逗号分隔。}}
{{api_args|del_keywords|false|string|Delete keywords that have already been subscribed. The keywords should be separated by semiangle comma, and are limited by 20 keywords per call.}}
+
{{api_args|del_keywords|false|string|删除已订阅的关键词,最多指定20个关键词,由英文半角逗号分隔。}}
{{api_args|add_users|false|string|Add userids that will be subscribed. The userids should be separated by semiangle comma, and are limited by 50 userids per call.}}
+
{{api_args|add_uids|false|string|添加要订阅的用户ID,最多指定50个用户ID,由英文半角逗号分隔。}}
{{api_args|del_users|false|string|Delete userids that have already been subscribed. The userids should be separated by semiangle comma, and are limited by 50 userids per call.}}
+
{{api_args|del_uids|false|string|删除已订阅的用户ID,最多指定50个用户ID,由英文半角逗号分隔。}}
 
|
 
|
 
result=
 
result=
 
<pre>
 
<pre>
//Success
+
//成功返回
 
{
 
{
     “data”: [
+
     "result":true
        {
+
}
            “uid”: 730,            //微任务用户ID
+
//
            “sinaid”: 1235653741,  //新浪微博用户ID
+
{
            “nick”: ”随便谁吧”,    //新浪微博用户昵称
+
    "appkey": 2363923368"subid": 10032"subname": "JY测试1""ip": [
            “stars”: 3,
+
         10.210.xx,
            “price”: 95.5,         //直发价格
+
        10.210.230.xx,
            ”reprice“: 95.3      //转发价格
+
         .....
            “followers”: 3000000,
+
            “weiboclass”: ”汽车,娱乐,新闻”,    //微任务帐号分类
+
            “location”: ”北京朝阳”,
+
            “gender”: ”男”,
+
            “profile_imageurl”: ”http: //www2.img.sina.com.com/asdfsa345.jpg”
+
        },
+
         ...
+
 
     ],
 
     ],
     “count”: 20
+
     "filters": {
 +
        "userfilter": {
 +
            "id": [
 +
                1231456,
 +
                1234564565
 +
            ]
 +
        },
 +
        "domainfilter": {
 +
            "domain": [
 +
                "www.baidu.com",
 +
                "www.sina.com"
 +
            ]
 +
        },
 +
        "mediafilter": {
 +
            "video": true,
 +
            "pic": false,
 +
            "music": false,
 +
            "ori": true
 +
        },
 +
        "keywordfilter": {
 +
            "key": [
 +
                "hello",
 +
                "world"
 +
            ],
 +
           
 +
        },
 +
        "appfilter": {
 +
            "currentapp": "true"
 +
        },
 +
        "datafilter": {
 +
            "weibo": true,
 +
            "comment": false
 +
        }
 +
    },
 +
    "strategy": {
 +
        "pushstatus": "true/false",
 +
        "begintime": "",
 +
        "endtime": "",
 +
        "percent": "",
 +
       
 +
    }
 
}
 
}
//Failure
+
 
 +
//失败返回
 
{
 
{
 
     "request": "/statuses/bilateral_timeline/ids.json",
 
     "request": "/statuses/bilateral_timeline/ids.json",
第39行: 第73行:
 
     "error": "error message."
 
     "error": "error message."
 
}</pre>|
 
}</pre>|
resultDes=None|
+
resultDes=|
useAge=*If just parameter ‘subid’ is passed, the subscription info included the keywords and users list will be returned.
+
useAge=*当只传subid时,返回该订阅的订阅信息,包括订阅的关键词列表、用户列表;
*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.
+
*请求该接口的IP必须在此订阅的IP白名单中,否则无法请求该接口;
*Parameter 'access_token' is not needed to pass.  |
+
*该接口不需要登录认证,不需要传入source、access_token参数;|
otherInfo=None
+
otherInfo=
 
}}{{#a:showgrade}}
 
}}{{#a:showgrade}}

2013年10月25日 (五) 16:18的最后版本

datapush/edit

订阅关键词、用户。

URL

https://c.api.weibo.com/2/datapush/edit.json

支持格式

JSON

HTTP请求方式

POST

是否需要登录

False
关于登录授权,参见 如何登录授权

访问授权限制


请求所有商业接口:

    • 50000次/小时/IP;

请求参数

  必选 类型及范围 说明
source false string 采用OAuth授权方式不需要此参数,其他授权方式为必填参数,数值为应用的AppKey。
access_token false string 采用OAuth授权方式为必填参数,其他授权方式不需要此参数,OAuth授权后获得。
subid true int 订阅ID(详情)。
add_keywords false string 添加要订阅的关键词,最多指定20个关键词,由英文半角逗号分隔。
del_keywords false string 删除已订阅的关键词,最多指定20个关键词,由英文半角逗号分隔。
add_uids false string 添加要订阅的用户ID,最多指定50个用户ID,由英文半角逗号分隔。
del_uids false string 删除已订阅的用户ID,最多指定50个用户ID,由英文半角逗号分隔。

注意事项

  • 当只传subid时,返回该订阅的订阅信息,包括订阅的关键词列表、用户列表;
  • 请求该接口的IP必须在此订阅的IP白名单中,否则无法请求该接口;
  • 该接口不需要登录认证,不需要传入source、access_token参数;

返回结果

JSON示例

//成功返回
{
    "result":true
}
//或
{
    "appkey": 2363923368"subid": 10032"subname": "JY测试1""ip": [
        10.210.xx,
        10.210.230.xx,
        .....
    ],
    "filters": {
        "userfilter": {
            "id": [
                1231456,
                1234564565
            ]
        },
        "domainfilter": {
            "domain": [
                "www.baidu.com",
                "www.sina.com"
            ]
        },
        "mediafilter": {
            "video": true,
            "pic": false,
            "music": false,
            "ori": true
        },
        "keywordfilter": {
            "key": [
                "hello",
                "world"
            ],
            
        },
        "appfilter": {
            "currentapp": "true"
        },
        "datafilter": {
            "weibo": true,
            "comment": false
        }
    },
    "strategy": {
        "pushstatus": "true/false",
        "begintime": "",
        "endtime": "",
        "percent": "",
        
    }
}

//失败返回
{
    "request": "/statuses/bilateral_timeline/ids.json",
    "error_code": "201XX",
    "error": "error message."
}

关于错误返回值与错误代码,参见 错误代码说明

字段说明

其他



Language: [[{{{2/uri}}}|中文]]


文档更新时间: 2013-10-25
api评价