User Notifications API
Authentication
If you want to deliver notifications to your own account, use the user_credentials attribute. If you want to deliver to other users, use the oauth applications.
Notify yourself
https://www.appnotifications.com/account/notifications.json
$ curl -d user_credentials=YOUR_CREDENTIALS \
-d "notification[message]=my message" \
-d "notification[long_message]=<b>Some HTML for the full layout page notification</b>" \
-d "notification[title]=A notification title" \
-d "notification[subtitle]=A notification subtitle" \
-d "notification[long_message_preview]=the notif preview" \
-d "notification[message_level]=2" \
-d "notification[silent]=0" \
-d "notification[action_loc_key]=Approve me" \
https://www.appnotifications.com/account/notifications.json
---
"{\"id\":3548469}"
Notify a single user
https://www.appnotifications.com/account/notifications.json
Create an oauth application, and use the user tokens to deliver a notification
Broadcast notifications to all users
https://www.appnotifications.com/account/notifications/broadcast.json
Create an oauth application, using your application access token you can broadcast notifications to all your users.
Example
Available variables
- notification[sound] : Select the sound you want for the notification. Sounds should be a string with a number (1, 2, 3, etc), you can see availables sounds and what they feel like on the iPhone application reading this gist.
- notification[message] : The message used for the alert window when the notification appears.
- notification[title] : The title of the notification in the notifications list.
- notification[subtitle] : The subtitle of the notification in the notifications list. We suggest you use this to give more informations, for example “RSS: a feed”.
- notification[long_message]: The notification when the user select it in the list, this is the long text.
- notification[long_message_preview]: The preview under the title in the listing, we suggest you don’t put any HTML there.
- notification[icon_url] : The icon on the left in the listing.
- notification[message_level] : the importance of the notification, from -2 to 2.
- notification[silent] : Should this be silent? (no alert window, just a badge number).
- notification[action_loc_key] : The name of the validation button