User's Notifications preferences
This section describes the API of the user's notifications preferences. An user can set his notifications preferences according to an event in Rexpense. These events are listed bellow:
Email notifications attributes
email_on_expense_created: | boolean |
email_on_expense_updated: | boolean |
email_on_expense_destroyed: | boolean |
email_on_expense_status_changed: | boolean |
email_on_attachment_created: | boolean |
email_on_attachment_destroyed: | boolean |
email_on_comment_created: | boolean |
email_on_comment_updated: | boolean |
email_on_comment_destroyed: | boolean |
email_on_organization_add_member: | boolean |
email_on_organization_remove_member: | boolean |
email_on_organization_left: | boolean |
email_on_organization_role_changed: | boolean |
email_on_advancement_created: | boolean |
email_on_advancement_updated: | boolean |
email_on_advancement_destroyed: | boolean |
email_on_reimbursement_created: | boolean |
email_on_reimbursement_updated: | boolean |
email_on_reimbursement_destroyed: | boolean |
email_on_advancement_devolution_created: | boolean |
Mobile notifications attributes
mobile_on_expense_created: | boolean |
mobile_on_expense_updated: | boolean |
mobile_on_expense_destroyed: | boolean |
mobile_on_expense_status_changed: | boolean |
mobile_on_attachment_created: | boolean |
mobile_on_attachment_destroyed: | boolean |
mobile_on_comment_created: | boolean |
mobile_on_comment_updated: | boolean |
email_on_comment_destroyed: | boolean |
mobile_on_organization_add_member: | boolean |
mobile_on_organization_remove_member: | boolean |
mobile_on_organization_left: | boolean |
mobile_on_organization_role_changed: | boolean |
mobile_on_advancement_created: | boolean |
mobile_on_advancement_updated: | boolean |
mobile_on_advancement_destroyed: | boolean |
mobile_on_reimbursement_created: | boolean |
mobile_on_reimbursement_updated: | boolean |
mobile_on_reimbursement_destroyed: | boolean |
mobile_on_advancement_devolution_created: | boolean |
Example User's Notifications
Show notifications preferences
Returns the detailed information of the user's notifications preferences.
Definition
GET https://app.rexpense.com/api/v1/notification_preferences
Example Request
$ curl -u $YOUR_API_TOKEN:X -X GET https://app.rexpense.com/api/v1/notification_preferences \ -H 'Accept: application/json' \ -H 'Content-type: application/json'
Response Example
HTTP 200 OK
Update notifications preferences
There are two ways to update the user's notifications: partially or fully.
If you'd like to change just one or a few attributes, you have to use the HTTP method PATCH
.
If you use the HTTP method PUT
, you'll have to pass all attributes of the user's notifications preferences.
Parameters
Possible parameters are describe in the section above.
Definition
PUT/PATCH https://app.rexpense.com/api/v1/notification_preferences
Example Request
$ curl -u $YOUR_API_TOKEN:X -X PATCH https://app.rexpense.com/api/v1/notification_preferences \ -H 'Accept: application/json' \ -H 'Content-type: application/json' \ -d '{"locale":"en"}'
Response Example Success
HTTP 200 OK
Response Example Failure
HTTP 422 Unprocessable Entity
Describe notifications preferences
Returns the names and description of the user's notifications.
Definition
GET https://app.rexpense.com/api/v1/notification_preferences/descriptions
Example Request
$ curl -u $YOUR_API_TOKEN:X -X GET https://app.rexpense.com/api/v1/notification_preferences/descriptions \ -H 'Accept: application/json' \ -H 'Content-type: application/json'
Response Example
HTTP 200 OK