Send Push Notifications
Send push notifications to your users using the Send Notifications API.
Code Samples
We provide code samples to help you implement this API request:
Overview
Interface with our API by sending an HTTP POST request to the following URL:
POST https://api.pushy.me/push?api_key=SECRET_API_KEY
Note: Make sure to replace SECRET_API_KEY
with your app's Secret API Key, available in the Pushy Dashboard (Click your app -> API Authentication tab). This is a backend API endpoint. Never expose your application's Secret API Key in your client code.
API Request
Send the following sample request body along with your request:
{
"to": "a6345d0278adc55d3474f5",
"data": {
"message": "Hello World!"
},
"notification": {
"title": "Test Notification",
"body": "Hello World \u270c",
"badge": 1,
"sound": "ping.aiff"
}
}
Note: Please make sure to send the Content-type: application/json
header with your request.
Replace a6345d0278adc55d3474f5
with your device token or a topic (i.e. /topics/news
). Also, replace the contents of the data
object with any payload data you want to make available to your app's notification listener.
Note: The notification
object within the sample request body is used to customize the display of iOS notifications and does not affect Android devices.
Refer to the complete Send Notifications API reference for more information about this API.
Now that you've finished both the client and backend setup, try to send a test push notification to your device from your backend to verify that everything works.
We thank you for choosing Pushy.