Routes

Detail

/receive

Send device token http://127.0.0.1:8000/receive with UUID.

Request parameters

Name Type Required Note
device_token String YES 64 letters
uuid String YES 36 letters
sandbox Bool YES
  • Request method: PUT
  • Content-Type: application/json
  • Model: notification.models.DeviceToken
  • Success response: {"result": "success"}
  • Failure response: {"error": "Bad Request"}

notification.models.DeviceToken has user field so you can also associate users by applying django.contrib.auth.models.User.

Sample Request

$ curl -X PUT http://127.0.0.1:8000/receive \
  -d '{"device_token": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "uuid": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX", "sandbox": true}'

/send

It is possible to send a push notification easily.

Real route is /send/<TARGET_MODE>/<DEVICE_TOKEN>.

TARGET_MODE

  • Development: 0
  • Distribution: 1

DEVICE_TOKEN

  • Device token registered DATABASE.

Request parameter

Name Type Required Note
message String NO URL encoded
  • Request method: GET

Sample Request

Use sandbox
http://127.0.0.1:8000/send/0/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX?message=test%20push%20notification
NOT use sandbox
http://127.0.0.1:8000/send/1/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

/cert_upload

Upload push notifications’ certificates by superuser.

Note

  • PEM file not locked.
  • Secure PEM file which is not double transfer etc.

/login

Login to session.

/logout

Logout from session.