C/2/messages/reply/biz-en

跳转到: 导航, 搜索

messages/reply/biz

When users send messages to verified account, system will push messages to developer, then developer could call this API to receive messages with limited time. Currently, for user sending messages, following/subscribing events, clicking customized menu, scanning two-dimensional code, developers can send messages without limitation within 48 hours. For user mentioning event, developers can reply only one time within 48 hours. Note: This API could return 'mentioned(@) messages' if designated verified users get authorized receiving 'mentioned(@) messages'. Please email mingjin@staff.sina.com.cn to apply. Developer could not reply to messages if user unfollowed.

URL

https://c.api.weibo.com/2/messages/reply/biz.json

HTTP Request Method

POST

Requires Login

true
See the Login and Authorization Mechanism Statement for login and authorization details.


Request Parameters

  必选 类型及范围 说明
access_token true string 在粉丝服务平台 - 高级功能 - 开发者模式页面中获取,或者OAuth2.0授权后获得, 详细参考 获取粉丝服务平台开发接口的access token
type true string 需要以何种类型的消息进行响应,text:纯文本、articles:图文、position:位置。
data true string 消息数据,具体内容严格遵循type类型对应格式,必须为json做URLEncode后的字符串格式,采用UTF-8编码。
receiver_id true int64 ID of message receiver.
save_sender_box false int 取值为0或1,不填则默认为1。取值为1时,通过本接口发送的消息会进入发送方的私信箱;取值为0时,通过本接口发送的消息不会进入发送方的私信箱。
  • 注:Content-Type: application/x-www-form-urlencoded

Notes

  • 1、发送方的uid信息是由access_token参数决定的;
  • 2、调用接口时,需要消息发送方有针对于消息接收方的消息配额;一般来说,如果消息接收方给消息发送方主动发送过消息,则在48小时内,消息发送方具备针对于消息接收方的主动配额99条;
  • 3、对于使用长连接接入模式的开发者,message/reply接口的调用方式略有不同,详情请参考http://open.weibo.com/wiki/2/messages/reply 文档;


此接口不得用于推广或引导用户使用任何与新浪微博有直接竞争关系的公司的服务,否则将永久关停指定应用或V用户使用资格。

蓝V可回复的私信类型

当前支持蓝V回复的私信类型(type)中,data参数支持的参数:


1、纯文本类型私信消息:text

{
    "text": "纯文本回复"
}


参数名称 值的类型 是否必填 说明描述
text string true 要回复的私信文本内容。文本大小必须小于300个汉字。
  • 举例:
    • 当data对应json为{"text": "纯文本响应"} 时,则进行URLEncode后对应data参数值为:"%7B%22text%22%3A%22%E7%BA%AF%E6%96%87%E6%9C%AC%E5%9B%9E%E5%A4%8D%22%7D"。

则对应的调用为:

curl "https://m.api.weibo.com/2/messages/reply.json?access_token=ACCESS_TOKEN" -d 'receiver_id=RECEIVER_ID&type=text&data=%7B%22text%22%3A%22%E7%BA%AF%E6%96%87%E6%9C%AC%E5%9B%9E%E5%A4%8D%22%7D' -k


2、图文类型私信消息:articles

{
    "articles": [
        {
            "display_name": "两个故事",
            "summary": "今天讲两个故事,分享给你。谁是公司?谁又是中国人??",
            "image": "http://storage.mcp.weibo.cn/0JlIv.jpg",
            "url": "http://e.weibo.com/mediaprofile/article/detail?uid=1722052204&aid=983319"
        },
        ... //最多支持8个图文,建议为1或3个
    ]
}


参数名称 值的类型 是否必填 说明描述
articles:display_name string true 图文的显示名称标题。
articles:summary string true 图文的文字描述,大于等于2个图文时,仅显示第一个图文的描述。
articles:image string true 图文的缩略显示图片,需为JPG、PNG格式,单图及多图第一张推荐使用280*155,多图非第一张推荐使用64*64。
articles:url string true 图文的URL地址,点击后跳转。

3、位置类型私信消息:position

{
    "longitude": "344.3344",
    "latitude": "232.343434"
}
参数名称 值的类型 是否必填 说明描述
longitude string true Longitude
latitude string true Latitude

Response

// 成功返回
{
    "result": true,
    "sender_id": "123",
    "receiver_id": "456",
    "type":"position"
    "data": "%7B%22longitude%22%3A%22344.3344%22%2C%22latitude%22%3A%22232.343434%22%7D"
}