Important! A new Community experience launched on September 26, 2017. Read more about it here or continue to Base Camp.
Voting: 
Vote up!
0 Votes
2 Replies

Push Notification

Rodrigo Alves da Costa on Aug 03, 2017 10:19 EDT

Posted In
Vote up!
0 votes
Vote down!

Just in order to provide more details, following my request:

 

POST /api/v1/messages/push HTTP/1.1
Host: myhostxxxxx.messaging.konycloud.com:443
Content-Type: application/json
Cache-Control: no-cache
Postman-Token: 36032f05-db0e-b0e9-935b-f7ac63686e00

{
  "messageRequest" : {
    "appId" : "My-App-ID",
    "global" : { },
    "messages" : {
      "message" : {
        "content" : {
          "priorityService" : "true",
          "data" : "teste msg",
          "mimeType" : "text/plain"
        },
        "overrideMessageId" : 0,
        "startTimestamp" : "0",
        "expiryTimestamp" : "0",
        "subscribers" : {
          "subscriber" : [ {
            "ksid" : "My-Subscriber-KSID"
          } ]
        },
        "platformSpecificProps" : {
          "title" : "Título message",
          "iphone" : {
            "title" : "Título message",
            "customData" : { }
          },
          "blackberry" : { },
          "android" : {
            "title" : "Título message"
          },
          "jpush" : {
            "key" : [ {
              "name" : "title",
              "value" : "Título message"
            } ]
          },
          "windows" : {
            "notificationType" : "TOAST",
            "text1" : "Título message",
            "text2" : "teste msg",
            "params" : { }
          },
          "wns" : {
            "notificationType" : "TOAST",
            "text1" : "Título message",
            "text2" : "teste msg",
            "params" : { },
            "image" : { },
            "text" : { }
          }
        },
        "type" : "PUSH"
      }
    }
  }
}

 

Replied by: Aug 03, 2017 11:04 EDT
Vote up!
0 votes
Vote down!

Hi Rodrigo,

KMS provides another API to send pushes that do not require authentication. Please make sure that you disable "Authentication for Message API" in the configuration page->General tab.

API URL: http://<ip>:<port>/kpns/message

Authentication: Not required

Sample Post Body:

{
  "messageRequest" : {
    "appId" : "appid",
    "global" : { },
    "messages" : {
      "message" : {
        "content" : {
          "priorityService" : "true",
          "data" : "message body!",
          "mimeType" : "text/plain"
        },
        "overrideMessageId" : 0,
        "startTimestamp" : "0",
        "expiryTimestamp" : "0",
        "subscribers" : {
          "subscriber" : [ {
            "ksid" : 4678279168040790334
          } ]
        },
        "platformSpecificProps" : {
          "title" : "message title",
          "iphone" : {
            "title" : "message title",
            "customData" : { }
          },
       
          "android" : {
            "title" : "message title"
          }
        },
        "type" : "PUSH"
      }
    }
  }
}

Thanks,

Vikash

Replied by: Sep 21, 2017 09:43 EDT