Send Customer Service Message
(→Notes) |
(→Notes) |
||
第31行: | 第31行: | ||
==Notes== | ==Notes== | ||
− | * | + | *1、Weibo get the sender information from access_token; |
==Now This API support Three Types Message == | ==Now This API support Three Types Message == |
2014年8月7日 (四) 02:18的最后版本
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、Weibo get the sender information from access_token;
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" }