Push Sample Requests


Recipient ("to") Address Format

Using contact as recipient

"to": "contact:MtvI9VNHFpTC6hiBJOXPm"

Using contact group as recipients "to": "group:JghtypeokhiBJOXPmTREUxc"
Using device token along with application ID

"to": "push:etSsTpXCSCGdOMc6AHtb7e:APA91bGeJk7hwCPfcir5ynmKiMSplJcpEwy0y

kOYv86ocFhTJzav37ZCILAFEvaTDHs

eHUFbJD751r8tozRmAHHQKy-smZVjrXG2QCT5me3gOsqClqn_11JGXBGvEXOCmh

BjkrRYo8v-@scg-push-msg-for-demo-apps@FCM"

 

"to": "push:etSsTpXCSCGdOMc6AHtb7e:APA91bGeJk7hwCPfcir5ynmKiMSplJcpEwy0y

kOYv86ocFhTJzav37ZCILAFEvaTDHs

eHUFbJD751r8tozRmAHHQKy-smZVjrXG2QCT5me3gOsqClqn_11JGXBGvEXOCmh

BjkrRYo8v-@scg-push-msg-for-demo-apps@APN"

 

Using device token

"to": "psh:fcm@x7kYRtLG8MVwV8igNzOnv6@etSsTpXCSCGdOMc6AHtb7e:APA91bGeJk7

hwCPfcir5ynmKiMSplJcpEwy0ykOYv86ocFhTJzav37ZCILAFEvaTDHseHUFbJD751r8tozRm

AHHQKy-smZVjrXG2QCT5me3gOsqClqn_11JGXBGvEXOCmhBjkrRYo8v-"

 

"to": "psh:apn@x7kYRtLG8MVwV8igNzOnv6@etSsTpXCSCGdOMc6AHtb7e:APA91bGeJk7hw

CPfcir5ynmKiMSplJcpEwy0ykOYv86ocFhTJzav37ZCILAFEvaTDHseHUFbJD751r8tozRmAHHQ

Ky-smZVjrXG2QCT5me3gOsqClqn_11JGXBGvEXOCmhBjkrRYo8v-

Group of recipients

"to": [

[

"contact:MtvI9VNHFpTC6hiBJOXPm",  

"push:etSsTpXCSCGdOMc6AHtb7e:APA91bGeJk7hwCPfcir5ynmKiMSplJcpEwy0ykOYv86ocFhT

Jzav37ZCILAFEvaTDHseHUFbJD751r8tozRmAHHQKy-smZVjrXG2QCT5me3gOsqClqn_11JGXB

GvEXOCmhBjkrRYo8v-@scg-push-msg-for-demo-apps@FCM",

"psh:fcm@x7kYRtLG8MVwV8igNzOnv6@etSsTpXCSCGdOMc6AHtb7e:APA91bGeJk7hwCPfcir5

ynmKiMSplJcpEwy0ykOYv86ocFhTJzavUFbJD751r8tozRmAHHQKy-smZVjrXG2QCT5me3gOsqCl

qn_11JGXBGvEXOCmhBjkrRYo8v-"

]

 

 

Push Notification Types

 

Use Case API Sample  Behavior

Send OS push notification

curl --location --request POST 

'http://api.syniverse.com/scg-external-api/api/v1/messaging/messages' \
--header 'Authorization: Bearer XXX' \
--header 'Content-Type: application/json' \
--data-raw '{
    "to": "contact:MtvI9VNHFpTC6hiBJOXPm",
    "body": "This is a test message for an alert notification.",
    "options": {
        "push:notify_type": "os",
    },
    "from": "sender_id:x7kYRtLG8MVwV8igNzOnv6"
}'

Notification will be recieved and processed by the device OS. Push notifications of type "os" will be delivered to the phone even if the mobile application is not open to recieve it.

Send in-app push notification

curl --location --request POST 

'http://api.syniverse.com/scg-external-api/api/v1/messaging/messages' \
--header 'Authorization: Bearer XXX' \
--header 'Content-Type: application/json' \
--data-raw '{
    "to": "contact:MtvI9VNHFpTC6hiBJOXPm",
    "body": "This is a test message for an app notification.",
    "options": {
        "push:notify_type": "app",
    },
    "from": "sender_id:x7kYRtLG8MVwV8igNzOnv6"
}'

Notification will be recieved within the application.

Send silent push notification

 

curl --location --request POST 

'http://api.syniverse.com/scg-external-api/api/v1/messaging/messages' \
--header 'Authorization: Bearer XXX' \
--header 'Content-Type: application/json' \
--data-raw '{
    "to": "contact:MtvI9VNHFpTC6hiBJOXPm",
    "body": "This is a test message for a silent notification.",
    "options": {
        "push:notify_type": "silent",
    },
    "from": "sender_id:x7kYRtLG8MVwV8igNzOnv6"
}'

No notification in device notification area, content goes to the Inbox.

 

Badge Management

Use Case API Sample Behavior

Use auto badge increment

curl --location --request POST 

'http://api.syniverse.com/scg-external-api/api/v1/messaging/messages' \
--header 'Authorization: Bearer XXX' \
--header 'Content-Type: application/json' \
--data-raw '{
    "to": "contact:MtvI9VNHFpTC6hiBJOXPm",
    "body": "This is a test message for a silent notification.",
    "options": {
        "push:notify_type": "silent",
        "push:badge":"auto",
     },
    "from": "sender_id:x7kYRtLG8MVwV8igNzOnv6"
}'

The badge count will be automatically incremented by 1.

  • auto tells the os to calculate number which should be delivered to the app.

Specify badge value to be set

curl --location --request POST 

'http://api.syniverse.com/scg-external-api/api/v1/messaging/messages' \
--header 'Authorization: Bearer XXX' \
--header 'Content-Type: application/json' \
--data-raw '{
    "to": "contact:MtvI9VNHFpTC6hiBJOXPm",
    "body": "This is a test message for a silent notification.",
    "options": {
        "push:notify_type": "silent",
        "push:badge":"19",
    },
    "from": "sender_id:x7kYRtLG8MVwV8igNzOnv6"
}'

The badge count will be set to the number specified.

  • Badge count <= 0 will reset the current badge count i.e. no marker will be displayed.
  • on iOS a marker with specified number is displayed on app icon
  • on Android an empty circle marker is displayed on the app icon.

 

Sound Management

Use Case API Sample Behavior

Use default sound

curl --location --request POST 

'http://api.syniverse.com/scg-external-api/api/v1/messaging/messages' \
--header 'Authorization: Bearer XXX' \
--header 'Content-Type: application/json' \
--data-raw '{
    "to": "contact:MtvI9VNHFpTC6hiBJOXPm",
    "body": "This is a test message for a os notification.",
    "options": {
        "push:notify_type": "os",
        "push:badge":"auto",
        "push:sound":"default"
        },
    "from": "sender_id:x7kYRtLG8MVwV8igNzOnv6"
}'

System sounds will be played upon receipt of push notification.

Use speicified sound file

curl --location --request POST 

'http://api.syniverse.com/scg-external-api/api/v1/messaging/messages' \
--header 'Authorization: Bearer XXX' \
--header 'Content-Type: application/json' \
--data-raw '{
    "to": "contact:MtvI9VNHFpTC6hiBJOXPm",
    "body": "This is a test message for an app notification.",
    "options": {
        "push:notify_type": "app",
        "push:badge":"auto",
        "push:sound":"sound/cat.wav"
        },
    "from": "sender_id:x7kYRtLG8MVwV8igNzOnv6"
}'

  • for Android - the name of the sound resource located in raw resource folder
  • for iOS - sound file path in your app’s main bundle or in the Library/Sounds folder of your app’s container directory

 

Media Attachments

Use Case API Sample Behavior

Pass an array orf media attachments

curl --location --request POST 

'http://api.syniverse.com/scg-external-api/api/v1/messaging/messages' \
--header 'Authorization: Bearer XXX' \
--header 'Content-Type: application/json' \
--data-raw '{
    "to": "contact:MtvI9VNHFpTC6hiBJOXPm",
    "body": "This is a test message for an app notification.",
    "options": {
        "push:notify_type": "app",
        "push:badge":"19",
        "push:sound":"default"
        },
    "from": "sender_id:x7kYRtLG8MVwV8igNzOnv6",

    "attachments": [
    "yuMaJjerR6W0R4JYGpetQ5",

    "dRqR9h7QjD8BV5kycyfpp7"
     ]

}'

The application will receive the attachment IDs and would have to download the same onto the device. 

 

Body Extensions

Use Case API Sample Behavior
Deep Links

curl --location --request POST 

'http://api.syniverse.com/scg-external-api/api/v1/messaging/messages' \
--header 'Authorization: Bearer XXX' \
--header 'Content-Type: application/json' \
--data-raw '{
    "to": "contact:MtvI9VNHFpTC6hiBJOXPm",
    "body": "This is a test message for an app notification.",
    "options": {
        "push:notify_type": "app",
        "push:badge":"19",
        "push:sound":"default"
        },
    "from": "sender_id:x7kYRtLG8MVwV8igNzOnv6",

    "body_extensions": [
    "type": "DEEP_LINK",

     content": "https://google.com/helloworld.html"
     ]

}'

Deep links are content URLs.
Application Data

curl --location --request POST 'http://api.syniverse.com/scg-external-api/api/v1/messaging/messages' \
--header 'Authorization: Bearer XXX' \
--header 'Content-Type: application/json' \
--data-raw '{
    "to": "contact:MtvI9VNHFpTC6hiBJOXPm",
    "body": "This is a test message for an app notification.",
    "options": {
        "push:notify_type": "app",
        "push:badge":"19",
        "push:sound":"default"
        },
    "from": "sender_id:x7kYRtLG8MVwV8igNzOnv6",

    "body_extensions": [
    "type": "APP_DATA",

     content": "app:data"
     ]

}'

Application data is passed as a string object for the application to interpret.

 

Refer to additional information available on the Syniverse Knowledge Base on how to pass additional application data for Apple Push Notifications (APN).