Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Designing REST API for push-notification #500

Open
GarlicB opened this issue Oct 28, 2017 · 1 comment
Open

Designing REST API for push-notification #500

GarlicB opened this issue Oct 28, 2017 · 1 comment

Comments

@GarlicB
Copy link
Contributor

GarlicB commented Oct 28, 2017

I referenced kakao developers.

Default Setting
Host: https://api.absolute.com/v1.0
Authorization: FCM Server Key
Data Format : application/json

We use web-pushlib, and the push server key is fcm (firebase clouding message).

Detail
2-1. Registration
URL: /push/register
Method: POST
Params (all string type)
Endpoint: The id to receive the push.
p256dh: The public key that encrypts the payload between client and server.
auth: The authorization code.

On the client side, the user sends his own token (endpoint, p256dh, auth)
generated from the subscription to the server and stores it in database.

2-2. Unregistration
POST /push/unregister
Method: POST
Params:endpoint,p256dh,auth (same 2-1)
Response: 200 OK 'deleted tokens' <-log msg (example)

Delete the push token for a specific user.

2-3. Show tokens
URL: /push/tokens
Method: GET
Params: querystring 'auth'
auth: user's auth code(default value is null)

If the value of the params is 'null', the entire token list is displayed. (/push/tokens)
Or if you enter a specific auth value, it prints only the corresponding tokens.(/push/tokens?auth='***')

2-4. Send payload to user
URL: /push/send
Method: POST
Params: for_fcm
"for_fcm":{
"comment": "yay, it works",
"delay_while_idle":false,
"time_to_live":17200,
"priority":"high"
}

@romandev. Sorry for being late. I have redesigned it with more information.

@romandev
Copy link
Member

@GarlicB Thank you for this.
But you missed some parameter information. Please add the info in more details.
Also, I'm not sure if we need /push/event API in server side.

/cc @daehyunjimmy @JayChl

@GarlicB GarlicB changed the title Designing REST API for the client side in push-notification Designing REST API for push-notification Nov 7, 2017
romandev pushed a commit that referenced this issue Nov 22, 2017
To avoid conflict, updated the skeleton codes again at the most recent
commit phase.

ISSUE=#500
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants