Receive Event Push
(→Pushing event when click menu to get messages) |
(→Scanning a two-dimension code with parameters) |
||
第113行: | 第113行: | ||
==Scanning a two-dimension code with parameters== | ==Scanning a two-dimension code with parameters== | ||
− | + | Two-dimensional code scanning parameters event,push the JSON format is as follows: | |
<pre> | <pre> | ||
{ | { | ||
第132行: | 第132行: | ||
{|width="100%" border="0" cellspacing="0" cellpadding="0" class="wiki_table" | {|width="100%" border="0" cellspacing="0" cellpadding="0" class="wiki_table" | ||
<html><colgroup><col class="tbF1"/><col class="tbF2" /><col /></colgroup></html> | <html><colgroup><col class="tbF1"/><col class="tbF2" /><col /></colgroup></html> | ||
− | !colspan="3" scope="col" |<span id="返回值说明"> | + | !colspan="3" scope="col" |<span id="返回值说明">Return Value</span> |
|- | |- | ||
− | |style="text-align:center; width: 12%"| | + | |style="text-align:center; width: 12%"| Parameters |
− | |style="text-align:center;width: 12%"| | + | |style="text-align:center;width: 12%"|Type |
− | |style="text-align:center;"| | + | |style="text-align:center;"| Description |
|- | |- | ||
|type | |type | ||
第144行: | 第144行: | ||
|receiver_id | |receiver_id | ||
|int64 | |int64 | ||
− | | | + | |Recipient of the message |
|- | |- | ||
|sender_id | |sender_id | ||
|int64 | |int64 | ||
− | | | + | |Sender of the message |
|- | |- | ||
|created_at | |created_at | ||
|string | |string | ||
− | | | + | |Message creation time |
|- | |- | ||
|text | |text | ||
|string | |string | ||
− | | | + | |The default copy.subtype as "two-dimensional code scanning" when scan or scan_follow; |
|- | |- | ||
|data | |data | ||
|string | |string | ||
− | | | + | |Message Content |
|- | |- | ||
|data:subtype | |data:subtype | ||
|string | |string | ||
− | | | + | |scan and scan_follow for the two-dimensional code scanning event。 |
|- | |- | ||
|data:key | |data:key | ||
|string | |string | ||
− | | | + | |Event KEY values, format action_name_scene_id, ie to action_name prefixed behind two-dimensional code for scene_id; |
|- | |- | ||
|data:ticket | |data:ticket | ||
|string | |string | ||
− | | | + | |Ticket-dimensional codes, two-dimensional code can be used to exchange pictures。 |
|} | |} | ||
− | |||
==Have been @ message== | ==Have been @ message== |
2014年8月6日 (三) 19:56的版本
After users taking attention to or cancel the attention to a third Weibo account,or scanning a two-dimension code with parameters, the Weibo server will push this events to the url which the third Weibo account wrote in the fan service platform. It gives great convenience to developers to send users with welcome messages or unbundling account. The Weibo server will break connection if it cannot receive response in five seconds, and it will send a new request, if not succeed, it will retry three times. To Eliminate message repetitive of the retry, you’d better use FromUserName + CreateTme. If the third server cannot dispose an reply in five seconds, it can directly reply an empty string, the Weibo user will not do anything under this situation and will not begin retrying.
目录 |
Taking attention or canceling attention event
Taking attention or canceling attention,push the JSON format is as follows:
{ "type": "event", "receiver_id": 1902538057, "sender_id": 2489518277, "created_at": "Mon Jul 16 18:09:20 +0800 2012", "text": "关注事件消息", "data": { "subtype": "follow" } }
Return Value | ||
---|---|---|
Parameters | Type | Description |
type | string | event |
receiver_id | int64 | Recipient of the message |
sender_id | int64 | Sender of the message |
created_at | string | Message creation time |
text | string | The default copy。subtype is follow or unfollow:“Taking attention event”、“anceling attention event”; |
data | string | Message Content |
data:subtype | string | follow:Taking attention ,unfollow:canceling attention event |
Subscribe or unsubscribe event
Subscribe or unsubscribe event,Push the JSON format is as follows:
{ "type": "event", "receiver_id": 1902538057, "sender_id": 2489518277, "created_at": "Mon Jul 16 18:09:20 +0800 2012", "text": "订阅事件消息", "data": { "subtype": "subscribe" } }
Return Value | ||
---|---|---|
Parameters | Type | Description |
type | string | event |
receiver_id | int64 | Recipient of the message |
sender_id | int64 | Sender of the message |
created_at | string | Message creation time |
text | string | The default copy。为subscribe或unsubscribe时为触发订阅的私信关键词(如“dy”),非私信触发时(点击订阅按钮)为“订阅事件消息”、“取消订阅事件消息”; |
data | string | Message Content |
data:subtype | string | subscribe:Subscribe event,unsubscribe:Unsubscribe event。 |
Scanning a two-dimension code with parameters
Two-dimensional code scanning parameters event,push the JSON format is as follows:
{ "type": "event", "receiver_id": 1902538057, "sender_id": 2489518277, "created_at": "Mon Jul 16 18:09:20 +0800 2012", "text": "扫描二维码", "data": { "subtype": "scan_follow", "key": "action_name_scene_id", "ticket": "TICKET", } }
Return Value | ||
---|---|---|
Parameters | Type | Description |
type | string | event |
receiver_id | int64 | Recipient of the message |
sender_id | int64 | Sender of the message |
created_at | string | Message creation time |
text | string | The default copy.subtype as "two-dimensional code scanning" when scan or scan_follow; |
data | string | Message Content |
data:subtype | string | scan and scan_follow for the two-dimensional code scanning event。 |
data:key | string | Event KEY values, format action_name_scene_id, ie to action_name prefixed behind two-dimensional code for scene_id; |
data:ticket | string | Ticket-dimensional codes, two-dimensional code can be used to exchange pictures。 |
Have been @ message
说明:指定的认证用户需被授予接收“被@消息”权限,此接口才返回“被@消息”,申请可邮件 mingjin@staff.sina.com.cn 。
{ "type": "mention", "receiver_id": 1902538057, "sender_id": 2489518277, "created_at": "Mon Jul 16 18:09:20 +0800 2012", "text": "被@的微博或评论文本信息", "data": { "subtype": "MENTION_TYPE, "key": "MENTION_KEY" } } // 默认仅返回可信用户的@,如需返回所有用户@,认证用户可访问此链接设置:http://account.weibo.com/set/message
返回值说明 | ||
---|---|---|
属性 | 值的类型 | 说明描述 |
type | string | mention |
receiver_id | int64 | 消息的接收者 |
sender_id | int64 | 消息的发送者 |
created_at | string | 消息创建时间 |
text | string | 被@的微博或评论文本信息 |
data | string | 消息内容 |
data:subtype | string | status:@的微博,comment:@的评论 |
data:key | string | 当subtype为status时为微博ID,为comment时为评论ID |
Click menu event,push the JSON format is as follows::
{ "type": "event", "receiver_id": 1902538057, "sender_id": 2489518277, "created_at": "Mon Jul 16 18:09:20 +0800 2012", "text": "自定义菜单点击事件消息", "data": { "subtype": "click", "key": "EVENT_KEY" } }
Return Value | ||
---|---|---|
Parameters | Type | Description |
type | string | event |
receiver_id | int64 | Recipient of the message |
sender_id | int64 | Sender of the message |
created_at | string | Message creation time |
text | string | The default copy,subtype when click "Custom menu click event message"; |
data | string | Message Content |
data:subtype | string | click, Custom menu click event |
data:key | string | value is clicked custom menus |
Pushing event when click jump url
Pushing event when click jump url,push the JSON format is as follows:
{ "type": "event", "receiver_id": 1902538057, "sender_id": 2489518277, "created_at": "Mon Jul 16 18:09:20 +0800 2012", "text": "自定义菜单跳转链接事件消息", "data": { "subtype": "view", "key": "url" } }
Return Value | ||
---|---|---|
Parameters | Type | Description |
type | string | event |
receiver_id | int64 | Recipient of the message |
sender_id | int64 | Sender of the message |
created_at | string | Message creation time |
text | string | The default copy,subtype when view is "custom menu hoplinks event messages"; |
data | string | Message Content |
data:subtype | string | view, Custom menu hoplinks event messages |
data:key | string | Url the button settings |