POST Agents/EMail/GetEMailFromId
Some tooltip text!
• 6 minutes to read
• 6 minutes to read
POST /api/v1/Agents/EMail/GetEMailFromId
Get en e-mail based on its unique id
NsApiSlow threshold: 5000 ms.
Online Restricted: ## The EMail agent is not available in Online by default. Access must be requested specifically when app is registered.
Query String Parameters
| Parameter Name | Type | Description |
|---|---|---|
| $select | string | Optional comma separated list of properties to include in the result. Other fields are then nulled out to reduce payload size: "Name,department,category". Default = show all fields. |
POST /api/v1/Agents/EMail/GetEMailFromId?$select=name,department,category/id
Request Headers
| Parameter Name | Description |
|---|---|
| Authorization | Supports 'Basic', 'SoTicket' and 'Bearer' schemes, depending on installation type. |
| X-XSRF-TOKEN | If not using Authorization header, you must provide XSRF value from cookie or hidden input field |
| Content-Type | Content-type of the request body: application/json, text/json, application/xml, text/xml, application/x-www-form-urlencoded, application/json-patch+json, application/merge-patch+json |
| Accept | Content-type(s) you would like the response in: application/json, text/json, application/xml, text/xml, application/json-patch+json, application/merge-patch+json |
| Accept-Language | Convert string references and multi-language values into a specified language (iso2) code. |
| SO-Language | Convert string references and multi-language values into a specified language (iso2) code. Overrides Accept-Language value. |
| SO-Culture | Number, date formatting in a specified culture (iso2 language) code. Partially overrides SO-Language/Accept-Language value. Ignored if no Language set. |
| SO-TimeZone | Specify the timezone code that you would like date/time responses converted to. |
| SO-AppToken | The application token that identifies the partner app. Used when calling Online WebAPI from a server. |
Request Body: request
ConnectionInfo, MessageServerId, LookupAddresses, Flags, IncludeAttachments
| Property Name | Type | Description |
|---|---|---|
| ConnectionInfo | EMailConnectionInfo | All information needed to connect to a mailserver |
| MessageServerId | Integer | |
| LookupAddresses | Boolean | |
| Flags | String | |
| IncludeAttachments | Boolean |
Response:
OK
| Response | Description |
|---|---|
| 200 | OK |
Response body: EMailEntity
| Property Name | Type | Description |
|---|---|---|
| To | array | To recipients of e-mail |
| Cc | array | Cc recipients of e-mail |
| Bcc | array | Bcc recipient of e-mail |
| Subject | string | Subject of the e-mail |
| HTMLBody | string | Body formatted in HTML |
| From | EMailAddress | Who did the e-mail originate from |
| Sent | date-time | When was the e-mail sent |
| Size | int32 | Total size of the e-mail |
| Priority | string | Importance of the e-mail |
| Flags | string | Flag status of this mail (unread, replied, deleted ) |
| MessageID | string | Unique id of e-mails |
| PlainBody | string | Body formatted in plain text |
| IsSent | bool | Is this a sent e-mail (not new) |
| EMailSOInfo | EMailSOInfo | Glue between SuperOffice data and an e-mail. |
| ServerId | int32 | Unique id for the e-mail on the server |
| Attachments | array | |
| CustomHeaderList | array | Non standard e-mail headers |
| FolderName | string | Name of folder the e-mail belongs in |
| EmailItemId | int32 | Primary key |
| AccountId | int32 | Account Id |
| ReceivedAt | date-time | Received date time |
| InReplyTo | EMailEnvelope | The envelope of the email this email is a reply to, if it exists |
| RepliedAt | date-time | When this email was replied at |
| HasCalendarData | bool | If this email contains exactly one iCal appointment |
| CalMethod | string | Method stored in the associated iCal appointment. Indicates if the iCal data is a reply, counter proposal etc. |
| CalReplyStatus | string | Reply status stored in calendar data for the ical method is REPLY |
| TableRight | TableRight | The carrier's table right |
| FieldProperties | object | Field property dictionary mapping field names to field access rights. |
Sample request
POST /api/v1/Agents/EMail/GetEMailFromId
Authorization: Basic dGplMDpUamUw
Accept: application/json; charset=utf-8
Accept-Language: en
Content-Type: application/json; charset=utf-8
{
"ConnectionInfo": null,
"MessageServerId": 600,
"LookupAddresses": false,
"Flags": "Answered",
"IncludeAttachments": false
}
Sample response
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"To": [
{
"ContactId": 622,
"ContactName": "TechCorp Solutions",
"PersonId": 212,
"PersonName": "Sarah Johnson",
"AssociateId": 734,
"Address": "sarah.johnson@techcorp.com",
"EmailId": 46,
"DuplicatePersonIds": [
887,
443
],
"Name": "Sarah Johnson",
"TableRight": null,
"FieldProperties": {
"fieldName": {
"FieldRight": null,
"FieldType": "System.Int32",
"FieldLength": 43
}
}
}
],
"Cc": [
{
"ContactId": 449,
"ContactName": "GlobalCorp Industries",
"PersonId": 143,
"PersonName": "David Martinez",
"AssociateId": 284,
"Address": "david.martinez@globalcorp.com",
"EmailId": 150,
"DuplicatePersonIds": [
23,
343
],
"Name": "David Martinez",
"TableRight": null,
"FieldProperties": {
"fieldName": {
"FieldRight": null,
"FieldType": "System.Int32",
"FieldLength": 472
}
}
}
],
"Bcc": [
{
"ContactId": 445,
"ContactName": "Nordic Solutions AS",
"PersonId": 465,
"PersonName": "Robert Hansen",
"AssociateId": 848,
"Address": "robert.hansen@nordicsolutions.no",
"EmailId": 668,
"DuplicatePersonIds": [
441,
357
],
"Name": "Robert Hansen",
"TableRight": null,
"FieldProperties": {
"fieldName": {
"FieldRight": null,
"FieldType": "System.Int32",
"FieldLength": 161
}
}
}
],
"Subject": "Monthly Report - November 2024",
"HTMLBody": "<p>Hi Sarah,</p><p>Please find attached the monthly report for November 2024. Let me know if you need any clarifications.</p><p>Regards,<br>John</p>",
"From": null,
"Sent": "2024-12-30T10:11:00.0373793+01:00",
"Size": 852,
"Priority": "High",
"Flags": "Answered",
"MessageID": "<20241230101100.89012@acmecorp.com>",
"PlainBody": "Hi Sarah,\n\nPlease find attached the monthly report for November 2024. Let me know if you need any clarifications.\n\nRegards,\nJohn",
"IsSent": true,
"EMailSOInfo": null,
"ServerId": 552,
"Attachments": [
{
"Description": "Monthly Report November 2024",
"Filename": "Monthly_Report_November_2024.pdf",
"Size": 247,
"Type": "application/pdf",
"Encoding": "base64",
"Id": "att_20241130_007",
"Disposition": "attachment",
"IsSafeFileExtension": true,
"Stream": "GIF89....File contents as raw bytes...",
"TableRight": null,
"FieldProperties": {
"fieldName": {
"FieldRight": null,
"FieldType": "System.String",
"FieldLength": 666
}
}
}
],
"CustomHeaderList": [
{
"Name": "X-Report-Type",
"Values": [
"Monthly",
"Financial"
],
"TableRight": null,
"FieldProperties": {
"fieldName": {
"FieldRight": null,
"FieldType": "System.Int32",
"FieldLength": 45
}
}
},
{
"Name": "X-Document-ID",
"Values": [
"RPT-2024-11",
"November"
],
"TableRight": null,
"FieldProperties": {
"fieldName": {
"FieldRight": null,
"FieldType": "System.Int32",
"FieldLength": 45
}
}
}
],
"FolderName": "Reports",
"EmailItemId": 566,
"AccountId": 191,
"ReceivedAt": "2021-12-18T10:11:00.0373793+01:00",
"InReplyTo": null,
"RepliedAt": "2018-01-25T10:11:00.0373793+01:00",
"HasCalendarData": true,
"CalMethod": "Add",
"CalReplyStatus": "Accepted",
"TableRight": null,
"FieldProperties": {
"fieldName": {
"FieldRight": null,
"FieldType": "System.String",
"FieldLength": 565
}
}
}