Push to an Audience
This API can be used to send notification against an audience. You may use 'Get audiences' API described below to get a list of audiences along with their IDs. You can push notifications to an audience using the audience ID.
Get Audiences
This API can be used to get the list of audiences created through 'Audience Builder' on iZooto Panel.
Definition
curl -X GET \
-H "Authentication-Token: {API_TOKEN}" \
"https://apis.izooto.com/v1/audience"
Parameters
Name | Type | Required |
---|---|---|
Authentication-Token | String | Yes |
Sample Code
curl -X GET \
-H "Authentication-Token: abc1234defghji89766" \
"https://apis.izooto.com/v1/audience"
{
"audience": [
{
"id": 1381,
"name": "Frequent-Shoppers",
"reach": 12324
},
{
"id": 1387
"name":"Mobile-Users",
"reach":2121
}
]
}
Here id represents the audience ID against which notification has to be pushed, name represents the 'Audience Name' created on panel, and reach represents the total no. of subscribers that belong to the respective audience.
Send notification to an audience
This API can be used to send notification against an audience. You may use 'Get audiences' API described above to get list of audiences along with their IDs. These IDs can be used to push notifications against using 'Push notification to an audience'.
Definition
curl -X POST \
- H "Authentication-Token: {API_TOKEN}" \
- H "Content-Type: application/json" \
-d '{
"campaign_name" : "{CAMPAIGN_NAME}",
"title" : "{NOTIFICATION_TITLE}",
"message" : "{NOTIFICATION_MESSAGE}",
"icon_url" : "{ICON_URL}",
"badge_icon_url" : "{BADGE_ICON_URL}",
"banner_url" : "{BANNER_URL}",
"landing_url" : "{LANDING_URL}",
"actions" : [
{
"text" : "{BUTTON_1_TEXT}",
"url" : "{BUTTON_1_URL}",
"icon" : "{BUTTON_1_ICON}"
},
{
"text" : "{BUTTON_2_TEXT}",
"url" : "{BUTTON_2_URL}",
"icon" : "{BUTTON_2_ICON}"
}],
"utm_source" : "{UTM_SOURCE}",
"utm_medium" : "{UTM_MEDIUM}",
"utm_campaign" : "{UTM_CAMPAIGN}",
"utm_term": "{UTM_TERM}",
"utm_content": "{UTM_CONTENT}",
"req_interaction" : {true/false},
"override_tag" : "{CAMPAIGN_TAG_NAME}",
"ttl" : {TTL_SECONDS},
"target" : {
"type : "audience",
"value" : {AUDIENCE_ID}
}
}' "https://apis.izooto.com/v1/notifications"
curl --request POST \
--url https://apis.izooto.com/v1/notifications \
--header 'Authentication-Token:YOUR_REST_API_KEY' \
--header 'content-type: application/json' \
--data '{
"campaign_name" : "{CAMPAIGN_NAME}",
"title" : "{NOTIFICATION_TITLE}",
"message" : "{NOTIFICATION_MESSAGE}",
"icon_url" : "{ICON_URL}",
"badge_icon_url" : "{BADGE_ICON_URL}",
"banner_url" : "{BANNER_URL}",
"landing_url" : "{LANDING_URL}",
"actions" : [
{
"text" : "{BUTTON_1_TEXT}",
"url" : "{BUTTON_1_URL}",
"id":"{BUTTON_1_ACTION_ID}"
},
{
"text" : "{BUTTON_2_TEXT}",
"url" : "{BUTTON_2_URL}",
"id":"{BUTTON_2_ACTION_ID}"
}
],
"utm_source" : "{UTM_SOURCE}",
"utm_medium" : "{UTM_MEDIUM}",
"utm_campaign" : "{UTM_CAMPAIGN}",
"utm_term": "{UTM_TERM}",
"utm_content": "{UTM_CONTENT}",
"ttl" : {TTL_SECONDS},
"override_tag" : "{OVERRIDE_TAG}",
"target" : {
"type" : "audience",
"value": "{AUDIENCE_ID}"
},
"additional_params":{
"{KEY_1}":"{VALUE_1}",
"{KEY_2}":"{VALUE_2}",
"{KEY_3}":"{VALUE_3}",
"{KEY_4}":"{VALUE_4}",
"{KEY_5}":"{VALUE_5}"
},
"open_in_app" :{TRUE/FALSE}
}
curl --request POST \
--url https://apis.izooto.com/v1/notifications \
--header 'Authentication-Token:YOUR_REST_API_KEY' \
--header 'content-type: application/json' \
--data '{
"campaign_name" : "{CAMPAIGN_NAME}",
"title" : "{NOTIFICATION_TITLE}",
"message" : "{NOTIFICATION_MESSAGE}",
"icon_url" : "{ICON_URL}",
"badge_icon_url" : "{BADGE_ICON_URL}",
"banner_url" : "{BANNER_URL}",
"landing_url" : "{LANDING_URL}",
"actions" : [
{
"text" : "{BUTTON_1_TEXT}",
"url" : "{BUTTON_1_URL}",
"id":"{BUTTON_1_ACTION_ID}"
},
{
"text" : "{BUTTON_2_TEXT}",
"url" : "{BUTTON_2_URL}",
"id":"{BUTTON_2_ACTION_ID}"
}
],
"utm_source" : "{UTM_SOURCE}",
"utm_medium" : "{UTM_MEDIUM}",
"utm_campaign" : "{UTM_CAMPAIGN}",
"utm_term": "{UTM_TERM}",
"utm_content": "{UTM_CONTENT}",
"ttl" : {TTL_SECONDS},
"override_tag" : "{OVERRIDE_TAG}",
"target" : {
"type" : "audience",
"value": "{AUDIENCE_ID}"
},
"additional_params":{
"{KEY_1}":"{VALUE_1}",
"{KEY_2}":"{VALUE_2}",
"{KEY_3}":"{VALUE_3}",
"{KEY_4}":"{VALUE_4}",
"{KEY_5}":"{VALUE_5}"
},
"open_in_app" :{TRUE/FALSE}
}
Fixed Values for UTM Parameters!
The values for
utm_source
andutm_medium
is set toizooto
andpush_notifications
respectively, by default, for both web and app push. This cannot be changed. If you use a different value in your payload, it will be ignored and the default values will be used.
Parameters
Refer to this table to learn about the notification parameters being used.
Sample Code
curl -X POST \
- H "Authentication-Token: abc123efgh456ijklmn9786" \
- H "Content-Type: application/json" \
-d '{
"campaign_name" : "Test Campaign"
"title" : "Limited Period Offer",
"message" : "Go Shopping, Save Big",
"icon_url" : "https://yourdomain.com/icon.png",
"badge_icon_url" : "https://yourdomain.com/badge_icon.png",
"banner_url" : "https://yourdomain.com/large-image.png",
"landing_url" : "https://yourdomain.com/offers",
"actions" : [
{
"text" : "Buy Now",
"url" : "https://yourdomain.com/buy-now",
"icon" : "https://yourdomain.com/button_1_icon.png"
},
{
"text" : "Compare",
"url" : "https://yourdomain.com/compare",
"icon" : "https://yourdomain.com/button_2_icon.png"
}],
"utm_source" : "izooto",
"utm_medium" : "push_notifications",
"utm_campaign" : "promotion",
"utm_term": "term",
"utm_contemt": "content",
"req_interaction" : true,
"override_tag" : "My Tag",
"ttl" : 86400,
"target" : {
"type" : "audience",
"value" : 1381
}
}' "https://apis.izooto.com/v1/notifications"
curl --request POST \
--url https://apis.izooto.com/v1/notifications \
--header 'Authentication-Token:YOUR_REST_API_KEY' \
--header 'content-type: application/json' \
--data '{
"campaign_name" : "Test Campaign"
"title" : "Limited Period Offer",
"message" : "Go Shopping, Save Big",
"icon_url" : "https://yourdomain.com/icon.png",
"badge_icon_url" : "https://yourdomain.com/badge_icon.png",
"banner_url" : "https://yourdomain.com/large-image.png",
"landing_url" : "https://yourdomain.com/offers",
"actions" : [
{
"text" : "Read More",
"url" : "https://yourdomain.com/world-news",
"id":"Launch_Activity"
},
{
"text" : "Local News",
"url" : "https://yourdomain.com/local-news",
"id":"Launch_Activity"
}
],
"utm_source" : "izooto",
"utm_medium" : "push_notifications",
"utm_campaign" : "promotion",
"utm_term": "term",
"utm_contemt": "content",
"ttl" : 86400,
"override_tag" : "Test_Tag",
"target" : {
"type" : "audience",
"value": 1381
},
"additional_params":{
"News_Activity":"87162",
"Home_Activity":"Home",
"Video_Activity":"aksjdhakjdh",
"ID":"1923879",
"Live_TV":"1982312938"
},
"open_in_app" :true
}'
curl --request POST \
--url https://apis.izooto.com/v1/notifications \
--header 'Authentication-Token:YOUR_REST_API_KEY' \
--header 'content-type: application/json' \
--data '{
"campaign_name" : "Test Campaign"
"title" : "Limited Period Offer",
"message" : "Go Shopping, Save Big",
"icon_url" : "https://yourdomain.com/icon.png",
"badge_icon_url" : "https://yourdomain.com/badge_icon.png",
"banner_url" : "https://yourdomain.com/large-image.png",
"landing_url" : "https://yourdomain.com/offers",
"actions" : [
{
"text" : "Read More",
"url" : "https://yourdomain.com/world-news",
"id":"Launch_Activity"
},
{
"text" : "Local News",
"url" : "https://yourdomain.com/local-news",
"id":"Launch_Activity"
}
],
"utm_source" : "izooto",
"utm_medium" : "push_notifications",
"utm_campaign" : "promotion",
"utm_term": "term",
"utm_contemt": "content",
"ttl" : 86400,
"override_tag" : "Test_Tag",
"target" : {
"type" : "audience",
"value": 1381
},
"additional_params":{
"News_Activity":"87162",
"Home_Activity":"Home",
"Video_Activity":"aksjdhakjdh",
"ID":"1923879",
"Live_TV":"1982312938"
},
"open_in_app" :true
}'
Updated 5 months ago