Correspondences
A Correspondence is a grouping of e-mail threads. When creating an Activity with Correspondence (without replying to an existing email), a new Correspondence is created. All replies from either EASI'R Users or Contacts are then added to the Correspondence.
When a new incoming reply is added to the correspondence, it's marked as unread. Fetching the specific correspondence will automatically mark it as read.
Each Correspondence also includes counts of total number of emails and attachments.
The users
property on a Correspondence will include all the users that have been involved. All these users will see the Correspondence in their inbox. For example, if a co-worker is on holiday, another EASI'R team member can go to the Case and reply to emails. Both users will then be notified of incoming mails and be able to see the Correspondence in their inbox.
Get all correspondences
GET /correspondences
When fetching this endpoint, each correspondence will only include the latest email from the correspondence instead of every email (the email
property), which you can get by fetching a specific correspondence.
Query string parameters
contact_id
stringcase_id
stringshow
string - Show only unread or all.unread
- default:
null
- Supports Searching
- Supports Pagination
Response
Status code 200
{
"data": [
{
"id": "8c03f778-b6b1-4f5d-8f49-f88a05994ca5",
"unread": false,
"number_of_emails": 2,
"number_of_attachments": 1,
"email": {
"id": "970ff008-18c8-4420-84b3-d9a25fbc9dab",
"activity_id": "22179ccb-664f-4f68-b595-0f6db51b5138",
"correspondence_id": "8c03f778-b6b1-4f5d-8f49-f88a05994ca5",
"user": {
"id": 2938,
"first_name": "Jane",
"last_name": "Doe",
"phone_number": null,
"job_title": "Sales Executive",
"email": "demo@easir.com",
"email_notifications": false,
"profile_picture": "https://example.com/images/jd.jpg",
"created_at": "2014-01-01 12:45:56",
"updated_at": "2017-03-02 15:08:29"
},
"contacts": [
{
"id": "80079efc-a235-426f-922a-215fb2b0aeb8",
"b2c": true,
"account": {
"id": "3cb87c2f-0feb-3b10-90a1-b5d01bb3eb69",
"name": "Private"
},
"user": {
"id": 2938,
"first_name": "Jane",
"last_name": "Doe",
"phone_number": null,
"job_title": "Sales Executive",
"email": "demo@easir.com",
"email_notifications": false,
"profile_picture": "https://example.com/images/jd.jpg",
"created_at": "2014-01-01 12:45:56",
"updated_at": "2017-03-02 15:08:29"
},
"team_id": null,
"team": null,
"status": "lead",
"fixed_fields": [
{
"id": 19,
"type": "text",
"name": "last_name",
"label": "Last name",
"value": "Daniels",
"validation": null,
"required": true,
"hidden": false,
"read_only": false,
"sort_order": 0
},
{
"id": 18,
"type": "text",
"name": "first_name",
"label": "First name",
"value": "Jack",
"validation": null,
"required": true,
"hidden": false,
"read_only": false,
"sort_order": 0
},
{
"id": 20,
"type": "text",
"name": "email",
"label": "Email",
"value": "jd@example.com",
"validation": "email",
"required": false,
"hidden": false,
"read_only": false,
"sort_order": 0
},
],
"custom_fields": [
],
"created_at": "2017-03-03 10:32:13",
"updated_at": "2017-03-03 10:32:13",
"latest_activity_at": "2017-03-03 10:32:23",
"social_profile": {
}
}
],
"case_id": "a45bf2af-fd18-4c3d-a039-11c0a1205ecc",
"relations_path_name": "Case type",
"type": "activity-incoming",
"sender": "jd@example.com",
"from": [
{
"email_address": "jd@example.com",
"account": {
"id": "3cb87c2f-0feb-3b10-90a1-b5d01bb3eb69",
"name": "Private"
},
"contact": {
"id": "80079efc-a235-426f-922a-215fb2b0aeb8",
"name": "Jack Daniels"
}
}
],
"recipients": [
{
"user_id": 2938
}
],
"cc": [
],
"bcc": [
],
"subject": "Re: Followup from Monday meeting",
"attachments": null,
"content": "Hi again Jane, that sounds good. Thank you!<br \/>\r\n<br \/>\r\nRegards, Jack<br \/>\r\n<br \/>\r\n> On 28 Feb 2017, at 13.50, Jane Doe <demo@easir.com> wrote:<br \/>\r\n >Hi Jack, thanks for stopping by!<br \/>\r\n> You mentioned you were very interested in the C63 model, so I've attached some more details about that.<br \/>\r\n >Hope you like it!<br \/>\r\n >Regards, Jane",
"parsed": {
"fragments": [
{
"content": "Hi again Jane, that sounds good. Thank you!<br \/>\r\n<br \/>\n\r<br \/>\n<br \/>\nRegards, Jack<br \/>\r\n<br \/>\n\r<br \/>\n",
"is_hidden": false,
"is_signature": false,
"is_quoted": false
},
{
"content": "> On 28 Feb 2017, at 13.50, Jane Doe <demo@easir.com> wrote:<br \/>\r\n >Hi Jack, thanks for stopping by!<br \/>\r\n> You mentioned you were very interested in the C63 model, so I've attached some more details about that.<br \/>\r\n >Hope you like it!<br \/>\r\n<br \/>\n >Regards, Jane",
"is_hidden": true,
"is_signature": false,
"is_quoted": true
}
],
"visible_text": "Hi again Jane, that sounds good. Thank you!<br \/>\r\n<br \/>\n\r<br \/>\n<br \/>\nRegards, Jack<br \/>\r\n<br \/>\n\r<br \/>\n<br \/>"
},
"body": null,
"sent_at": null,
"created_at": "2017-03-03 10:38:48",
"updated_at": "2017-03-03 10:38:48"
},
"users": [
{
"id": 2938,
"first_name": "Jane",
"last_name": "Doe",
"phone_number": null,
"job_title": "Sales Executive",
"email": "demo@easir.com",
"email_notifications": false,
"profile_picture": "https://example.com/images/jd.jpg",
"created_at": "2014-01-01 12:45:56",
"updated_at": "2017-03-02 15:08:29"
},
{
"id": 434298,
"first_name": "Michael",
"last_name": "O'Keefe",
"phone_number": null,
"job_title": "Sales Associate",
"email": "michael@easir.com",
"email_notifications": false,
"profile_picture": "https://example.com/images/mok.jpg",
"created_at": "2014-01-01 12:45:56",
"updated_at": "2017-03-02 15:08:29"
}
],
"created_at": "2017-03-03 10:34:58",
"updated_at": "2017-03-03 10:38:49"
}
],
"pagination": {
"total": 1,
"page": 1,
"per_page": 15,
"urls": {
"previous": null,
"next": null
}
}
}
Get a correspondence
GET /correspondences/:correspondence_id
When fetching a correspondence it will be marked as read.
Query string parameters
- Supports Pagination
Properties on emails
user
- An object containing the user who sent the original email, and is the "owner" of the thread.contacts
- An array of all contacts mentioned in thefrom
,recipients
,cc
,bcc
arrays.type
- See the Email Types section below.from
- Information about who sent an email. Can reference users, contacts or a regular e-mail address. See thefrom
format section below.recipients
,cc
,bcc
- Information about who recieves the email. See thefrom
format section below.attachments
- If attachments are present, an array of attachment entities.content
- On outgoing emails, the content of the email excluding the template. On incoming emails, the plaintext content.body
- On outgoing emails, the content of the email including the template. On incoming emails, the html content.parsed
- An object containing an array of the email content parts (e.g. main content, reply, quoted)
Email Types
activity-outgoing
- Outgoing emails, created a new correspondence.activity-outgoing-reply
- Reply to an incoming email, appended to correspondence.activity-incoming
- Incoming emails, appended to correspondence.
from
, recipients
, cc
, bcc
format
Here's an example showcasing the 3 different types of senders that can appear in the from
array.
An incoming email from a contact that could be successfully mapped back to a contact in EASI'R:
{
"from": [
{
"email_address": "jd@example.com",
"account": {
"id": "3cb87c2f-0feb-3b10-90a1-b5d01bb3eb69",
"name": "Private"
},
"contact": {
"id": "80079efc-a235-426f-922a-215fb2b0aeb8",
"name": "Jack Daniels"
}
}
]
}
An incoming email could not be mapped back to a contact since the e-mail address is unknown:
{
"from": [
{
"email_address": "unknown.contact@example.com"
}
]
}
How the from
array in outgoing emails typically look:
{
"from": [
{
"user_id": 29383545
}
]
}
Response
Status code 200
{
"correspondence": {
"id": "8c03f778-b6b1-4f5d-8f49-f88a05994ca5",
"unread": true,
"number_of_emails": 2,
"number_of_attachments": 1,
"users": [
{
"id": 2938,
"first_name": "Jane",
"last_name": "Doe",
"phone_number": null,
"job_title": "Sales Executive",
"email": "demo@easir.com",
"email_notifications": false,
"profile_picture": "https://example.com/images/jd.jpg",
"created_at": "2014-01-01 12:45:56",
"updated_at": "2017-03-02 15:08:29"
},
{
"id": 434298,
"first_name": "Michael",
"last_name": "O'Keefe",
"phone_number": null,
"job_title": "Sales Associate",
"email": "michael@easir.com",
"email_notifications": false,
"profile_picture": "https://example.com/images/mok.jpg",
"created_at": "2014-01-01 12:45:56",
"updated_at": "2017-03-02 15:08:29"
}
],
"created_at": "2017-03-03 10:34:58",
"updated_at": "2017-03-03 10:38:49"
},
"data": [
{
"id": "970ff008-18c8-4420-84b3-d9a25fbc9dab",
"activity_id": "22179ccb-664f-4f68-b595-0f6db51b5138",
"correspondence_id": "8c03f778-b6b1-4f5d-8f49-f88a05994ca5",
"user": {
"id": 2938,
"first_name": "Jane",
"last_name": "Doe",
"phone_number": null,
"job_title": "Sales Executive",
"email": "demo@easir.com",
"email_notifications": false,
"profile_picture": "https://example.com/images/jd.jpg",
"created_at": "2014-01-01 12:45:56",
"updated_at": "2017-03-02 15:08:29"
},
"contacts": [
{
"id": "80079efc-a235-426f-922a-215fb2b0aeb8",
"b2c": true,
"account": {
"id": "3cb87c2f-0feb-3b10-90a1-b5d01bb3eb69",
"name": "Private"
},
"user": {
"id": 2938,
"first_name": "Jane",
"last_name": "Doe",
"phone_number": null,
"job_title": "Sales Executive",
"email": "demo@easir.com",
"email_notifications": false,
"profile_picture": "https://example.com/images/jd.jpg",
"created_at": "2014-01-01 12:45:56",
"updated_at": "2017-03-02 15:08:29"
},
"team_id": null,
"team": null,
"status": "lead",
"fixed_fields": [
{
"id": 19,
"type": "text",
"name": "last_name",
"label": "Last name",
"value": "Daniels",
"validation": null,
"required": true,
"hidden": false,
"read_only": false,
"sort_order": 0
},
{
"id": 18,
"type": "text",
"name": "first_name",
"label": "First name",
"value": "Jack",
"validation": null,
"required": true,
"hidden": false,
"read_only": false,
"sort_order": 0
},
{
"id": 20,
"type": "text",
"name": "email",
"label": "Email",
"value": "jd@example.com",
"validation": "email",
"required": false,
"hidden": false,
"read_only": false,
"sort_order": 0
},
],
"custom_fields": [
],
"created_at": "2017-03-03 10:32:13",
"updated_at": "2017-03-03 10:32:13",
"latest_activity_at": "2017-03-03 10:32:23",
"social_profile": {
}
}
],
"case_id": "a45bf2af-fd18-4c3d-a039-11c0a1205ecc",
"relations_path_name": "Case type",
"type": "activity-incoming",
"sender": "jd@example.com",
"from": [
{
"email_address": "jd@example.com",
"account": {
"id": "3cb87c2f-0feb-3b10-90a1-b5d01bb3eb69",
"name": "Private"
},
"contact": {
"id": "80079efc-a235-426f-922a-215fb2b0aeb8",
"name": "Jack Daniels"
}
}
],
"recipients": [
{
"user_id": 2938
}
],
"cc": [
],
"bcc": [
],
"subject": "Re: Followup from Monday meeting",
"attachments": null,
"content": "Hi again Jane, that sounds good. Thank you!",
"parsed": {
"fragments": [
{
"content": "Hi again Jane, that sounds good. Thank you!",
"is_hidden": false,
"is_signature": false,
"is_quoted": false
},
{
"content": ">Hi Jack, thanks for stopping by!",
"is_hidden": true,
"is_signature": false,
"is_quoted": true
}
],
"visible_text": "Hi again Jane, that sounds good. Thank you!"
},
"body": null,
"sent_at": null,
"created_at": "2017-03-03 10:38:48",
"updated_at": "2017-03-03 10:38:48"
},
{
"id": "6b9ed95d-1fb4-4a70-adf9-29fbaad3872a",
"activity_id": "22179ccb-664f-4f68-b595-0f6db51b5138",
"correspondence_id": "8c03f778-b6b1-4f5d-8f49-f88a05994ca5",
"user": {
"id": 2938,
"first_name": "Jane",
"last_name": "Doe",
"phone_number": null,
"job_title": "Sales Executive",
"email": "demo@easir.com",
"email_notifications": false,
"profile_picture": "https://example.com/images/jd.jpg",
"created_at": "2014-01-01 12:45:56",
"updated_at": "2017-03-02 15:08:29"
},
"contacts": [
{
"id": "80079efc-a235-426f-922a-215fb2b0aeb8",
"b2c": true,
"account": {
"id": "3cb87c2f-0feb-3b10-90a1-b5d01bb3eb69",
"name": "Private"
},
"user": {
"id": 2938,
"first_name": "Jane",
"last_name": "Doe",
"phone_number": null,
"job_title": "Sales Executive",
"email": "demo@easir.com",
"email_notifications": false,
"profile_picture": "https://example.com/images/jd.jpg",
"created_at": "2014-01-01 12:45:56",
"updated_at": "2017-03-02 15:08:29"
},
"team_id": null,
"team": null,
"status": "lead",
"fixed_fields": [
{
"id": 19,
"type": "text",
"name": "last_name",
"label": "Last name",
"value": "Daniels",
"validation": null,
"required": true,
"hidden": false,
"read_only": false,
"sort_order": 0
},
{
"id": 18,
"type": "text",
"name": "first_name",
"label": "First name",
"value": "Jack",
"validation": null,
"required": true,
"hidden": false,
"read_only": false,
"sort_order": 0
},
{
"id": 20,
"type": "text",
"name": "email",
"label": "Email",
"value": "jd@example.com",
"validation": "email",
"required": false,
"hidden": false,
"read_only": false,
"sort_order": 0
},
],
"custom_fields": [
],
"created_at": "2017-03-03 10:32:13",
"updated_at": "2017-03-03 10:32:13",
"latest_activity_at": "2017-03-03 10:32:23",
"social_profile": {
}
}
],
"case_id": "a45bf2af-fd18-4c3d-a039-11c0a1205ecc",
"relations_path_name": "Case type",
"type": "activity-outgoing",
"sender": "demo@easir.com",
"from": [
{
"user_id": 2938
}
],
"recipients": [
{
"email_address": "jd@example.com",
"contact": {
"id": "80079efc-a235-426f-922a-215fb2b0aeb8",
"name": "Jack Daniels"
},
"account": {
"id": "3cb87c2f-0feb-3b10-90a1-b5d01bb3eb69",
"name": "Private"
}
}
],
"cc": [
{
"email_address": "management@example.com"
}
],
"bcc": [
],
"subject": "Followup from Monday meeting",
"attachments": [
{
"id": "2e940e81-db91-4733-b536-2968191efaee",
"name": "example",
"type": "pdf",
"size": 33103,
"created_at": "2017-03-03 10:34:59",
"updated_at": "2017-03-03 10:34:59",
"user_id": 2938,
"user": {
"id": 2938,
"first_name": "Jane",
"last_name": "Doe",
"phone_number": null,
"job_title": "Sales Executive",
"email": "demo@easir.com",
"email_notifications": false,
"profile_picture": "https://example.com/images/jd.jpg",
"created_at": "2014-01-01 12:45:56",
"updated_at": "2017-03-02 15:08:29"
},
"case_id": "a45bf2af-fd18-4c3d-a039-11c0a1205ecc",
"email_id": "6b9ed95d-1fb4-4a70-adf9-29fbaad3872a",
"activity_id": "22179ccb-664f-4f68-b595-0f6db51b5138"
}
],
"content": "Hi Jack, thanks for stopping by!<br \/>You mentioned you were very interested in the C63 model, so I've attached some more details about that.<br \/>Hope you like it!<br \/>Regards, Jane",
"parsed": {
"fragments": [
{
"content": "Hi Jack, thanks for stopping by!<br \/>\r\nYou mentioned you were very interested in the C63 model, so I've attached some more details about that.<br \/>\r\nHope you like it!<br \/>\r\nRegards, Jane",
"is_hidden": false,
"is_signature": false,
"is_quoted": false
}
],
"visible_text": "Hi Jack, thanks for stopping by!<br \/>\r\nYou mentioned you were very interested in the C63 model, so I've attached some more details about that.<br \/>\r\nHope you like it!<br \/>\r\nRegards, Jane"
},
"body": "<html><head><title>Main Email Template</title></head><body>Hi Jack, thanks for stopping by!<br \/>You mentioned you were very interested in the C63 model, so I've attached some more details about that.<br \/>Hope you like it!<br \/>Regards, Jane</body></html>",
"sent_at": null,
"created_at": "2017-03-03 10:34:58",
"updated_at": "2017-03-03 10:34:58"
}
],
"pagination": {
"total": 2,
"page": 1,
"per_page": 15,
"urls": {
"previous": null,
"next": null
}
}
}
Notify about a correspondence
POST /correspondences/:correspondence_id/notify
Notify a user, or all users in a team, about a correspondence.
Parameters
message
string - Write a message to the user/users.- Required
notify.users
array- Must be present if
notify.teams
is not present
- Must be present if
notify.teams
array- Must be present if
notify.users
is not present.
- Must be present if
Payload
{
"message": "Hi! Check this correspondence out!",
"notify": {
"users": [1, 6, 4],
"teams": [1]
}
}
Response
Status code 204