- 16 Feb 2024
- 4 Minutes to read
Send Advanced App Pushes
- Updated on 16 Feb 2024
- 4 Minutes to read
Overview
You can use this endpoint in various cases such as sending status update of an order from your ecommerce platform, or informing users of a sale on an item that was in their wishlist.
You can reach the analytics of your advanced push notifications sent via this API through Reports > Mobile App Analytics > Push API Campaigns on Inone.
Endpoint and Headers
Headers
Header | Sample Value | Description |
---|---|---|
Content-Type | application/json | This header specifies the media type of the resource. |
Body Parameters
Parameter | Description | Data Type | Required |
---|---|---|---|
api_key | Your API key. Refer to API Authentication Tokens to get your API key. | String | Yes |
report_attributes | Contains information of the users who have been notified. This information is displayed on request. | Array | No |
notifications | The array of notification object that includes the push data | Array | Yes |
identifiers | The object that contains the unique identifier of the user. The key can be an identifier such as email, phone_number or uuid. E.g. "phone_number": "+651234567890". | Object | Yes |
advanced_push_payload | Payload details for advanced push | Object | Yes |
advanced_push_type | Type of the advanced push | String | Yes |
advanced_push_items | Details of the advanced push | Array | Yes |
image_url | URL of the image in rich push notifications | String | Yes |
deep_links | Key/value pairs to be passed to the application in the push payload. The most common use of deep links is sending the user to the selected landing page when they open the push notification. | Object | No |
description | Description for your item | String | Yes |
headline | Title for your item | String | Yes |
id | ID of your item | Integer | Yes |
camp_id | ID of the campaign that can be used to retrieve the statistics of the push notification via Statistics API. | Integer | Yes |
camp_name | Name of the push notification | String | Yes |
title | Title of the push notification | String | Yes |
message | Content of the push notification | String | Yes |
image_url | URL of the image in rich push notifications | String | Yes |
ttl | Expiration time of the push notification in seconds | Integer | No |
check_optin | true shows the optin delivery count information in the API response. false does not show the count. | Boolean | No |
android | Object for Android details | Object | No |
ios | Object for iOS details | Object | No |
thread-id | ID of the notification thread | Integer | No |
badge | Badge for iOS | Integer | No |
deliver_silently | (iOS only) true sends the notifications with content--available=1 but notification does not show up. This can be used to execute background tasks remotely. | Boolean | No |
sound | Custom sound name for iOS | String | No |
deep_link | Key/value pairs to be passed to the application in the push payload. The most common use of deep links is sending the user to the selected landing page when they open the push notification. | Object | No |
To add key-value pairs to the deep_link object, you can use the following deep link keys depending on its type:
- ins_dl_internal for an internal deep link,
- ins_dl_external for an external deep link,
- ins_dl_url_scheme for a URL scheme deep link,
- ins_dl_json for a JSON deep link.
The URL in the value should always start with https://.
Sample Example
Sample Body
The following is a sample body to send advanced app push notifications.
App push notifications are sent to a user's last active device.
{
"api_key": "Your API Key goes here",
"report_attributes": [
"INSIDER.carrier",
"INSIDER.idfa",
"INSIDER.name",
"INSIDER.surname",
"INSIDER.gender",
"INSIDER.age",
"INSIDER.birthday",
"INSIDER.email",
"INSIDER.phone_number",
"INSIDER.language",
"INSIDER.email_optin",
"INSIDER.sms_optin",
"INSIDER.push_optin",
"INSIDER.location_optin",
"INSIDER.insider_id",
"INSIDER.environment",
"INSIDER.idfa",
"INSIDER.device_token",
"INSIDER.udid",
"INSIDER.model",
"INSIDER.carrier",
"INSIDER.app_version",
"INSIDER.os_version",
"INSIDER.screen_width",
"INSIDER.screen_height",
"INSIDER.platform",
"INSIDER.timezone",
"INSIDER.device_language",
"INSIDER.sdk_version",
"INSIDER.last_ip",
"INSIDER.package_name"
],
"notifications": [
{
"identifiers": {
"INSIDER.email": "example@gmail.com",
"INSIDER.phone_number": "+9059713551597135123",
"INSIDER.uuid": "5971351231234567"
},
"advanced_push_payload": {
"advanced_push_type": "carousel",
"advanced_push_items": [
{
"image_url": "https://your_image_url.jpg",
"deep_links": {
"your_deeplink_key": "value1"
},
"description": "Description for the item 1",
"headline": "Title for the item 1",
"id": 1
},
{
"image_url": "https://your_image_url.jpg",
"deep_links": {
"your_deeplink_key": "value2"
},
"description": "Description for the item 2",
"headline": "Title for the item 2",
"id": 2
},
{
"image_url": "https://your_image_url.jpg",
"deep_links": {
"your_deeplink_key": "value3"
},
"description": "Description for the item 3",
"headline": "Title for the item 3",
"id": 3
}
]
},
"camp_id": 1,
"camp_name": "Your push notification campaign name goes here",
"title": "Your push notification title goes here",
"message": "Your push content goes here",
"image_url": "https://your_image_url.jpg",
"ttl": 1,
"check_optin": true,
"android": {
"thread-id": 1,
"sound": "sound_check",
"deep_link": {
"ins_dl_internal": "https://www.deeplink.useinsider"
}
},
"ios": {
"thread-id": 13,
"badge": 1,
"deliver_silently": true,
"mutable-content": true,
"sound": "sound_check",
"content-available": true,
"deep_link": {
"ins_dl_internal": "https://www.deeplink.useinsider"
}
}
}
]
}
Sample Responses
200 OK
{
"successes": [
{
"INSIDER.carrier": "Mybrand",
"INSIDER.device_token": "1a2b3c4d5e6f",
"INSIDER.email": "sample@mail.com",
"INSIDER.phone_number": "+651234567891",
}
},
"errors": {
"NoUserFound": [
{
"INSIDER.email": "sample2@mail.com"
}
]
}
}
There might be cases where the request returns a 200 response but the app pushes cannot be sent to users. The following list displays the reasons for these cases.
noUserErr | "NoUserFound" |
optOutErr | "OptOut" |
unregisteredErr | "Unregistered" |
userGloballyCappedErr | "UserGloballyCapped" |
userGloballyCappedForInappErr | "UserGloballyCappedForInapp" |
invalidCertificateErr | "InvalidCertificate" |
400 Bad Request
The following response returns if the payload is invalid.
{
"error": "invalid_payload"
"message": "Can't parse payload, check your keys and data types"
}
400 Bad Request
The following response returns if the notifications array is empty.
{
"error": "invalid_notifications",
"message": "'notifications' is empty, add some notification objects"
}
400 Bad Request
The following response returns if the array has more than 20 objects.
{
"error": "invalid_notifications",
"message": "'notifications' can't have more than 20 objects"
}
400 Bad Request
The following response returns if the deep link is blacklisted.
{
"error": "blacklisted_deeplink",
"message": "deepLink can't contain 'aps' key"
}
400 Bad Request
The following response returns if the camp ID or channel ID is a negative integer.
{
"error": "negative_integer",
"message": "camp_id' and/or 'channel_id' must be greater than zero"
}
400 Bad Request
The following response returns if the advanced push type is invalid.
{
"error": "invalid_advanced_push_type",
"message": "'advanced_push_type' must be either Carousel or Slider"
}
400 Bad Request
The following response returns if the certificate is invalid.
{
"error": "invalid_certificate",
"message": "You do not have a validated certificate. Please check Certificate section under Insider's Settings."
}
500 Internal Server Error
Insider API services might temporarily be unavailable. Try again.
Limitations
- All functions must be executed with a simple HTTPS POST request.
- The API key should be provided in the request body. If the key is incorrect, no operation will be executed.
- Each request can send a maximum of 20 advanced_push_items arrays.
- For security reasons, Insider does not allow you to target more than 20 devices per target.
- You must complete the identifier integration with Insider SDK's user object for your platforms. See Android, iOS, React Native, Flutter, and Cordova for further details.
- The camp ID value should be greater than 0.
- The preferred_type value can be slider or carousel.
- The Android channel ID value should be greater than 0.