Send Customer Service Message
When your weibo account receive a general message or event push message, you have quota to reply user by Send Customer Service Message API.
When user send you a general message,or follow you, or subscribe you, or click your custom menu, you can reply user in 48 hours with no limits.
When User Unfollow you, you have no rights to reply a message.
URL
https://m.api.weibo.com/2/messages/reply.json
HTTP Request Method
POST
Request Parameters
Requires | Type and Range | Description | |
---|---|---|---|
access_token | true | string | access token]]。 |
type | true | string | text or articles or position |
data | true | string | the content of this message,must be URLEncode with UTF-8 format。 |
receiver_id | true | int64 | the receiver of your reply message |
save_sender_box | false | int | not necessary,0 or 1 |
- 注:Content-Type: application/x-www-form-urlencoded
Notes
- 1、发送方的uid信息是由access_token参数决定的;
- 2、调用接口时,需要消息发送方有针对于消息接收方的消息配额;一般来说,如果消息接收方给消息发送方主动发送过消息,则在7天内,消息发送方具备针对于消息接收方的主动配额一条;
Now This API support Three Types Message
Now we support three types of reply message type: text, articles and position
The data parameters of each type is different , the descriptions are as following:
1、Reply With A Text Message:text
{ "text": "纯文本回复" }
the Parameters which data parameter supported | |||
---|---|---|---|
Parameter | Type | Requires | Description |
text | string | true | The text content you want to reply.The content should by less than 300 Chinese Characters. |
For example:
When the json of data is {"text": "纯文本响应"} ,the data parameter after URLEncode is:"%7B%22text%22%3A%20%22%E7%BA%AF%E6%96%87%E6%9C%AC%E5%93%8D%E5%BA%94%22%7D%20"
And the corresponding curl 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、Reply With A Image-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" }, ... //最多支持8个图文,建议为1或3个 ] }
the Parameters which data parameter supported | |||
---|---|---|---|
Parameter | Type | Requires | Description |
articles:display_name | string | true | the title of a image-text message |
articles:summary | string | true | the summary of a image-text message |
articles:image | string | true | the image of a image-text message,support JPG、PNG,single-image-text message and the first image of multi-image-text message should be 280*155,the other image of multi-image-text message should be 64*64 |
articles:url | string | true | the URL of image-text message, when user click a image-text message, it will jump to this URL |
3、Reply With A Location Message:position
{ "longitude": "344.3344", "latitude": "232.343434" }
the Parameters which data parameter supported | |||
---|---|---|---|
Parameter | 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" }