Example Push Notification Server
- Get JWT token (authenticate) :GET
/api/v1/identity/authenticate
Query params:
username = "username" // User name
password = "psw" // Title of notification message
curl example :
curl "http://localhost:5000/api/v1/identity/authenticate?username=admin&password=secret"
- Send message to device :POST
/api/v1/admin/send
Input params (Add Bearer authorization token):
{
"token":"client_token", // Client token
"title":"Title", // Title of notification message
"body":"Body" // Body of notification message
}
curl example :
curl -H "Content-Type: application/json" --data '{"token":"client_token","title":"Title","body":"Body"}' http://localhost:5000/api/v1/admin/send/
- Send message to Topic :POST
/api/v1/admin/send/:TOPIC_NAME
Input params (Add Bearer authorization token):
{
"token":"client_token", // Client token
"title":"Title", // Title of notification message
"body":"Body" // Body of notification message
}
curl example :
curl -H "Content-Type: application/json" --data '{"title":"Title","body":"Body"}' http://localhost:5000/api/v1/admin/send/PRICE_CHANGE
- Subscribe device to Topic :POST
/api/v1/pns/subscribe/:TOPIC_NAME
Input params (Add Bearer authorization token):
{
"token":"token"
}
curl example :
curl -H "Content-Type: application/json" --data '{"token":"token"}' http://localhost:5000/api/v1/pns/subscribe/PRICE_CHANGE
- Subscribe device to Topics :POST
/api/v1/pns/subscribe
Input params (Add Bearer authorization token):
{
"token":"token",
"bundle_id": "bundle_id",
"topics": ["topic1", "topic2", "topic3"]
}
curl example :
curl -H "Content-Type: application/json" --data '{"token":"token", "topics": ["topic1"]}' http://localhost:5000/api/v1/pns/subscribe
- UnSubscribe device from Topic :POST
/api/v1/pns/unsubscribe/:TOPIC_NAME
Input params (Add Bearer authorization token):
{
"token":"token",
"bundle_id":"bundle_id",
}
curl example :
curl -H "Content-Type: application/json" --data '{"token":"token"}' http://localhost:5000/api/v1/pns/unsubscribe/PRICE_CHANGE
- UnSubscribe device from Topics :POST
/api/v1/pns/unsubscribe
Input params (Add Bearer authorization token):
{
"token":"token",
"topics": ["topic1", "topic2", "topic3"]
}
curl example :
curl -H "Content-Type: application/json" --data '{"token":"token", "topics": ["topic1"]}' http://localhost:5000/api/v1/pns/unsubscribe
- UnSubscribe device from all Topics :GET
/api/v1/pns/unsubscribeall/:TOKEN
Input params (Add Bearer authorization token):
curl example :
curl -H "Content-Type: application/json" http://localhost:5000/api/v1/pns/unsubscribeall/token
- Get all Topics device subscribed to :GET
/api/v1/pns/channels/:TOKEN
Input params (Add Bearer authorization token):
curl example :
curl -H "Content-Type: application/json" http://localhost:5000/api/v1/pns/channels/token
<<<<<<<<<<||||||(((((( Merry Christmas, ya filthy animal )))))))||||||>>>>>>>>>>>>>