RegisterDevice

 

<?php
$url = "https://ws.pushapps.mobi/RemoteAPI/RegisterDevice";
                $data = array(
                      'SecretToken'      => 'XXXXXXXXXXX', ## Your app secret token
                      'PushToken'    => 'XXXXXXXXXXX', ## Device push token
                      'DeviceId'       => 'XXXXXXXXXXX', ## Device unique id
                      'DeviceType' => 2, ## Device type - 1 for Android or 2 for iOS
                      'OSVersion'      => '6.1.4', ## Optional, device OS version
                      'DeviceDescription' => 'iPhone5', ## Optional, device description
                      'AppVersion' => '1.0', ## Optional, app version
                );
        $content = json_encode($data);
        $curl = curl_init($url);
        curl_setopt($curl, CURLOPT_HEADER, false);
        curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($curl, CURLOPT_HTTPHEADER,
                array("Content-type: application/json"));
        curl_setopt($curl, CURLOPT_POST, true);
        curl_setopt($curl, CURLOPT_POSTFIELDS, $content);
        $json_response = curl_exec($curl);
        $status = curl_getinfo($curl, CURLINFO_HTTP_CODE);
        if ( $status != 200 ) {
            die("Error: call to URL $url failed with status $status, response $json_response, curl_error " . curl_error($curl) . ", curl_errno " . curl_errno($curl));
        }
        curl_close($curl);
                echo "Response: " . $json_response . "\n";
        ?>

 

UnregisterDevice

 

<?php
    $url = "https://ws.pushapps.mobi/RemoteAPI/UnregisterDevice";
    $data = array(
                  'SecretToken'      => 'XXXXXXXX', ## Your app secret token
                  'DeviceId'       => 'XXXXXXXX' ## Device id to unregister from app
                  );
    $content = json_encode($data);
    $curl = curl_init($url);
    curl_setopt($curl, CURLOPT_HEADER, false);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($curl, CURLOPT_HTTPHEADER,
                array("Content-type: application/json"));
    curl_setopt($curl, CURLOPT_POST, true);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $content);
    $json_response = curl_exec($curl);
    $status = curl_getinfo($curl, CURLINFO_HTTP_CODE);
    if ( $status != 200 ) {
        die("Error: call to URL $url failed with status $status, response $json_response, curl_error " . curl_error($curl) . ", curl_errno " . curl_errno($curl));
    }
    curl_close($curl);
    echo "Response: " . $json_response . "\n";
        ?>

 

CreateNotification

 

<?php
    $url = "https://ws.pushapps.mobi/RemoteAPI/CreateNotification";
    $data = array(
                  'SecretToken'      => 'XXXXXXXXXX', ## Your app secret token
                  'Message' => 'This is the content of the message', ## The message you want to send
                  'Platforms' => array(1, 2), ## Optional, platforms to send to, if empty will send to all configured platforms, will be overridden if Devices is        specified
                  'Devices' => array(array(
                                           'PushToken' => 'XXXXXXXX', ## Device push token
                                           'DeviceType' => 2
                                           )) ## Optional, array of devices to send, if empty will send to all registered users, or by Platforms if specified
                  );
    $content = json_encode($data);
    $curl = curl_init($url);
    curl_setopt($curl, CURLOPT_HEADER, false);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($curl, CURLOPT_HTTPHEADER,
                array("Content-type: application/json"));
    curl_setopt($curl, CURLOPT_POST, true);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $content);
    $json_response = curl_exec($curl);
    $status = curl_getinfo($curl, CURLINFO_HTTP_CODE);
    if ( $status != 200 ) {
        die("Error: call to URL $url failed with status $status, response $json_response, curl_error " . curl_error($curl) . ", curl_errno " . curl_errno($curl));
    }
    curl_close($curl);
    echo "Response: " . $json_response . "\n";
        ?>

GetDevices

<?php
$url = "https://ws.pushapps.mobi/RemoteAPI/GetDevices";
                $data = array(
                      'SecretToken'      => '########################', ## Your app secret token
                      'Amount'    => 100, ## amount of devices to retrieve
                      'Index'       => 1, ## index to start from, 1 based, so you can use this request with paging
                      'Platforms' => array(1, 2), ## Optional, if left empty then there is no filtering by platforms
                );
        $content = json_encode($data);
        $curl = curl_init($url);
        curl_setopt($curl, CURLOPT_HEADER, false);
        curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($curl, CURLOPT_HTTPHEADER,
                array("Content-type: application/json"));
        curl_setopt($curl, CURLOPT_POST, true);
        curl_setopt($curl, CURLOPT_POSTFIELDS, $content);
        $json_response = curl_exec($curl);
        $status = curl_getinfo($curl, CURLINFO_HTTP_CODE);
        if ( $status != 200 ) {
            die("Error: call to URL $url failed with status $status, response $json_response, curl_error " . curl_error($curl) . ", curl_errno " . curl_errno($curl));
        }
        curl_close($curl);
                echo "Response: " . $json_response . "\n";
        ?>