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 Obtained from Fan Service Platform - Advanced - Developer mode page, or after authorized by OAuth2.0, see 获取粉丝服务平台开发接口的access token for details.
type true string Response message type: text: pure text, articles: image&text, position: location.
data true string Message data, the content should exactly correspond to 'type' parameter, must be json string format after URL encoded, using UTF-8.
receiver_id true int64 ID of message receiver.
save_sender_box false int Valued 0 or 1, default as 1 if leave blank. If assigned as 1, messages send through this API will enter the sender's private mailbox; if assigned as 0, messages send through this API won't enter the sender's private mailbox.
  • Note:Content-Type: application/x-www-form-urlencoded

Notes

  • 1. Sender's uid is decided by parameter access_token.
  • 2. 调用接口时,需要消息发送方有针对于消息接收方的消息配额;一般来说,如果消息接收方给消息发送方主动发送过消息,则在48小时内,消息发送方具备针对于消息接收方的主动配额99条;

When


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

Message Type Blue V user could Reply

当前支持蓝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"
}