用户工具

站点工具


差别

这里会显示出您选择的修订版和当前版本之间的差别。

到此差别页面的链接

两侧同时换到之前的修订记录 前一修订版
后一修订版
前一修订版
en:toaster:user-menu-of-pns [2015/03/20 14:24]
cobub [Notification Bar message template]
en:toaster:user-menu-of-pns [2017/07/14 11:18] (当前版本)
行 1: 行 1:
-====== User Menu of PNS ======+~~Title:​Cobub Toaster User Manual of PNS - Mobile Apps Marketing Platform of Open Source - Mobile Analytics & Mobile Push Notification Solutions - Cobub Mobile Developer Center~~ 
 +{{description>​Cobub Razor is an Open Source Mobile Analytics. The document introduces usage of PNS Web interface.Here are the concepts of user channel and tag channel, which must be clarified.}} 
 +{{keywords>​Cobub Razor,open source mobile analytics,​mobile analytics,​mobile app analytics, pns, user manual}} 
 + 
 +====== User Manual ​of PNS ======
 The document introduces usage of PNS Web interface. The document introduces usage of PNS Web interface.
  
行 104: 行 108:
 </​code>​ </​code>​
  
----- +  * status: 200 indicates success, 400 indicates the request packet format error. 
-      +  * pushedCount:​ count of message sent. This number does not represent the number of users(devices) who received the message, it only means the server has sent data to 100 links. Only when SDK submit the receipt, the PNS server will get to know how many users(devices) received message. 
-  *   * status: 200 indicates success, 400 indicates the request packet format error. +  * offCount: the current offline count in submitted user channel. 
-  ​*   * pushedCount:​ count of message sent. This number does not represent the number of users(devices) who received the message, it only means the server has sent data to 100 links. Only when SDK submit the receipt, the PNS server will get to know how many users(devices) received message. +  * elapsed: the consume time on the server push, in milliseconds,​ is a float type number. 
-  ​*   * offCount: the current offline count in submitted user channel. +  * mid: the unique ID of push task for the pushing. It can be used to query task information asynchronous,​ such as received count, click count, message content, and so on.
-  ​*   * elapsed: the consume time on the server push, in milliseconds,​ is a float type number. +
-  ​*   * mid: the unique ID of push task for the pushing. It can be used to query task information asynchronous,​ such as received count, click count, message content, and so on.+
  
             ​             ​
 ===== Push to specified one or more tag channels (tagpub) ===== ===== Push to specified one or more tag channels (tagpub) =====
 +tagpub is a command for the tag channel pushing, also supporting offline messages, as long as non-zero value of expired. But please note offline messages will cost more resources. If only a instant message, please set expired to 0 .
 +METHOD_NAME:​ tagpub
 +POST_DATA:
 +             "​channel":​ "​localtion:​beijing",​
 +             "​channel":​ "​location:​guangzhou",​
 +             "​data":​ "hello world",​
 +             "​appid":​ "​XXX",​
 +             "​expired":​ "​1403521931"​
 +
 +
 +
 +            ​
 +
 +  * channel: tag channel name, can be more than one channel.
 +  * data: data to send.
 +  * appid: appid associated with the tag channels, it should only be tag channels under the App.
 +  * expired: same as pub method.
 +
 +Returns format:
 +
 +         {
 +            "​status": ​     "​200",​
 +            "​pushedCount":​ 100,
 +            "​elapsed": ​    0.52,
 +            "​mid": ​        "​489c4465de66000"​
 +         }
 +All the returns have same meaning with pub method.
 +
 +
 ===== Push to all the users of an APP (allpub) ===== ===== Push to all the users of an APP (allpub) =====
 +The method will push notification to online users or all users(devices) under appid. “expired” is used to distinguish online users and offline users. If expired is set 0, PNS will send data to online users, and do not save offline message.
  
 +METHOD_NAME:​ allpub
 +POST_DATA:
 +
 +             "​appid":​ "​XXX",​
 +             "​data":​ "hello world",​
 +             "​expired":​ "​1403521931"​
 +Returns format:
 +
 +        {
 +            "​status": ​     "​200",​
 +            "​pushedCount":​ 100,
 +            "​elapsed": ​    0.52,
 +            "​mid": ​        "​489c4466de66000" ​
 +         }
 +Status description:
 +
 +  * 200 success
 +  * 400 request packet error
 +  * 500 server internal error (usually related to redis)
 ===== Add uid to tag-channel (sub-tag) ===== ===== Add uid to tag-channel (sub-tag) =====
 +PNS will add the uids to a certain tag channel when this interface is invoking. This method is idempotent.
 +METHOD_NAME:sub-tag
 +POST_DATA:
  
 +             "​appid":​ "​XXX",​
 +             "​tag":​ "​localtion:​beijing",​
 +             "​uid":​ "​xxx@qq.com",​
 +             "​uid":​ "​xxxx@gmail.com" ​
 +Parameters description:
 +
 +appid: the associated appid, only one
 +tag: the tag name to be used, also only one
 +uid: uid to be added to the tag-channel,​ can be multiple
 +Returns format:
 +
 +        {
 +            "​status":​ "​200"​
 +         }
 +Status description:​
 +
 +  * 200 success
 +  * 400 request packet error
 +  * 500 server internal error (usually related with redis )
 ===== Remove uid form tag-channel(unsub-tag) ===== ===== Remove uid form tag-channel(unsub-tag) =====
 +METHOD_NAME:​ unsub-tag
 +POST_DATA:
  
 +            "​appid":​ "​XXX",​
 +             "​tag":​ "​localtion:​beijing",​
 +             "​uid":​ "​xxx@qq.com",​
 +             "​uid":​ "​xxxx@gmail.com", ​
 +Parameters description:
 +
 +appid: the associated appid, only one
 +tag: the tag-channel name to be used, also only one
 +uid: uid to be removed from the tag-channel,​ can be multiple
 +Returns format:
 +
 +       {
 +            "​status":​ "​200" ​
 +        }
 +Status:
 +
 +  * 200 success
 +  * 400 request packet error
 +  * 500 internal server error (usually related with redis )
 ===== Push task query (message) ===== ===== Push task query (message) =====
 +METHOD_NAME:​ message
 +POST_DATA:
 +
 +        "​mid":​ "​489c4466de66000" ​         ​
 +Returns format:
 +
 +        {
 +             "​status":"​200"​
 +             "​489c4466de66000": ​
 +               {
 +                    "​content":"​hello world!", ​       ​
 +                    "​expire":"​1404378620",​
 +                    "​readCount":"​0",​
 +                    "​recvdCount":"​0",​
 +                    "​startTime":"​1403407632",​
 +                    "​totalCount":"​2",​
 +                    "​appid":​ "​XXX"​
 +                }
 +        }
 +Returns description:​
 +
 +  * status: the results of interface query, 200 is OK
 +  * content: notification content
 +  * expire: message expiration timestamp
 +  * readCount: count of being clicked (read) by users
 +  * recvCount: count of being received by users
 +  * startTime: time of push
 +  * totalCount: total count
 +  * 489c4466de66000:​ push task it
 +  * appid: appid of the push task
  
 ===== User channel query (userchannel) ===== ===== User channel query (userchannel) =====
 +METHOD_NAME:​ userchannel
 +POST_DATA:
 +
 +            "​channel":​ "​xxx@qq.com",​
 +            "​channel":​ "​xxxx@gmail.com" ​
 +Returns:
 +
 +     {
 +         "​status":​ "​200",​
 +         "​xxx@qq.com":​ 1, //this uid is online
 +         "​xxxx@gmail.com":​ 0 //this uid is offline
 +      }
  
 ===== Tag channel query (tagchannel) ===== ===== Tag channel query (tagchannel) =====
 +METHOD_NAME:​ tagchannel
 +POST_DATA:
  
 +            "​channel":​ "​location:​Beijing",​
 +            "​channel":​ "​location:​Guangzhou"​
 +Return :
 +
 +     {
 +         "​status":​ "​200",​
 +         "​location:​Beijing":​ 456, //there are 456 people under TAG "​location:​Beijing"​ currently, including online and offline
 +         "​location:​Guangzhou":​ 23 //there are 23 people under TAG "​location:​Guangzhou"​ currently, including online and offline
 +      }
 ===== APP query(app-size) ===== ===== APP query(app-size) =====
 +METHOD_NAME:​ app-size
 +POST_DATA:
 +
 +            "​online":​ 1,
 +            "​appid":​ "​xxx",​
 +            "​appid":​ "​yyy" ​
 +online: 1 indicates to query online user count, 0 for the total count including offline
 +appid: can provide multiple appid to query
 +Return format:
 +
 +    {
 +         "​status":​ "​200",​
 +         "​xxx":​ 1234, //app which appid is xxx online (or total) user number is 1234 currently
 +         "​yyy":​ 567 //app which appid is yyy online (or total) user number is 567 currently
 +      }
 +The returned number indicates count of devices, and the meaning depends on the “online” value of the method.
 +
  
en/toaster/user-menu-of-pns.1426832645.txt.gz · 最后更改: 2017/07/14 11:12 (外部编辑)