Notifications
Get your notifications
GET /notifications
Query string parameters
show
string - If you only want the unread notifications.- Can be
unread
- Can be
- Supports Pagination
Response
Status code 200
{
"data": [
{
"id": "621a5f2c-69ce-4dd4-863a-e2ae5e4025dd",
"type": "note",
"data": {
"user": {
"id": 4,
"first_name": "Bernita",
"last_name": "Kilback",
"profile_picture": "http://api.randomuser.me/portraits/thumb/women/5.jpg"
},
"case": {
"id": "65e48afe-7307-3ad3-9fc1-9ec7e6dc0a88",
"case_number": 6,
"relations_path_name": "Case type"
}
},
"message": "Bernita Kilback mentioned you in a note on Jane Doe's case <br> Hey John, please have a look!",
"message_formatted": "<p><strong>Bernita Killback</strong> mentioned you in a <strong>note</strong> on <strong>Jane Doe's</strong> case</p><br><p><em>Hey John, please have a look!</em></p>",
"read": false,
"read_at": null,
"created_at": "2015-03-22 10:25:50"
},
{
"id": "7a710af9-b225-4a78-b8e6-5a3fe67160ed",
"type": "note",
"data": {
"user": {
"id": 4,
"first_name": "Bernita",
"last_name": "Kilback",
"profile_picture": "http://api.randomuser.me/portraits/thumb/women/5.jpg"
},
"case": {
"id": "eab4f954-28d8-3e9a-b2d0-5e819fccfefd",
"case_number": 7,
"relations_path_name": "Case type"
}
},
"message": "Bernita Kilback mentioned you in a note on John Doe's case <br> Hey Jane, please have a look!",
"message_formatted": "<p><strong>Bernita Killback</strong> mentioned you in a <strong>note</strong> on <strong>John Doe's</strong> case</p><br><p><em>Hey Jane, please have a look!</em></p>",
"read": false,
"read_at": null,
"created_at": "2015-03-19 10:25:50"
},
{
"id": "071195b2-23fe-4c60-bd59-1351fe570fa5",
"type": "inbox",
"data": {
"user": {
"id": 1,
"first_name": "John",
"last_name": "Doe",
"profile_picture": "http://api.randomuser.me/portraits/thumb/men/5.jpg"
},
"case": {
"id": "da79fcb1-4fc3-3250-9206-e38eff52bf1b",
"case_number": 2,
"relations_path_name": "Case type"
},
"correspondence": {
"id": "d927c3c6-f7a7-486a-8d96-53ecb0bb268f"
}
},
"message": "John Doe wants you to look at the email on Jane Does's case <br> Hey Sam, please have a look!",
"message_formatted": "<p><strong>John Doe</strong> wants you to look at the <strong>email</strong> on Jane Does's case</p><br><p><em>Hey Sam, please have a look!</em></p>",
"read": true,
"read_at": "2015-03-23 10:25:50",
"created_at": "2015-03-19 10:25:50"
},
{
"id": "204f6500-9a27-4f49-9e0a-96f3c7cd00ff",
"type": "inbox",
"data": {
"user": {
"id": 4,
"first_name": "Bernita",
"last_name": "Kilback",
"profile_picture": "http://api.randomuser.me/portraits/thumb/women/5.jpg"
},
"case": {
"id": "da79fcb1-4fc3-3250-9206-e38eff52bf1b",
"case_number": 2,
"relations_path_name": "Case type"
},
"correspondence": {
"id": "d927c3c6-f7a7-486a-8d96-53ecb0bb268f"
}
},
"message": "Bernita Kilback wants you to look at the email on Jane Does's case <br> Hey John, please have a look!",
"message_formatted": "<p><strong>Bernita Kilback</strong> wants you to look at the <strong>email</strong> on Jane Does's case</p><br><p><em>Hey John, please have a look!</em></p>",
"read": false,
"read_at": null,
"created_at": "2015-03-18 10:25:50"
}
],
"pagination": {
"total": 7,
"page": 1,
"per_page": 15,
"urls": {
"previous": null,
"next": null
},
"unread": 0
}
}
Create a custom notification
POST /notifications
Parameters
message
string- Between 1 and 512 characters.
- Required
notify.users
array- Required without
notify.teams
notify.users.*
integer
- Required without
notify.teams
array- Required without
notify.users
notify.teams.*
integer
- Required without
Payload
{
"message": "This is a custom notification",
"notify": {
"users": [1, 54, 23],
"teams": [1,5,8]
}
}
Response
Status code 202
{
"queued": true
}
Mark notification as read
PUT /notifications/:notification_id/read
Response
Status code 204
Mark all notifications as read
PUT /notifications/read
Response
Status code 204
Register a device to receive push notifications
POST /notifications/devices/:token
Parameters
token
string - Device token for use with iOS/Android push notifications.- Required
type
string - Device type.- Can be
iOS
orAndroid
- default:
iOS
- Can be
Parameters
{
"type": "iOS",
}
Response
Status code 204
Unregister a device for push notifications (detach user from device)
DELETE /notifications/devices/:token
Parameters
token
string - Device token for use with iOS/Android push notifications.- Required
Response
Status code 204
Notification types
This sections describes the different push notification the application will receive
User notifications
note
When a user is mentioned in a case.
Sample data
{
"id": "621a5f2c-69ce-4dd4-863a-e2ae5e4025dd",
"type": "note",
"data": {
"user": {
"id": 4,
"first_name": "Bernita",
"last_name": "Kilback",
"profile_picture": "http://api.randomuser.me/portraits/thumb/women/5.jpg"
},
"case": {
"id": "65e48afe-7307-3ad3-9fc1-9ec7e6dc0a88",
"case_number": 6,
"relations_path_name": "Case type"
}
},
"message": "Bernita Kilback mentioned you in a note on Jane Doe's case <br> Hey John, please have a look!",
"message_formatted": "<p><strong>Bernita Killback</strong> mentioned you in a <strong>note</strong> on <strong>John Doe's</strong> case</p><br><p><em>Hey John, please have a look!</em></p>",
"read": false,
"read_at": null,
"created_at": "2015-03-22 10:25:50"
}
inbox
When a user is notified in a email.
Sample data
{
"id": "204f6500-9a27-4f49-9e0a-96f3c7cd00ff",
"type": "inbox",
"data": {
"user": {
"id": 4,
"first_name": "Bernita",
"last_name": "Kilback",
"profile_picture": "http://api.randomuser.me/portraits/thumb/women/5.jpg"
},
"case": {
"id": "da79fcb1-4fc3-3250-9206-e38eff52bf1b",
"case_number": 2,
"relations_path_name": "Case type"
},
"correspondence": {
"id": "d927c3c6-f7a7-486a-8d96-53ecb0bb268f"
}
},
"message": "Bernita Kilback wants you to look at the email on Jane Does's case <br> Hey John, please have a look!",
"message_formatted": "<p><strong>Bernita Kilback</strong> wants you to look at the <strong>email</strong> on Jane Does's case</p><br><p><em>Hey John, please have a look!</em></p>",
"read": false,
"read_at": null,
"created_at": "2015-03-18 10:25:50"
}
incoming_email
When a new email is received in the inbox.
Sample data
{
"id": "251ae00d-1986-45cd-9dbe-0034172002c0",
"type": "incoming_email",
"data": {
"email": {
"id": "cb88bf5b-d5ed-4efb-8255-9c91d80d2d9b",
"correspondence_id": "b571e0c8-cc3f-4a68-97a6-5a013d52f334",
"subject": "Sale contract"
},
"case": {
"id": "cd0e2c00-2d73-4cf9-a820-f34a5c8557c3",
"case_number": 1,
"relations_path_name": "Case type"
},
"contact": {
"id": "c2ccbb7e-d174-4894-ba5a-1828d0f09128",
"first_name": "John",
"last_name": "Doe",
"account_id": "00755e32-3b2a-4609-87de-c1cebf10aa3e"
}
},
"message": "John Doe sent you an email on subject Sale contract <br> I want to buy your product",
"message_formatted": "<p><strong>John Doe</strong> sent you an email on subject <strong>Sale contract</strong></p><br><p><em>I want to buy your product</em></p>",
"read": false,
"read_at": null,
"created_at": "2015-07-29 12:24:05"
}
email_opened
When a email is opened by the contact.
Sample data
{
"id": "af8c7659-bcc2-42d3-9e97-49a58e3eb21d",
"type": "email_opened",
"data": {
"email": {
"id": "cb88bf5b-d5ed-4efb-8255-9c91d80d2d9b",
"correspondence_id": "b571e0c8-cc3f-4a68-97a6-5a013d52f334",
"subject": "Sale contract"
},
"case": {
"id": "cd0e2c00-2d73-4cf9-a820-f34a5c8557c3",
"case_number": 1,
"relations_path_name": "Case type"
},
"contact": {
"id": "c2ccbb7e-d174-4894-ba5a-1828d0f09128",
"first_name": "John",
"last_name": "Doe",
"account_id": "00755e32-3b2a-4609-87de-c1cebf10aa3e"
}
},
"message": "John Doe has opened an email on subject Sale contract",
"message_formatted": "<p><strong>John Doe</strong> has opened an email on subject <strong>Sale contract</strong></p>",
"read": false,
"read_at": null,
"created_at": "2015-07-29 12:24:05"
}
task_assigned
When a task is assigned to a user.
Sample data
{
"id": "3032bc78-9cb9-4547-8964-09be3a5c31e1",
"type": "task_assigned",
"data": {
"user": {
"id": 4,
"first_name": "Bernita",
"last_name": "Kilback",
"profile_picture": "http://api.randomuser.me/portraits/thumb/women/5.jpg"
},
"case": {
"id": "cd0e2c00-2d73-4cf9-a820-f34a5c8557c3",
"case_number": 1,
"relations_path_name": "Case type"
},
"task": {
"id": "a9a4b181-d989-4856-8635-a204d8a30456"
}
},
"message": "A task on John Doe's case was assigned to you",
"message_formatted": "<p>A task on <strong>John Doe's</strong> case was assigned to you</p>",
"read": false,
"read_at": null,
"created_at": "2015-07-29 12:24:05"
}
overdue_task
When a task becomes overdue.
Sample data
{
"id": "f37836fa-bb85-40a0-8e58-cd0f9e0fdc0a",
"type": "overdue_task",
"data": {
"case": {
"id": "cd0e2c00-2d73-4cf9-a820-f34a5c8557c3",
"case_number": 1,
"relations_path_name": "Case type"
},
"task": {
"id": "a9a4b181-d989-4856-8635-a204d8a30456"
}
},
"message": "One of your tasks has become overdue",
"message_formatted": "<p>One of your tasks has become overdue</p>",
"read": false,
"read_at": null,
"created_at": "2015-07-29 12:24:05"
}
scheduled_report
When receiving a scheduled report.
Sample data
{
"id": "56545e4a-61eb-4a50-aba7-bc28dd158b45",
"type": "scheduled_report",
"data": {
"report": {
"id": "4aa4ff0f-05e4-4250-831f-d0e5dc573aeb"
},
"scheduled_report": {
"id": "d3a0b79d-72cb-4fd1-9eb2-8186362000dd",
"name": "Daily scheduled report"
}
},
"message": "Daily scheduled report is ready for you",
"message_formatted": "<p><strong>Daily scheduled report</strong> is ready for you</p>",
"read": false,
"read_at": null,
"created_at": "2015-07-29 12:24:05"
}
notified_report
When a user is notified about a report.
Sample data
{
"id": "56545e4a-61eb-4a50-aba7-bc28dd158b45",
"type": "notified_report",
"data": {
"user": {
"id": 4,
"first_name": "Bernita",
"last_name": "Kilback",
"profile_picture": "http://api.randomuser.me/portraits/thumb/women/5.jpg"
},
"notified_report": {
"id": "7a9b0140-4e55-4c1b-b027-ce1ace90de88"
}
},
"message": "Bernita Kilback wants you to look at this report <br> Hey John, please have a look!",
"message_formatted": "<p><strong>Bernita Kilback</strong> wants you to look at this report</p><br><p><em>Hey John, please have a look!</em></p>",
"read": false,
"read_at": null,
"created_at": "2015-07-29 12:24:05"
}
campaign_sent
When a campaign is sent.
Sample data
{
"id": "60cd6a85-7302-489b-92b2-6809c9701d4b",
"type": "campaign_sent",
"data": {
"campaign": {
"id": "65c181d6-022a-463b-ad47-2b4e2ca6f7f7",
"name": "Test campaign",
"type": "letter"
}
},
"message": "Your campaign Test campaign has been sent",
"message_formatted": "<p>Your campaign <strong>Test campaign</strong> has been sent</p>",
"read": false,
"read_at": null,
"created_at": "2015-07-29 12:24:05"
}
lead_assigned
When a lead was assigned to a dealership.
Sample data
{
"id": "dd01694c-45ac-451c-ab83-a1863898737b",
"type": "lead_assigned",
"data": {
"lead": {
"id": "220f5f6e-e30f-4c5f-8db5-44e345f8e568"
},
"lead_type": {
"id": "f5d6ccbb-679b-43aa-9716-04ef529789fa",
"name": "Test drive"
}
},
"message": "A Test drive lead, John Doe, was assigned to you",
"message_formatted": "<p>A <strong>Test drive</strong> lead, <strong>John Doe</strong>, was assigned to you</p>",
"read": false,
"read_at": null,
"created_at": "2015-07-29 12:24:05"
}
lead_escalated
When a lead has escalated.
Sample data
{
"id": "ebdbf8bf-4339-47b0-b36c-beb13dbe720c",
"type": "lead_escalated",
"data": {
"lead": {
"id": "220f5f6e-e30f-4c5f-8db5-44e345f8e568"
},
"lead_type": {
"id": "f5d6ccbb-679b-43aa-9716-04ef529789fa",
"name": "Test drive"
}
},
"message": "A Test drive lead was escalated",
"message_formatted": "<p>A <strong>Test drive</strong> lead was escalated</p>",
"read": false,
"read_at": null,
"created_at": "2015-07-29 12:24:05"
}
lead_revoked
When a lead was revoked.
Sample data
{
"id": "52ecfcba-e5da-4b6a-bd74-8f66dea711d1",
"type": "lead_revoked",
"data": {
"lead": {
"id": "220f5f6e-e30f-4c5f-8db5-44e345f8e568"
},
"lead_type": {
"id": "f5d6ccbb-679b-43aa-9716-04ef529789fa",
"name": "Test drive"
}
},
"message": "A Test drive lead was revoked",
"message_formatted": "<p>A <strong>Test drive</strong> lead was revoked</p>",
"read": false,
"read_at": null,
"created_at": "2015-07-29 12:24:05"
}
lead_accepted
When a lead was accepted.
Sample data
{
"id": "b5ef1cc2-17db-4980-8fd1-21ccb25bd119",
"type": "lead_accepted",
"data": {
"lead": {
"id": "220f5f6e-e30f-4c5f-8db5-44e345f8e568"
},
"lead_type": {
"id": "f5d6ccbb-679b-43aa-9716-04ef529789fa",
"name": "Test drive"
},
"case": {
"id": "cd0e2c00-2d73-4cf9-a820-f34a5c8557c3",
"case_number": 1,
"relations_path_name": "Case type"
}
},
"message": "A new lead from Test drive has been accepted for you, by John Doe",
"message_formatted": "<p>A new lead from <strong>Test drive</strong> has been accepted for you, by <strong>John Doe</strong></p>",
"read": false,
"read_at": null,
"created_at": "2015-07-29 12:24:05"
}
case_owner
When a case was assigned to a user.
Sample data
{
"id": "52ecfcba-e5da-4b6a-bd74-8f66dea711d1",
"type": "case_owner",
"data": {
"user": {
"id": 4,
"first_name": "Bernita",
"last_name": "Kilback",
"profile_picture": "http://api.randomuser.me/portraits/thumb/women/5.jpg"
},
"case": {
"id": "eab4f954-28d8-3e9a-b2d0-5e819fccfefd",
"case_number": 7,
"relations_path_name": "Case type"
}
},
"message": "A case on John Doe was assigned to you",
"message_formatted": "<p>A case on <strong>John Doe</strong> was assigned to you</p>",
"read": false,
"read_at": null,
"created_at": "2015-07-29 12:24:05"
}
Gamification
new_level
When a user reach a new level.
Sample data
{
"id": "20cc547b-25cc-429c-8347-6382010943db",
"type": "gamification",
"data": {
"event": {
"type": "new_level"
},
"level": {
"name": "level_2"
}
},
"message": "You have reached level Beginner 2",
"message_formatted": "<p>You have reached level <strong>Beginner 2</strong></p>",
"read": false,
"read_at": null,
"created_at": "2015-07-29 12:24:05"
}
new_rank_first_place
When a user was ranked first ranking.
Sample data
{
"id": "1fedeb66-f1c0-4527-a38b-c84732168d4e",
"type": "gamification",
"data": {
"event": {
"type": "new_rank_first_place"
},
"rank": {
"id": "1d13ad92-c88e-4e18-b5f1-5fb0fe0d1b8a",
"name": "Best salesman",
"icon": "testdrive"
}
},
"message": "You are now ranked first in Best salesman",
"message_formatted": "<p>You are now ranked first in <strong>Best salesman</strong></p>",
"read": false,
"read_at": null,
"created_at": "2015-07-29 12:24:05"
}
badge_achieved
When a user has achieved a badge.
Sample data
{
"id": "1fedeb66-f1c0-4527-a38b-c84732168d4e",
"type": "gamification",
"data": {
"event": {
"type": "badge_achieved"
},
"badge": {
"name": "the_seller"
}
},
"message": "You earned a new badge called The Seller",
"message_formatted": "<p>You earned a new badge called <strong>The Seller</strong></p>",
"read": false,
"read_at": null,
"created_at": "2015-07-29 12:24:05"
}
target_reached
When a user has reached a target.
Sample data
{
"id": "d8916bef-4f2f-413a-8f77-7954cb0f7a8c",
"type": "gamification",
"data": {
"event": {
"type": "target_reached"
},
"target": {
"name": "Milestone",
"title": "Car sale",
"count": "week"
}
},
"message": "You have reached your weekly goal Car sale",
"message_formatted": "<p>You have reached your <strong>weekly</strong> goal <strong>Car sale</strong></p",
"read": false,
"read_at": null,
"created_at": "2015-07-29 12:24:05"
}
High Five
new_level
When a user has high fived a new level notification.
Sample data
{
"id": "84b996b4-6462-4d60-a5a3-d9d70b29c71b",
"type": "high_fived",
"data": {
"user": {
"id": 1,
"first_name": "Jane",
"last_name": "Doe",
"profile_picture": "http://api.randomuser.me/portraits/thumb/women/5.jpg"
},
"event": {
"type": "new_level"
},
"level": {
"name": "level_2"
}
},
"message": "Jane Doe has high fived your new level Beginner 2",
"message_formatted": "<p><strong>Jane Doe</strong> has high fived your new level <strong>Beginner 2</strong></p>",
"read": false,
"read_at": null,
"created_at": "2015-07-29 12:24:05"
}
new_rank_first_place
When a user has high fived a ranked first notification.
Sample data
{
"id": "b0d9be47-9d46-43d8-b8d2-7afc96811f09",
"type": "high_fived",
"data": {
"user": {
"id": 1,
"first_name": "Jane",
"last_name": "Doe",
"profile_picture": "http://api.randomuser.me/portraits/thumb/women/5.jpg"
},
"event": {
"type": "new_rank_first_place"
},
"rank": {
"id": "1d13ad92-c88e-4e18-b5f1-5fb0fe0d1b8a",
"name": "Best salesman",
"icon": "testdrive"
}
},
"message": "Jane Doe has high fived your leadership in Best salesman",
"message_formatted": "<p><strong>Jane Doe</strong> has high fived your leadership in <strong>Best salesman</strong></p>",
"read": false,
"read_at": null,
"created_at": "2015-07-29 12:24:05"
}
badge_achieved
When a user has high fived a badge achievement notification.
Sample data
{
"id": "a58d45f9-819f-4d13-bd85-8dab82aaae55",
"type": "high_fived",
"data": {
"user": {
"id": 1,
"first_name": "Jane",
"last_name": "Doe",
"profile_picture": "http://api.randomuser.me/portraits/thumb/women/5.jpg"
},
"event": {
"type": "badge_achieved"
},
"badge": {
"name": "the_seller"
}
},
"message": "Jane Doe has high fived your new badge The Seller",
"message_formatted": "<p><strong>Jane Doe</strong> has high fived your new badge <strong>The Seller</strong></p>",
"read": false,
"read_at": null,
"created_at": "2015-07-29 12:24:05"
}
target_reached
When a user has reached a target.
Sample data
{
"id": "1b4fe4d9-b0a2-470c-aeb1-2cf95ff262f3",
"type": "high_fived",
"data": {
"user": {
"id": 1,
"first_name": "Jane",
"last_name": "Doe",
"profile_picture": "http://api.randomuser.me/portraits/thumb/women/5.jpg"
},
"event": {
"type": "target_reached"
},
"target": {
"name": "Milestone",
"title": "Car sale",
"count": "week"
}
},
"message": "Jane Doe has high fived your goal achievement for Car sale",
"message_formatted": "<p><strong>Jane Doe</strong> has high fived your goal achievement for <strong>Car sale</strong></p>",
"read": false,
"read_at": null,
"created_at": "2015-07-29 12:24:05"
}
activity_created
When a user has reached a target.
Sample data
{
"id": "fe58d2b9-13a1-43e7-bd32-4ca90643b498",
"type": "high_fived",
"data": {
"user": {
"id": 1,
"first_name": "Jane",
"last_name": "Doe",
"profile_picture": "http://api.randomuser.me/portraits/thumb/women/5.jpg"
},
"event": {
"type": "activity_created"
},
"activities": [
"0f7b8c8c-2797-44d2-bad8-217ed1c71774",
"178ef2f0-65fa-45b6-8ef0-aa4b117ade46"
]
},
"message": "Jane Doe has high fived your Milestone 2, Milestone registration",
"message_formatted": "<p><strong>Jane Doe</strong> has high fived your <strong>Milestone 2, Milestone</strong> registration</p>",
"read": false,
"read_at": null,
"created_at": "2015-07-29 12:24:05"
}