微博开放平台
微连接
移动应用
网站接入
电商服务商
电商商家
数据服务
数据服务
合作伙伴
微博支付
轻应用
粉丝服务
文档
推广
我的应用
登录
weibo
开发文档
首页
平台政策与指引
概述
平台公约
新手指南
开发者协议
应用运营管理规范
微连接分级管理办法
应用审核产品指南
应用安全开发注意事项
平台应用设计规范
微服务接入指南
微博登录接入
用微博帐号登录
授权机制
移动应用接入
移动应用介绍
移动应用SSO授权
微博Deep Link
媒体接入平台
头条文章开放接口
视频上传开放接口
电商接入平台
电商服务商接入
电商商家端接入
电商平台能力接口
粉丝服务平台
粉丝服务平台
新手接入指南
微信开发者迁移指南
接收消息
发送消息
自定义菜单
用户管理
生成带参数的二维码
Fans Service Platform
商业接口
商业数据接入指南
订阅服务手册(中文版)
订阅服务手册(英文版)
商业接口-REST API
商业数据常见问题
网站接入
网站接入介绍
微博API
微博API
接口访问频次权限
资源下载
SDK
微博标识下载
常见问题
联系我们
工具箱
链入页面
链出更改
特殊页面
查看源代码
跳转到:
导航
,
搜索
根据下列原因,你没有权限编辑本页:
您刚才请求的操作只有这个用户组中的用户才能使用:
用户
您可以查看并复制此页面的源代码:
After connecting with your callback url, Weibo Server will POST the message to your URL when the account get new general message. For each POST request from Weibo, developer can respond it by return specific JSON in response body. 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 message which may result from the retry mechanism, we recommend you eliminating the repetitive message by using "FromUserName plus Create Time. 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. ==Text Type Message== The JSON format of Text Type Message as the following: <pre> { "type": "text", "receiver_id": 1902538057, "sender_id": 2489518277, "created_at": "Mon Jul 16 18:09:20 +0800 2012", "text": "the content of a general message", "data": {} } </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="3" scope="col" |<span id="返回值说明">返回值说明</span> |- |style="text-align:center; width: 12%"|Variables |style="text-align:center;width: 12%"|Type |style="text-align:center;"|Decription |- |type |string |text |- |receiver_id |int64 |the receiver of this message |- |sender_id |int64 |the sender of this message |- |created_at |string |the creation time of this message |- |text |string |the content of this message |- |data |string |Text Type Message is blank |} ==Position Type Message== The JSON format of Position Type Message as the following: <pre> { "type": "position", "receiver_id": 1902538057, "sender_id": 2489518277, "created_at": "Mon Jul 16 18:09:20 +0800 2012", "text": "我在这里: http://t.cn/zQgLLYO", "data": { "longitude": "116.308586", "latitude": "39.982525" } } </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="3" scope="col" |<span id="返回值说明">返回值说明</span> |- |style="text-align:center; width: 12%"|Variables |style="text-align:center;width: 12%"|Type |style="text-align:center;"|Decription |- |type |string |position |- |receiver_id |int64 |the receiver of this message |- |sender_id |int64 |the sender of this message |- |created_at |string |the creation time of this message |- |text |string |default content about 7 Chinese Characters“发送了一个位置” |- |data |string |the content of this message |- |data:longitude |string |longitude |- |data:latitude |string |latitude |} ==Voice Type Message== The JSON format of Voice Type Message as the following: <pre> { "type": "voice", "receiver_id": 1902538057, "sender_id": 2489518277, "created_at": "Mon Jul 16 18:09:20 +0800 2012", "text": "发了一个语音消息", "data": { "vfid": 821804459, // the sender can get the voice file by this ID "tovfid": 821804469 // the receiver can get the voice file by this ID } } </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="3" scope="col" |<span id="返回值说明">返回值说明</span> |- |style="text-align:center; width: 12%"|Variables |style="text-align:center;width: 12%"|Type |style="text-align:center;"|Description |- |type |string |voice |- |receiver_id |int64 |the receiver of this message |- |sender_id |int64 |the sender of this message |- |created_at |string |the creation time of this message |- |text |string |私信内容 |- |data |string |消息内容,纯文本私信或留言为空 |- |data:vfid |string |语音文件ID,发送者通过此ID读取语音 |- |data:tovfid |string |语音文件ID,接收者通过此ID读取语音 |} <pre> 查看(下载)认证用户接收到的语音方法一 curl "https://upload.api.weibo.com/2/mss/msget?access_token=RECIPIENT_ACCESS_TOKEN&fid=TOVFID" 1."RECIPIENT_ACCESS_TOKEN":返回结果中接收者(recipient_id)通过OAuth2授权返回的access_token; 2."TOVFID":返回结果data字段中的tovfid。 查看(下载)认证用户接收到的语音方法二 curl -u "USERNAME:PASSWORD" "https://upload.api.weibo.com/2/mss/msget?source=APPKEY&fid=TOVFID" 1."USERNAME:PASSWORD"为"recipient_id"(认证用户)的微博登录用户名和密码,此时方法二中的APPKEY应用所有者为"recipient_id"; 2."TOVFID":返回结果data字段中的tovfid。 </pre> ==Image Type Message== The JSON format of Image Type Message as the following: <pre> { "type": "image", "receiver_id": 1902538057, "sender_id": 2489518277, "created_at": "Mon Jul 16 18:09:20 +0800 2012", "text": "发了一张图片", "data": { "vfid": 821804459, // 发送者用此ID查看图片 "tovfid": 821804469 // 接收者用此ID查看图片 } } </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="3" scope="col" |<span id="返回值说明">返回值说明</span> |- |style="text-align:center; width: 12%"|Variables |style="text-align:center;width: 12%"|Type |style="text-align:center;"|Description |- |type |string |image |- |receiver_id |int64 |the receiver of this message |- |sender_id |int64 |the sender of this message |- |created_at |string |the creation time of this message |- |text |string |私信内容 |- |data |string |消息内容,纯文本私信或留言为空 |- |data:vfid |string |图片ID,发送者通过此ID读取图片 |- |data:tovfid |string |图片ID,接收者通过此ID读取图片 |} <pre> 查看(下载)图片 curl "https://upload.api.weibo.com/2/mss/msget?access_token=RECIPIENT_ACCESS_TOKEN&fid=TOVFID" 1,"RECIPIENT_ACCESS_TOKEN":返回结果中接收者(receiver_id)通过OAuth2授权返回的access_token; 2,"TOVFID":返回结果data字段中的tovfid。 </pre>
返回到
Receive General Message
。
反馈
分享
顶部