微博开放平台
微连接
移动应用
网站接入
电商服务商
电商商家
数据服务
数据服务
合作伙伴
微博支付
轻应用
粉丝服务
文档
推广
我的应用
登录
weibo
开发文档
首页
平台政策与指引
概述
平台公约
新手指南
开发者协议
应用运营管理规范
微连接分级管理办法
应用审核产品指南
应用安全开发注意事项
平台应用设计规范
微服务接入指南
微博登录接入
用微博帐号登录
授权机制
移动应用接入
移动应用介绍
移动应用SSO授权
微博Deep Link
媒体接入平台
头条文章开放接口
视频上传开放接口
电商接入平台
电商服务商接入
电商商家端接入
电商平台能力接口
粉丝服务平台
粉丝服务平台
新手接入指南
微信开发者迁移指南
接收消息
发送消息
自定义菜单
用户管理
生成带参数的二维码
Fans Service Platform
商业接口
商业数据接入指南
订阅服务手册(中文版)
订阅服务手册(英文版)
商业接口-REST API
商业数据常见问题
网站接入
网站接入介绍
微博API
微博API
接口访问频次权限
资源下载
SDK
微博标识下载
常见问题
联系我们
工具箱
链入页面
链出更改
特殊页面
查看源代码
跳转到:
导航
,
搜索
根据下列原因,你没有权限编辑本页:
您刚才请求的操作只有这个用户组中的用户才能使用:
用户
您可以查看并复制此页面的源代码:
For each POST request from Weibo, developer can respond it by return specific JSON in response body. Through your specific JSON, you can send a passive response message. Weibo Server will disconnect and request your callback url again if can't receive any response in 5 seconds. Weibo Server will retry 3 times in total. About eliminating the repetitive messages which may result from the retry mechanism, we recommend you eliminating the repetitive message by using sender_id plus created_at. If developer can't respond in 5 seconds, developer can reply with blank string. Weibo Server will not do anything with your blank string and will not retry after receiving your blank string. In this case, you can try to use Send Customer Service Message. ==Reply With A Text Message== If you want to reply with a text message, the JSON format you respond as the following: 注意:JSON格式中的data字段内容必须进行UTF8格式的URLEncode <pre class="brush:js"> { "result": true, "receiver_id":456, "sender_id":123, "type": "text", "data":"{ "text": "中文消息" }" } //返回样例 { "result":true, "sender_id":"123", "receiver_id":"456", "type":"text", "data":"%7B%22text%22%3A%22%E4%B8%AD%E6%96%87%E6%B6%88%E6%81%AF%22%7D" } </pre> <div class="wiki_kit"> {|width="100%" border="0" cellspacing="0" cellpadding="0" class="wiki_table" <html><colgroup><col class="tbF1"/><col class="tbF2" /><col /></colgroup></html> !colspan="4" scope="col" |<span id="data参数说明">data参数支持的参数</span> |- |style="text-align:center; width: 12%"|Parameter |style="text-align:center;width: 12%"|Type |style="text-align:center;width: 11%"|Requires |style="text-align:center;"|Description |- |text |string |true |要回复的私信文本内容。文本大小必须小于300个汉字。 |} 举例: 当data对应json为{"text": "纯文本响应"} 时,则进行URLEncode后对应data参数值为:"%7B%22text%22%3A%20%22%E7%BA%AF%E6%96%87%E6%9C%AC%E5%93%8D%E5%BA%94%22%7D%20"。 ==Reply With A Image-Text Message== If you want to reply with a image-text message, the JSON format you respond as the following: <pre class="brush:js"> { "result": true, "receiver_id":456, "sender_id":123, "type": "articles", "data": { "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个 ] } } //返回样例 { "result": true, "sender_id":"123", "receiver_id":"456", "type": "articles", "data":"%7B%22articles%22%3A%5B%7B%22display_name%22%3A%22%E4%B8%A4%E4%B8%AA%E6%95%85%E4%BA% 8B%22%2C%22summary%22%3A%22%E4%BB%8A%E5%A4%A9%E8%AE%B2%E4%B8%A4%E4%B8%AA%E6%95%85%E4%BA%8B%EF%BC%8C%E5%88%86%E4%BA%AB%E7%BB%99%E4%BD%A0%E3%80%82%E8%B0%81%E6%98%AF%E5%85%AC%E5%8F%B8%EF%BC%9F%E8%B0%81%E5%8F%88%E6%98%AF%E4%B8%AD%E5%9B%BD%E4%BA%BA%EF%BC%9F%E2%80%8B%22%2C%22image%22%3A%22http%3A%2F%2Fstorage.mcp.weibo.cn%2F0JlIv.jpg%22%2C%22url%22%3A%22http%3A%2F%2Fe.weibo.com%2Fmediaprofile%2Farticle%2Fdetail%3Fuid%3D1722052204%26aid%3D983319%22%7D%5D%7D" } </pre> <div class="wiki_kit"> {|width="100%" border="0" cellspacing="0" cellpadding="0" class="wiki_table" <html><colgroup><col class="tbF1"/><col class="tbF2" /><col /></colgroup></html> !colspan="4" scope="col" |<span id="data参数支持的参数">data参数支持的参数</span> |- |style="text-align:center; width: 12%"|参数名称 |style="text-align:center;width: 12%"|值的类型 |style="text-align:center;width: 11%"|是否必填 |style="text-align:center;"|说明描述 |- |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地址,点击后跳转 |} ==位置类型私信消息== <pre> { "result": true, "receiver_id":456, "sender_id":123, "type": "position", "data": { "longitude": "344.3344", "latitude": "232.343434" } } //返回样例 { "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" } </pre> <div class="wiki_kit"> {|width="100%" border="0" cellspacing="0" cellpadding="0" class="wiki_table" <html><colgroup><col class="tbF1"/><col class="tbF2" /><col /></colgroup></html> !colspan="4" scope="col" |<span id="data参数支持的参数">data参数支持的参数</span> |- |style="text-align:center; width: 12%"|参数名称 |style="text-align:center;width: 12%"|值的类型 |style="text-align:center;width: 11%"|是否必填 |style="text-align:center;"|说明描述 |- |longitude |string |true |经度 |- |latitude |string |true |纬度 |} <p>[http://www.sinaimg.cn/blog/developer/wiki/xiaoxituisong_php_demo.rar php代码示例]</p> <p>[http://www.sinaimg.cn/blog/developer/wiki/xiaoxituisong_java_demo.rar java代码示例]</p>
返回到
Send Passive Response Message
。
反馈
分享
顶部