Send a Push Notification
There are several ways to send push notifications over the API.
Option 1) Send to Segment
Required Fields: title, body, link, segmentId
By specifying the segmentId we will automatically fetch all subscribers that match that segment and send them the corresponding notification based on the title, body, and link provided.
curl -XPOST -H 'X-Authorization: AUTH_TOKEN' -H "Content-type: application/json" -d '{
"idSite": "2459",
"title": "An Awesome Push",
"body": "Looks pretty great.",
"link" : "https://aimtell.com",
"segmentId": 12301
}' 'https://api.aimtell.com/prod/push'
Option 2) Send Push To Specific Subscribers Based on UIDS
Required Fields: title, body, link, uids
By specifying the Aimtell subscriber uids we will send the notification to those subscribers. You may pass up to 1000 subscriber uids separated by commas.
curl -XPOST -H 'X-Authorization: AUTH_TOKEN' -H "Content-type: application/json" -d '{
"idSite": "2459",
"title": "An Awesome Push",
"body": "Looks pretty great.",
"link" : "https://aimtell.com",
"subscriber_uids": "02d792db-505f-db03-d914-4adf42263f91"
}' 'https://api.aimtell.com/prod/push'
Option 3) Send Push To Specific Subscriber based on an Alias
Required Fields: title, body, link, alias
Alias allows you to send a notification to a subscriber based an associated username, user id or email. To learn more, view this help desk article: https://documentation.aimtell.com/hc/en-us/articles/360002633692-Tracking-Subscriber-Aliases
curl -XPOST -H 'X-Authorization: AUTH_TOKEN' -H "Content-type: application/json" -d '{
"idSite": "2459",
"title": "An Awesome Push",
"body": "Looks pretty great.",
"link" : "https://aimtell.com",
"alias": "user==jacksparrow17"
}' 'https://api.aimtell.com/prod/push'
Using Action Buttons
If you'd like to pass the action buttons, simply pass them as shown below.
curl -XPOST -H 'X-Authorization: AUTH_TOKEN' -H "Content-type: application/json" -d '{
"idSite": "2459",
"title": "An Awesome Push",
"body": "Looks pretty great.",
"link" : "https://aimtell.com",
"subscriber_uids": "02d792db-505f-db03-d914-4adf42263f91",
"actions": {
"a01": {
"link": "https://yahoo.com",
"title": "My First Action"
},
"a02": {
"link": "https://cnn.com",
"title": "My Second Action"
}
}
}' 'https://api.aimtell.com/prod/push'