POST Agents/EMail/GetEMail
Some tooltip text!
• 6 minutes to read
• 6 minutes to read
POST /api/v1/Agents/EMail/GetEMail
Get en e-mail based on its primary key in the DB
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/GetEMail?$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
Id, IncludeAttachments
| Property Name | Type | Description |
|---|---|---|
| Id | Integer | |
| 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/GetEMail
Authorization: Basic dGplMDpUamUw
Accept: application/json; charset=utf-8
Accept-Language: sv
Content-Type: application/json; charset=utf-8
{
"Id": 33,
"IncludeAttachments": false
}
Sample response
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"To": [
{
"ContactId": 599,
"ContactName": "Nordic Solutions AS",
"PersonId": 410,
"PersonName": "Anna Berg",
"AssociateId": 758,
"Address": "anna.berg@nordicsolutions.no",
"EmailId": 407,
"DuplicatePersonIds": [
399,
262
],
"Name": "Anna Berg",
"TableRight": null,
"FieldProperties": {
"fieldName": {
"FieldRight": null,
"FieldType": "System.String",
"FieldLength": 37
}
}
}
],
"Cc": [
{
"ContactId": 818,
"ContactName": "Acme Corporation",
"PersonId": 942,
"PersonName": "Robert Hansen",
"AssociateId": 784,
"Address": "robert.hansen@acmecorp.com",
"EmailId": 453,
"DuplicatePersonIds": [
430,
5
],
"Name": "Robert Hansen",
"TableRight": null,
"FieldProperties": {
"fieldName": {
"FieldRight": null,
"FieldType": "System.Int32",
"FieldLength": 716
}
}
}
],
"Bcc": [
{
"ContactId": 252,
"ContactName": "TechCorp Solutions",
"PersonId": 557,
"PersonName": "Emily Wilson",
"AssociateId": 81,
"Address": "emily.wilson@techcorp.com",
"EmailId": 928,
"DuplicatePersonIds": [
197,
660
],
"Name": "Emily Wilson",
"TableRight": null,
"FieldProperties": {
"fieldName": {
"FieldRight": null,
"FieldType": "System.Int32",
"FieldLength": 323
}
}
}
],
"Subject": "FW: Budget Approval - Q2 2024",
"HTMLBody": "<p>Hi Anna,</p><p>Please find attached the budget approval documentation for Q2 2024. Let me know if you have any questions.</p><p>Best,<br>John</p>",
"From": null,
"Sent": "2017-01-22T10:11:00.0948142+01:00",
"Size": 922,
"Priority": "High",
"Flags": "Answered",
"MessageID": "<20170122101100.67890@acmecorp.com>",
"PlainBody": "Hi Anna,\n\nPlease find attached the budget approval documentation for Q2 2024. Let me know if you have any questions.\n\nBest,\nJohn",
"IsSent": true,
"EMailSOInfo": null,
"ServerId": 605,
"Attachments": [
{
"Description": "Q2 Budget Approval Document",
"Filename": "Budget_Approval_Q2_2024.xlsx",
"Size": 960,
"Type": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
"Encoding": "base64",
"Id": "att_20240122_002",
"Disposition": "attachment",
"IsSafeFileExtension": true,
"Stream": "GIF89....File contents as raw bytes...",
"TableRight": null,
"FieldProperties": {
"fieldName": {
"FieldRight": null,
"FieldType": "System.Int32",
"FieldLength": 245
}
}
}
],
"CustomHeaderList": [
{
"Name": "Reply-To",
"Values": [
"john.anderson@acmecorp.com",
"John Anderson"
],
"TableRight": null,
"FieldProperties": {
"fieldName": {
"FieldRight": null,
"FieldType": "System.Int32",
"FieldLength": 506
}
}
},
{
"Name": "X-Original-Sender",
"Values": [
"john.anderson@acmecorp.com",
"Acme Corporation"
],
"TableRight": null,
"FieldProperties": {
"fieldName": {
"FieldRight": null,
"FieldType": "System.Int32",
"FieldLength": 506
}
}
}
],
"FolderName": "Sent Items",
"EmailItemId": 178,
"AccountId": 367,
"ReceivedAt": "2023-09-29T10:11:00.0948142+02:00",
"InReplyTo": null,
"RepliedAt": "2025-06-02T10:11:00.0948142+02:00",
"HasCalendarData": false,
"CalMethod": "Add",
"CalReplyStatus": "Accepted",
"TableRight": null,
"FieldProperties": {
"fieldName": {
"FieldRight": null,
"FieldType": "System.Int32",
"FieldLength": 532
}
}
}