This is the PushAlert REST API documentation for Android App. Below, you will find the complete listing of all the available endpoints. As we add more endpoints, they will be documented here as well.
If you need help using the REST API or have any issues with its implementation, please send a mail to us at api@pushalert.co.
Delete abandoned cart notification on order completion or when cart is cleared.
Sending Notifications
POST /rest/v2/android-app/send
Using this endpoint you can send a notification to all subscribers. Subscribers can be targeted based on a particular Segment ID (endpoint) or using the Audience Creator ID. You can also personalize a notification with attributes.
Resource Information
Method
POST
URL
https://api.pushalert.co/rest/v2/android-app/send
Requires authentication?
Yes
Request Parameters
Parameter
Type
Description
title
String
Required This is the title of the notification. It's maximum length is restricted to 64 characters.
header_text
String
Optional Header text to highlight a key message in your Android notification, with a maximum length of 32 characters.
message
String
Required The message body, with a maximum length of 192 characters.
url
String
Required URL of the target page where you want subscribers to land after clicking on the notification.
channel_id
String
Required The UUID of the Android notification channel category. Default: None
small_icon
String
Optional Resource name of small_icon.
accent_color
String
Optional The ARGB Hex formatted color of the Android small icon background.
sound
String
Optional Resource name of the sound.
group_key
String
Optional A KEY used to group notifications. Notifications with the same group key are organized together in the notification center.
lockscreen_visibility
String
Required Controls how the notification is shown on the device lock screen. Values: Public (Default), Private or Secret. For Android 8+, use channel_id.
priority
String
Required Sets the notification’s urgency level, affecting alert behavior and display position. Values: Urgent, High (Default), Medium, Low. For Android 8+, use channel_id.
background_data
String
Required Yes or No (Default). If set yes then no notification will be shown, you can use additional_data to perform action with in the app.
large_icon
String
Optional URL of the icon (192x192 pixels recommended). The icon URL should be served over HTTPS. If not specified or not available over a secure connection, the default icon from account would be used.
big_picture
String
Optional This is the hero image in the notification. It is displayed below the main text and above the notification action buttons. We recommend using 720x360 PNG images to be used here. The large image URL should be served over HTTPS. If not specified or not available over a secure connection, this will not be sent.
action1
Array
Optional An array containing the title, URL and button id to be used for the first CTA button in the notification. Both title and URL are required, id is optional. The title can be of maximum 16 characters. If longer, the button will not be shown. Eg. '{"title":"Click here!", "url":"https://example.com", "id"" "btn1}' (including quotes)
action2
Array
Optional An array containing the title, URL and button id to be used for the second CTA button in the notification. Both title and URL are required, id is optional. The title can be of maximum 16 characters. If longer, the button will not be shown. Eg. '{"title":"Summer Sale!", "url":"https://example.com", "id": "btn2"}' (including quotes)
action3
Array
Optional An array containing the title, URL and button id to be used for the third CTA button in the notification. Both title and URL are required, id is optional. The title can be of maximum 16 characters. If longer, the button will not be shown. Eg. '{"title":"Click here!", "url":"https://example.com", "id": "btn3"}' (including quotes)
action1_attr
Array
Optional An array containing the title and URL with attributes to be used for the first CTA button in the notification. Both title and URL are required. The title can be of maximum 16 characters. If longer, the button will not be shown. Please make sure that action1 (fallback) is also added or the button with attributes will not be shown. Eg. '{"title":"Apply {{coupon_code}}", "url":"https://example.com"}' (including quotes)
action2_attr
Array
Optional An array containing the title and URL with attributes to be used for the second CTA button in the notification. Both title and URL are required. The title can be of maximum 16 characters. If longer, the button will not be shown. Please make sure that action2 (fallback) is also added or the button with attributes will not be shown. Eg. '{"title":"Apply {{coupon_code}}", "url":"https://example.com"}' (including quotes)
action3_attr
Array
Optional An array containing the title and URL with attributes to be used for the third CTA button in the notification. Both title and URL are required. The title can be of maximum 16 characters. If longer, the button will not be shown. Please make sure that action3 (fallback) is also added or the button with attributes will not be shown. Eg. '{"title":"Apply {{coupon_code}}", "url":"https://example.com"}' (including quotes)
additional_data
String
Optional An additional data you want to send along with the notifcation in JSON-formatted string of key–value pairs.
audience_id
Integer
Optional ID of target audience, created via Audience Creator from Dashboard. Used for precise targeting.
subscriber
String
Optional To send a notification to a particular subscriber, use the subscriber ID with this endpoint.
subscribers
String
Optional To send a notification to a specific set of subscribers, you can include this parameter with an array of subscriber IDs in JSON format. Only one among subscriber or subscribers parameters can be used in a single endpoint call.
title_attr
String
Optional Notification title with custom attributes. This is an optional field, if attributes are not found, the title parameter will be used.
message_attr
String
Optional Notification message with custom attributes. If omitted or attributes not available then the message parameter will be used.
url_attr
String
Optional Notification URL with custom attributes. If omitted or attributes not available then the url parameter will be used.
expire_time
Integer
Optional Define the expiry time of a notification in seconds. By default it is set to 86400 seconds or 24 hours.
schedule_time
Integer
Optional Define the time when you want the notification to be sent with a 10-digit unix timestamp.
timezone_schedule
ISO Date Time
Optional Define the time when you want the notification to be sent in the subscriber's time zone. The time needs to be specified in ISO Date Time Format (e.g. 2024-01-30T11:00:00+05:30). The time should be provided in multiples of 30 minutes or the notification will be rejected.
Using this API call you can personalize notifications with custom attributes. Since there can be some users without attribute values, you need to mention the default title and message as well. To use an attribute in title or message, use double curly braces i.e. {{attribute_name}}, {{email}}, {{name}} etc. For adding attributes to subscribers, you can refer to the JS API function addAttributes or use this REST API Endpoint.
Send notification to a pre-defined segment of subscribers. You can create segments both from Dashboard -> Segmentation as well through the Create Segment call.
Required This is the title of the notification. It's maximum length is restricted to 64 characters.
message
String
Required The message body, with a maximum length of 192 characters.
url
String
Required URL of the target page where you want subscribers to land after clicking on the notification.
icon
String
Optional URL of the icon (192x192 pixels recommended). The icon URL should be served over HTTPS. If not specified or not available over a secure connection, the default icon from account would be used.
Get detailed stats about a particular notification including total subscibers attempted, total delivered, number of clicks and overall click-through-rate (CTR).
Total number of subscribers the notification was sent to. This is generally equal to the total number of subscribers of your website. However, if some subscribers have unsubscribed, or blocked notifications, this reflects the current active subscriber base.
Delivered
Integer
Total number of subscribers the notification was delivered to, this is not a static statistic. It keeps on updating as your subscribers come online and receive the notification.
Clicked
Integer
Number of clicks on the notification, again this is a dynamic stat and keeps on updating throughout the day. To see specific clicks on particular Action buttons, please check analytics on the Dashboard.
CTR
Double
Overall click-through-rate (CTR) till now, based on total delivery.
Example
curl https://api.pushalert.co/rest/v2/android-app/info/11 \
-H "Authorization: api_key=<insert api key here>"
Add subscribers to a segment. Requires Segment ID which is available from Dashboard > Segmentation or through the REST API call for all segment details.
Add custom attributes to a subscriber. These attributes can be used in personalizing the notifications and for targeting a particular set of subscribers.
Get custom attributes of a subscriber. These attributes can be used in personalizing the notifications and for targeting a particular sets of subscribers.
Using this endpoint you can trigger a notification in the back-end based on user interaction. It requires the subscription ID to be passed along with the event parameters.
Required The subscriber ID for the subscriber that triggered the event.
extra_info
JSON (Key-value Pair)
Optional There can be two parameters sent in extra_info - first_name and total_items. You can choose to include either one of them or both. Where 'first_name' is the first or full name of the customer, while 'total_number' is the number of items in cart. For e.g. {'first_name':'Alex','total_items':2} This will be used to personalize the notification for your customer.