Skip to content

mellis0303/Push-Notification-Server-Experiment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Example Push Notification Server

API

  1. 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"
  1. 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/
  1. 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
  1. 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
  1. 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
  1. 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
  1. 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
  1. 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
  1. 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 )))))))||||||>>>>>>>>>>>>>

About

Testing Testing 1, 2, 3

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published