Submitting a PAP push request

The following sample shows a push request that is sent to the PPG. This request is a multipart message that includes a PAP push message control entity and the pushed data.

Content-Type: application/xml

<?xml version="1.0"?>
<!DOCTYPE pap PUBLIC "-//WAPFORUM//DTD PAP 2.1//EN" 
          "http://www.openmobilealliance.org/tech/DTD/pap_2.1.dtd">

<pap>
  <push-message push- id="999999999"
        source-reference="AAAAAAAAAAAA"
        deliver-before-timestamp="2013-09-31T13:30:00Z"
        ppg-notify-requested-to="notify_url_path">
    <address address-value="PIN00001"/>
    <address address-value="PIN00001"/>
    <quality-of-service delivery-method="confirmed"/>
  </push-message>
</pap>

--PMasdfglkjhqwert
Content-Encoding: binary
Content-Type: text/html

// Text or binary content to be delivered to BlackBerry device goes here.

 --PMasdfglkjhqwert–-

Using any of the programming languages that you are familiar with, you can submit an HTTP POST with the URL that you created. The following code sample illustrates how you can submit the push request in JavaScript:

var url = https://cp<CPID>.<HOST>/<PATH> <Authorization_Header><PAP_Message>
var xmlhttp = new XMLHttpRequest();

Xmlhttp.open(‘POST’,url, true);

After you submit the POST request to the PPG, it sends a push request response in PAP format. You should parse the message programmatically and look for the response-result-code to ensure that the PPG accepted your push request.

Last modified: 2015-07-24



Got questions about leaving a comment? Get answers from our Disqus FAQ.

comments powered by Disqus