-
Notifications
You must be signed in to change notification settings - Fork 278
Push Server [Proposed]
The number 1 requested feature from Tweet Lanes users is notifications. In version 1.6 we will introduce polling notifications. We want to go further and add push notifications, but due to the cost of running a server we are considering releasing an open source server application for our loyal users to run independently.
The server application will need to do the following:
- Accept a POST request from Tweet Lanes to register for push notifications.
- Accept a DELETE request from Tweet Lanes to stop push notifications.
- Open streaming connections to Twitter and App.net for the users registered for notifications.
- Send notifications to Tweet Lanes using Google's Cloud Messaging platform.
POST /api/1/register
{
"token":"TOKEN",
"accounts": [
{ "type":"TWITTER/ADN", "username":"@USERNAME" }
],
"gcm_registration_id": "REGISTRATION_ID"
}
POST /api/1/unregister
{
"token":"TOKEN",
"accounts": [
{ "type":"TWITTER/ADN", "username":"@USERNAME" }
]
}
GET /api/1/user
{
"token":"TOKEN",
"accounts": [
{ "type":"TWITTER/ADN", "username":"@USERNAME" }
],
}
The server will be secured by a password to keep unauthorized users from using it. The server will create and reply with a token for future requests.
The implementation of the password is up to the application. It can either be a server-wide password or created per user. The open source server application will have a server-wide password.
POST /api/1/authorize
{
"password":"SERVER_PASSWORD"
}
If the password was correct the server response will look similar to below:
{
"token":"TOKEN"
}
- 200 OK -- The request was successful
- 400 Bad Request -- The request was malformed in some way.
- 401 Unauthorized -- You are not authorized to use this server.
- 404 Not Found -- The requested resource was not found.
- 429 Too Many Requests -- The request could not be completed because you are making to many requests.
- 500 Internal Server Error -- An unexpected error has occurred. Try your request again.