REST API Notifications

Managing Devices and Notifications with REST API

Welcome to the REST API documentation for managing devices and notifications in our system. This section provides comprehensive information on how to seamlessly register, unregister devices, send notifications, and retrieve essential device and notification details through our REST API.

Send Notifications / Basic

Send Bulk Notification

Following request is the minimal required parameters to send push notification.

curl -X POST \
-H "X-netmera-api-key: your_rest_api_key" \
-H "Content-Type: application/json" \
-d '{
  "message": {
    "title": "Push Notification Title",
    "platforms": ["IOS", "ANDROID"],
    "text": "This is the push notification text!"
  },
  "target": {
    "sendToAll": true
  }
}' \
https://restapi.netmera.com/rest/3.0/sendBulkNotification
Parameters
  • title (Required):

    • The campaign's name, aiding in the identification of notifications on the panel.

  • platforms (Required):

    • Specifies the platforms for push notification delivery.

  • text (Required):

    • The message content of the push notification displayed to the user.

  • target (Required):

    • The designated recipients for the push notification. If the sendToAll value is set to true, the notification will be dispatched to all users selected for the specified platform. For more intricate targeting options, refer to the advanced targeting section below.

curl -X POST \
-H "X-netmera-api-key: your_rest_api_key" \
-H "Content-Type: application/json" \
-d '{
    "message": {
        "title": "New Product Launch",
        "platforms": ["IOS", "ANDROID"],
        "text": "Exciting news! Our latest product is now available.",
        "ios": {
            "title": "Check it Out!"
        },
        "android": {
            "title": "Discover Now!"
        }
    },
    "target": {
        "sendToAll": true
    }
}' \
https://restapi.netmera.com/rest/3.0/sendBulkNotification
Parameters
  • title (Inside Message Block):

    • Provides the campaign name within the panel for organizational purposes.

  • title (Inside iOS and Android Blocks):

    • Returns the title specifically for the push notification on iOS and Android platforms. This allows customization of the notification title on different operating systems.

curl -X POST \
-H "X-netmera-api-key: your_rest_api_key" \
-H "Content-Type: application/json" \
-d '{
    "message": {
        "title": "New Product Launch",
        "platforms": ["IOS", "ANDROID"],
        "text": "Exciting news! Our latest product is now available.",
        "ios": {
            "title": "Check it Out!"
        },
        "android": {
            "title": "Discover Now!"
        }
    },
    "target": {
        "sendToAll": true
    }
}' \
https://restapi.netmera.com/rest/3.0/sendBulkNotification
curl -X POST \
-H "X-netmera-api-key: your_rest_api_key" \
-H "Content-Type: application/json" \
-d '{
  "platforms": ["ANDROID", "IOS"],
  "text": "Explore our Products",
  "message": "Check out our latest offerings!",
  "title": "Product Showcase",
  "click": {
    "url": "https://www.example.com/products"
  },
  "ios": {
    "title": "Discover on iOS",
    "carousel": [
      {
        "title": "Featured Product",
        "content": "Explore our flagship item.",
        "itemImageUrl": "https://example.com/images/product1.jpg",
        "clickAction": {
          "action": "DEEP_LINK",
          "url": "https://www.example.com/products/featured",
          "deeplinkType": "URL",
          "deepLinkUrl": "https://example.com/deeplink/featured"
        }
      },
      {
        "title": "New Arrival",
        "content": "Check out the latest addition to our collection.",
        "itemImageUrl": "https://example.com/images/newarrival.jpg"
      }
    ]
  },
  "android": {
    "title": "Discover on Android",
    "carousel": [
      {
        "title": "Special Offer",
        "content": "Do not miss out on our exclusive discount.",
        "itemImageUrl": "https://example.com/images/specialoffer.jpg"
      },
      {
        "title": "Top Picks",
        "content": "Explore our curated selection of top products.",
        "itemImageUrl": "https://example.com/images/toppicks.jpg",
        "clickAction": {
          "action": "DEEP_LINK",
          "url": "https://www.example.com/products/toppicks",
          "deeplinkType": "URL",
          "deepLinkUrl": "https://example.com/deeplink/toppicks"
        }
      }
    ]
  }
}' \
https://restapi.netmera.com/rest/3.0/sendBulkNotification

Send Bulk / Slider Push

curl -X POST \
-H "X-netmera-api-key: your_rest_api_key" \
-H "Content-Type: application/json" \
-d '{
  "platforms": ["ANDROID", "IOS"],
  "text": "Exciting News!",
  "message": "Check out the latest updates.",
  "title": "New Features Alert",
  "click": {
    "deeplink": "https://www.example.com"
  },
  "ios": {
    "title": "iOS Version",
    "slider": [
      {
        "itemImageUrl": "https://example.com/ios_image1.png",
        "clickAction": {
          "url": "https://www.example.com"
        }
      },
      {
        "itemImageUrl": "https://example.com/ios_image2.png"
      }
    ]
  },
  "android": {
    "title": "Android Update",
    "slider": [
      {
        "itemImageUrl": "https://example.com/android_image1.png",
        "clickAction": {
          "url": "https://www.example.com"
        }
      },
      {
        "itemImageUrl": "https://example.com/android_image2.png"
      }
    ]
  }
}' \
https://restapi.netmera.com/rest/3.0/sendBulkNotification
Parameters
  • Given:

    • Creation of a push to be sent via the Send bulk notification service via Postman

When:

  • Label information is added to the message.

  • Then:

    • The push notification is sent.

  • And:

    • Confirmation is observed as the label field appears in the push report generated on the panel.

Send Bulk with Multilanguage

curl -X POST \
-H "X-netmera-api-key: your_rest_api_key" \
-H "Content-Type: application/json" \
-d '{
    "message": {
        "title": "New Update Available",
        "platforms": ["IOS", "ANDROID"],
        "text": "Explore exciting features in the latest update!",
        "customJson": {
            "key1": "value1"
        },
        "click": {
            "deeplink": "https://www.netmera.com"
        }
    },
    "languages": {
        "English": {
            "title": "New Features",
            "text": "Discover what is new in this update.",
            "click": {
                "deeplink": "https://www.netmera.com"
            }
        },
        "Turkish": {
            "title": "Yeni Özellikler",
            "text": "Bu güncellemede neler yeni öğrenin.",
            "click": {
                "deeplink": "https://www.netmera.com"
            }
        }
    },
    "target": {
        "sendToAll": true
    }
}' \
https://restapi.netmera.com/rest/3.0/sendBulkNotification

Web Push / Send Bulk Notification

curl -X POST \
-H "X-netmera-api-key: your_rest_api_key" \
-H "Content-Type: application/json" \
-d '{
    "message": {
        "title": "Important Update",
        // If platforms contains Chrome or Firefox then iconUrl must exist
        "platforms": ["CHROME", "MACOS", "FIREFOX"],
        "text": "Please review the latest changes.",
        "wpChromeImage": "<image-url>",
        "interactionRequired": true,
        "click": {
            "url": "https://www.netmera.com"
        },
        "iconUrl": "<icon-url>"
    },
    "target": {
        "sendToAll": true
    }
}' \
https://restapi.netmera.com/rest/3.0/sendBulkNotification
Parameters
  • title (Required):

    • The name of the campaign, aiding in the identification of notifications on the panel.

  • text (Required):

    • The push notification message displayed to the user.

  • wpChromeImage:

    • For Windows Chrome and Firefox users, this parameter specifies the URL of the image to be displayed in the notification. The URL must begin with "https."

  • iconUrl:

    • Required if the platforms include Chrome or Firefox. Specifies the URL for the icon associated with the notification.

  • interactionRequired:

    • A boolean indicating whether the notification should persist until the user interacts with it, either by clicking or dismissing. The default value is false.

Web Push / Send Bulk with Custom Button

Warning:

  • It is crucial to create buttons initially in the panel under Settings > Button Sets.

  • Note that the "Button Name" is not mandatory.

For platform-specific deliveries, kindly specify separately for the desired browsers, including FIREFOX, EDGE, MACOS, and CHROME. This ensures accurate and tailored delivery based on the user's browser environment.

curl -X POST \
-H "X-netmera-api-key: your_rest_api_key" \
-H "Content-Type: application/json" \
-d '{
    "message": {
        "title": "New Features Announcement",
        "platforms": ["CHROME"],
        "text": "Exciting updates just for you!",
        "iconUrl": "https://netmera.com/img/cropped_logo.png",
        "buttonSet": { 
            "id" : 1,  // id: $buttonSetId
            "Yes" : "https://netmera.com/yes-feedback",  // $buttonSetName: $actionurl
            "No" : "https://netmera.com/no-feedback" // $buttonSetName: $actionurl
        }
    },
    "target": {
        "sendToAll": true
    }
}' \
https://restapi.netmera.com/rest/3.0/sendBulkNotification

Mobile Push / Send Bulk with Custom Button

Warning:

  • It is crucial to create buttons initially in the panel under Settings > Button Sets.

  • Note that the "Button Name" is not mandatory.

For platform-specific deliveries, kindly specify separately for the desired browsers, including FIREFOX, EDGE, MACOS, and CHROME. This ensures accurate and tailored delivery based on the user's browser environment.

curl -X POST \
-H "X-netmera-api-key: your_rest_api_key" \
-H "Content-Type: application/json" \
-d '{
    "message": { 
        "title": "New Offer Alert",
        "platforms": ["ANDROID"],
        "text": "Exciting deals await you!",
        "buttonSet": {
            "id" : 1,  // id: $buttonSetId
            "Yes" : "https://netmera.com/yes-feedback",  // $buttonSetName: $actionurl
            "No" : "https://netmera.com/no-feedback" // $buttonSetName: $actionurl
        }
    },
    "target": {
        "sendToAll": true
    }
}' \
https://restapi.netmera.com/rest/3.0/sendBulkNotification

Send Transactional Notification

Transactional notifications refer to pre-configured messages from the panel that can be specifically sent to individual users.

Maximum 1000 Unique External IDs or Device Tokens in a Single REST API Request:

When initiating a request, it's crucial to note that a maximum of 1000 unique external IDs or Device Tokens can be included in a single REST API Request. This limitation ensures the efficiency and proper handling of requests. If there are more than 1000 different external IDs or Device Tokens, it is necessary to distribute them across multiple requests. This approach is designed to uphold the performance and reliability of the API.

Custom Parameter Overwrite Risk:

If a custom parameter is provided in the request and differs from the parameter existing in the panel, it will overwrite the pre-existing parameter. This emphasizes the importance of alignment between the provided custom parameters and those configured in the panel to avoid unintended parameter overwrites.

Single Request:

curl -X POST \
-H "X-netmera-api-key: your_rest_api_key" \
-H "Content-Type: application/json" \
-d '{
    "notificationKey": "106",
    "message": {
        "params": {
            "name": "John Doe"
        }
    },
    "target": {
        "extId": "user_id_in_your_system"
    }
}' \
https://restapi.netmera.com/rest/3.0/sendNotification

Single Request with Device Token:

curl -X POST \
-H "X-netmera-api-key: your_rest_api_key" \
-H "Content-Type: application/json" \
-d '{
    "notificationKey": "106",
    "message": {
        "params": {
            "name": "John Doe"
        }
    },
    "target": {
        "deviceToken": "APAaxpo02......12pxa"
    }
}' \
https://restapi.netmera.com/rest/3.0/sendNotification
Parameters
  • notificationKey (Required):

    • This is the key identifier for the specific notification intended for a user. The notification key is created and can be obtained from the panel.

  • target (Required):

    • Specifies the target user to whom the notification should be sent. For transactional notifications, this can be the external ID (extId), an identifier in your system previously associated with a specific user.

  • message.params (Optional):

    • Custom parameters for tailoring a notification to a specific user. In the case of transactional messages, the text can be customized for individual users. For instance, if you want to send a personalized message like "Hello John" or "Hello Mary," you can configure your message as "Hello @{name}" and include the "name" parameter in your transactional notification request. This allows dynamic content based on user-specific information.

In chunks (for different notifications or parameters):

curl -X POST \
-H "X-netmera-api-key: your_rest_api_key" \
-H "Content-Type: application/json" \
-d '[
    {
        "notificationKey": "106",
        "message": {
            "params": {
                "name": "John Doe"
            }
        },
        "target" : {
            "extId": "user_id_in_your_system_1"
        }
    },
    {
        "notificationKey": "107",
        "message": {
            "params": {
                "price": 25
            }
        },
        "target": {
            "extId": "user_id_in_your_system_2"
        }
    }
]' \
https://restapi.netmera.com/rest/3.0/sendNotification

In chunks with device token (for different notifications or parameters):

curl -X POST \
-H "X-netmera-api-key: your_rest_api_key" \
-H "Content-Type: application/json" \
-d '[
    {
        "notificationKey": "106",
        "message": {
            "params": {
                "name": "John Doe"
            }
        },
        "target" : {
            "deviceToken": "APAaxpo02......12pxa"
        }
    },
    {
        "notificationKey": "107",
        "message": {
            "params": {
                "price": 25
            }
        },
        "target": {
            "deviceToken": "APAaxpo02......21kde"
        }
    }
]' \
https://restapi.netmera.com/rest/3.0/sendNotification

In chunks (for the same notification and parameters):

curl -X POST \
-H "X-netmera-api-key: your_rest_api_key" \
-H "Content-Type: application/json" \
-d '{
    "notificationKey": "106",
    "message": {
        "params": {
            "name": "John Doe"
        }
    },
    "target": {
        "extId": ["user_id_in_your_system_1", "user_id_in_your_system_2"]
    }
}' \
https://restapi.netmera.com/rest/3.0/sendNotification

In chunks with device token (for the same notification and parameters):

curl -X POST \
-H "X-netmera-api-key: your_rest_api_key" \
-H "Content-Type: application/json" \
-d '{
    "notificationKey": "106",
    "message": {
        "params": {
            "name": "John Doe"
        }
    },
    "target": {
        "deviceToken": ["APAaxpo02......21kde", "APAaxpo02......32coa"]
    }
}' \
https://restapi.netmera.com/rest/3.0/sendNotification

Transactional Notification Definition

A transactional notification definition can be created either through the Netmera Panel or via a specific request.

curl -X POST \
-H "X-netmera-api-key: your_rest_api_key" \
-H "Content-Type: application/json" \
-d '{
    "title": "New Campaign",
    "message": "Exciting updates await you!",
    "personalizedMessage": "Explore now: @{message}",
    "inbox": false,
    "platforms": ["IOS", "ANDROID"],
    "click": {
        "deeplink": "https://www.google.com"
    },
    "ios": {
        "mediaUrl": "ios_media_url_here",
        "title": "New Feature Alert",
        "subtitle": "Discover what is new",
        "sound": "ios_sound",
        "thumbnailUrl" : "<ios-thumbnail-url>"
    },
    "android": {
        "mediaUrl": "android_media_url_here",
        "title": "New Feature Alert",
        "subtitle": "Discover what is new",
        "sound": "android_sound",
        "vibration": true,
        "bigText" : "Explore the latest features",
        "thumbnailUrl" : "<android-thumbnail-url>"
    },
    "hook" : {
        "name": "hook_name",
        "params": {
            "key1" : "val1",
            "key2" : "val2"
        }
    }
}' \
https://restapi.netmera.com/rest/3.0/createNotificationDefinition
Parameters
  • title (Inside Message Block):

    • When located within the message block, this parameter provides the campaign name within the panel, aiding in organizational identification.

  • title (Inside iOS and Android Blocks):

    • When placed inside the iOS and Android blocks, this parameter returns the title specifically for the push notification on the respective platforms. This allows customization of the notification title based on the user's device environment.

Transactional Notification Definition with Personalized Message & Subtext

curl -X POST \
-H "X-netmera-api-key: your_rest_api_key" \
-H "Content-Type: application/json" \
-d '{
    "title": "New Announcement",
    "message": "Discover our latest updates!",
    "personalizedMessage": "Explore now: @{message}",
    "personalizedSubText": "personalized subtext here : {email} ",
    "inbox": false,
    "labels" : "Apple",
    "platforms": ["IOS", "ANDROID"],
    "click": {
        "deeplink": "https://www.netmera.com"
    },
    "ios": {
        "mediaUrl": "ios_media_url_here",
        "title": "Exciting News",
        "subtitle": "Stay informed",
        "sound": "ios_sound",
        "thumbnailUrl" : "<ios-thumbnail-url>"
    },
    "android": {
        "mediaUrl": "android_media_url_here",
        "title": "Exciting News",
        "subtitle": "Stay informed",
        "sound": "android_sound",
        "vibration": true,
        "bigText" : "Explore the latest announcement",
        "thumbnailUrl" : "<android-thumbnail-url>"
    },
    "hook" : {
        "name": "hook_name",
        "params": {
            "key1" : "val1",
            "key2" : "val2"
        }
    }
}' \
https://restapi.netmera.com/rest/3.0/createNotificationDefinition
Parameters
  • title (Required):

    • Specifies the name of the campaign.

  • message (Required):

    • The default push notification message. If no personalized message is used, this message will be sent to users.

  • inbox (Optional):

    • A boolean value determining whether to display the push notification in the inbox.

  • platforms (Required):

    • Indicates the platforms capable of receiving this notification.

  • personalizedMessage (Optional):

    • If a user-specific message is to be sent, utilize the @{xxxx} placeholder. Placeholders can be profile attributes or sent via a transactional message call.

  • click (Optional):

    • Specifies the default push click action. This action can be overridden by a transactional message call.

  • ios (Optional):

    • Contains optional parameters specific to iOS.

  • android (Optional):

    • Holds optional parameters specific to Android.

  • hook (Optional):

    • Includes optional hook parameters. If no hook is to be attached, exclude the hook block from the request.

Parameters

Given: A push notification is created for users utilizing the "Create New Notification" service.

When: Label information is added to the message.

Then: The push notification is sent.

And: Confirmation is observed as the label field appears in the push report generated on the panel.

Sample Response:

{
    "notificationKey": 96
}
notificationKey

The notificationKey serves as the identifier for your message definition. This unique key is used when making a transactional message call, connecting the message to its predefined definition. Ensure to utilize this specific notificationKey to maintain coherence between your message definitions and transactional messages.

curl -X POST \
-H "X-netmera-api-key: your_rest_api_key" \
-H "Content-Type: application/json" \
-d '{
    "title": "Important Survey",
    "message": "We would love to hear your feedback!",
    "inbox": false,
    "platforms": ["IOS", "ANDROID"],
    "click": {
        "deeplink": "https://www.netmera.com"
    },
    "buttonSet": {
        "id" : 1,
        "Yes" : "https://netmera.com/yes-feedback",
        "No" : "https://netmera.com/no-feedback"
    }
}' \
https://restapi.netmera.com/rest/3.0/createNotificationDefinition
curl -X POST \
-H "X-netmera-api-key: your_rest_api_key" \
-H "Content-Type: application/json" \
-d '{
  "platforms": [
    "ANDROID",
    "IOS"
  ],
  "text": "Exciting Image Slider Test",
  "message": "Check out our amazing image slider!",
  "title": "Image Slider Test",
  "click": {
    "deeplink": "https://www.netmera.com"
  },
  "ios": {
    "title": "iOS Image Slider Test",
    "slider": [
      {
        "itemImageUrl": "https://example.com/ios-image1.png",
        "clickAction": {
          "url": "https://www.netmera.com"
        }
      },
      {
        "itemImageUrl": "https://example.com/ios-image2.png"
      }
    ]
  },
  "android": {
    "title": "Android Image Slider Test",
    "slider": [
      {
        "itemImageUrl": "https://example.com/android-image1.png",
        "clickAction": {
          "url": "https://www.netmera.com"
        }
      },
      {
        "itemImageUrl": "https://example.com/android-image2.png"
      }
    ]
  }
}' \
https://restapi.netmera.com/rest/3.0/createNotificationDefinition

Transactional Notification Definition / Slider Push

curl -X POST \
-H "X-netmera-api-key: your_rest_api_key" \
-H "Content-Type: application/json" \
-d '{
  "message": {
    "platforms": [
      "ANDROID",
      "IOS"
    ],
    "text": "Exciting announcement! New features are now available.",
    "message": "Check out the latest updates.",
    "title": "New Features Alert",
    "click": {
      "deeplink": "https://www.netmera.com"
    },
    "ios": {
      "title": "Discover on iOS",
      "slider": [
        {
          "itemImageUrl": "https://example.com/ios-image1.png",
          "clickAction": {
            "url": "https://www.netmera.com"
          }
        },
        {
          "itemImageUrl": "https://example.com/ios-image2.png"
        }
      ]
    },
    "android": {
      "title": "Explore on Android",
      "slider": [
        {
          "itemImageUrl": "https://example.com/android-image1.png",
          "clickAction": {
            "url": "https://www.netmera.com"
          }
        },
        {
          "itemImageUrl": "https://example.com/android-image2.png"
        }
      ]
    }
  }
}' \
https://restapi.netmera.com/rest/3.0/createNotificationDefinition

Push Stats

Get Push Stats By Notification Key

With the following request, you can reach the stats of a notification.

curl -X GET \
-H "X-netmera-api-key: your_rest_api_key" \
-G \
--data-urlencode notificationKey=234 \
'https://restapi.netmera.com/rest/3.0/getPushStats'
Parameters
  • notificationKey (Required):

    • This is the notification key associated with a particular message for which you want to retrieve statistics. It is a required parameter and plays a crucial role in identifying the specific message for which you seek statistical information.

Sample response:

{
    "notificationKey": 234,
    "status": "FINISHED",
    "startDate": 1504790916883,
    "endDate": 1504790916917,
    "stats": [
        {
            "platform": "IOS",
            "sent": 100,
            "failed": 5,
            "clicked": 35
        },
        {
            "platform": "ANDROID",
            "sent": 300,
            "failed": 25,
            "clicked": 98
        },
        {
            "platform": "WP",
            "sent": 30,
            "failed": 1,
            "clicked": 23
        }
    ]
}

Get Push Stats By Date Range

With the following request, you can reach the stats of a notification.

curl -X GET \
-H "X-netmera-api-key: your_rest_api_key" \
-G \
--data-urlencode start=1501132423424 \
--data-urlencode end=150122342432 \
'https://restapi.netmera.com/rest/3.0/getPushStats'
Parameters
  • start (Required):

    • The start date, specified in milliseconds, is a required parameter. It determines the beginning of the time range for which you want to retrieve data.

  • end (Required):

    • The end date, also specified in milliseconds, is a required parameter. It marks the conclusion of the time range for which you want to obtain data.

Sample response:

{
    "messages": [
        {
            "status": "FINISHED",
            "stats": [
                {
                    "platform": "IOS",
                    "sent": 6,
                    "failed": 0,
                    "clicked": 0
                },
                {
                    "platform": "ANDROID",
                    "sent": 0,
                    "failed": 0,
                    "clicked": 0
                }
            ],
            "startDate": 1504790916883,
            "endDate": 1504790916917,
            "notificationKey": 749
        },
        {
            "status": "SENDING",
            "stats": [
                {
                    "platform": "IOS",
                    "sent": 1,
                    "failed": 0,
                    "clicked": 1
                },
                {
                    "platform": "ANDROID",
                    "sent": 0,
                    "failed": 0,
                    "clicked": 0
                }
            ],
            "startDate": 1504790402907,
            "endDate": 1504790402909,
            "notificationKey": 748
        }
    ]
}

Get Push Result

To retrieve users' push results (success or failure), use the following request. If start and end dates are not specified, the results for the last 2 weeks will be returned.

curl -X GET \
-H "X-netmera-api-key: your_rest_api_key" \
-G \
--data-urlencode max=10 \
--data-urlencode notificationKey=106 \
--data-urlencode extId=B4A92950-B0FD-43E6-B312-C3EE088890BD \
--data-urlencode start=1557892331000 \
--data-urlencode end=1557892431000 \
--data-urlencode token=cKuWDH0ZOw4:APA91bEduwC4_FWB5i-isvsSbNO5Dglxg7Wstd8dOI8k8MgP-M2IryebG0PRctVzJ5vkkhDLh3QDEorv6-CfYvvO-rmCMjoUOI_unL3kvQOfi9op_JBzBzwNXGGzwfMLpVSAdYi6xNwn \
'https://restapi.netmera.com/rest/3.0/getPushResult'
Parameters
  • start (Optional):

    • Start date in milliseconds. If provided, it sets the beginning of the time range for retrieving results.

  • end (Optional):

    • End date in milliseconds. If provided, it marks the conclusion of the time range for retrieving results.

  • notificationKey (Optional):

    • Notification ID on the panel. If specified, it filters results based on the given notification.

  • extId (Optional):

    • External ID for obtaining message results of a specific user. If provided, it narrows down the results to the specified user.

  • token (Optional):

    • Device token for acquiring message results of a specific device. If included, it restricts the results to the specified device.

Sample response:

{
    "nextPage": "https://restapi.netmera.com/rest/3.0/getPushResult?offset=hJbolUuHucJ9dd&max=10",
    "list": [
        {
            "platform": "IOS",
            "status": "FAILED",
            "errorCode": "8",
            "installationId": "C2Ii2ztdEaok0",
            "errorMsg": "INVALID_TOKEN",
            "timeStamp": 1557819194426,
            "msgTitle": "Awesome Title",
            "msgText": "How is it going, Jon?"
        },
        {
            "platform": "ANDROID",
            "status": "SUCCESS",
            "installationId": "U7IwgcM8phSmv",
            "extId": "B4A92950-B0FD-43E6-B312-C3EE088890BD",
            "timeStamp": 1557819194426,
            "msgTitle": "Awesome Title",
            "msgText": "How is it going, Jon?"
        }
        // ... Additional entries
    ]
}
Parameters
  • notificationKey (Required):

    • Notification key of a message to obtain users' responses. This is a required parameter that identifies the specific message for which you want to retrieve user responses.

  • max (Optional):

    • The default value is 10. This parameter determines the maximum number of result info to fetch per page. It is optional, and if not specified, the default value of 10 will be used.

  • Next Page Retrieval:

  • To fetch the next page of results, you need to send a request to the nextPage value. This mechanism enables the retrieval of additional information beyond the initial page.

curl -X GET \
-H "X-netmera-api-key: your_rest_api_key" \
'https://restapi.netmera.com/rest/3.0/getPushResult?offset=hJbolUuHucJ9dd&max=10'

SMS and Email Notification Key Details:

When you provide the notification key for SMS and email notifications made before, it returns the success and failure details for each individual email or SMS sent.

Example for Email:

curl -X POST \
-H "X-netmera-api-key: your_rest_api_key" \
-H "Content-Type: application/json" \
-d '{
    "target": {
        "email": "target_email@example.com"
    },
    "platforms": [
        "EMAIL"
    ],
    "title": "Your Account is Created",
    "message": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"><html><head></head><body esd-custom-display-conditions=\"[]\"><p class=\"esd-text\">HELLO<br>SPACE<br></p></body></html>",
    "from": "info@netmera.com",
    "senderName": "Netmera",
    "subject": "Your Account is Created"
}' \
https://restapi.netmera.com/rest/3.0/sendEmailAndSms

Example for SMS:

curl -X POST \
-H "X-netmera-api-key: your_rest_api_key" \
-H "Content-Type: application/json" \
-d '{
    "target": {
        "msisdn": "target_msisdn"
    },
    "platforms": [
        "SMS"
    ],
    "title": "Account Notification",
    "message": "Your recent account activity: message",
    "smsHeader": "NETMERA"
}' \
https://restapi.netmera.com/rest/3.0/sendEmailAndSms

Send Notification to Custom Target

To send a notification to a specific group of people, whether categorized by tags, segments, location, or profile attributes, follow these guidelines:

  • Target Specification:

    • You must define a specific target (tag, segment, location, or profile attribute) for the notification.

  • Note:

    • Leaving the target empty is not allowed. If you intend to send a notification to all users, set the sendToAll attribute to true. This attribute ensures the notification is broadcasted to all users.

Send Notification to Tag

curl -X POST \
-H "X-netmera-api-key: your_rest_api_key" \
-H "Content-Type: application/json" \
-d '{
    "message" : {
        "title" : "Sports Update",
        "platforms" : ["IOS", "ANDROID"],
        "text" : "Get the latest sports news and updates!"
    },
    "target" : {
        "tag" : "Sport"
    }
}' \
https://restapi.netmera.com/rest/3.0/sendBulkNotification

Send Notification to Multiple Tags

curl -X POST \
-H "X-netmera-api-key: your_rest_api_key" \
-H "Content-Type: application/json" \
-d '{
    "message" : {
        "title" : "Updates for You",
        "platforms" : ["IOS", "ANDROID"],
        "text" : "Check out the latest updates tailored for your interests!"
    },
    "target" : {
        "tag" : ["Sport", "Casual"]
    }
}' \
https://restapi.netmera.com/rest/3.0/sendBulkNotification

Users with any of the given tags will receive notification.

This is similar to:

curl -X POST \
-H "X-netmera-api-key: your_rest_api_key" \
-H "Content-Type: application/json" \
-d '{
    "message" : {
        "title" : "Personalized Updates",
        "platforms" : ["IOS", "ANDROID"],
        "text" : "Stay tuned for personalized updates tailored just for you!"
    },
    "target" : {
        "tag" : {"$or" : ["Sport", "Casual"]}
    }
}' \
https://restapi.netmera.com/rest/3.0/sendBulkNotification

If you use $and instead of $or, users with all of the given tags will receive notification.

curl -X POST \
-H "X-netmera-api-key: your_rest_api_key" \
-H "Content-Type: application/json" \
-d '{
    "message" : {
        "title" : "Exclusive Sports & Casual Updates",
        "platforms" : ["IOS", "ANDROID"],
        "text" : "Explore the latest updates in sports and casual topics just for you!"
    },
    "target" : {
        "tag" : {"$and" : ["Sport", "Casual"]}
    }