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 jingyi7@staff.weibo.comto 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

  Requires Type and Range Description
access_token true string Obtained from Fan Service Platform - Advanced - Developer mode page, or after authorized by OAuth2.0, see Obtain developer API access token on Fan Service Platform 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. When using this API, the sender should have quota of sending messages to receiver: generally speaking, sender get 99 quota within 48 hours for sending messages to the receiver after receiver sent messages to sender.
  • 3. For developers using long connection access mode, the message/reply interface is slightly different, please go to http://open.weibo.com/wiki/2/messages/reply for details.

This API mustn't be used to promoting or guiding the user to use any service that has a direct competitive relationship with sina Weibo, otherwise application or V users will be permanently blocked.

Message Type Blue V user could Reply

Currently, the following data value could be supported for message types blue V could reply:

1. Pure text message: text

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


Parameters Type Requires Description
text string true Text content of replied message. The length of the content must be less than 300 Chinese characters.
  • Example:
    • URL encoded json type data {"text": "纯文本响应"}(pure text response) is '%7B%22text%22%3A%22%E7%BA%AF%E6%96%87%E6%9C%AC%E5%9B%9E%E5%A4%8D%22%7D'.

The corresponding call is:

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. Img&text message: 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"
        },
        ... //Support up to 8 articles, recommend 1 or 3.
    ]
}


Parameters Type Requires Description
articles:display_name string true Displayed title of img&text.
articles:summary string true Description of img&text, only first description is displayed if more than 2 img&text.
articles:image string true Thumbnail of img&text, support JPG and PNG, using 280*155 for first one of single or multiple img&text, using 64*64 for the rest.
articles:url string true URL address of img&text, redirect after click.

3. Location type message: position

{
    "longitude": "344.3344",
    "latitude": "232.343434"
}
Parameters Type Requires Description
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"
}