POST Agents/EMail/Send
Some tooltip text!
• 7 minutes to read
• 7 minutes to read
POST /api/v1/Agents/EMail/Send
Send the provided e-mails
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/Send?$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
Emails
| Property Name | Type | Description |
|---|---|---|
| Emails | Array |
Response:array
OK
| Response | Description |
|---|---|
| 200 | OK |
Response body: array
| 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/Send
Authorization: Basic dGplMDpUamUw
Accept: application/json; charset=utf-8
Accept-Language: *
Content-Type: application/json; charset=utf-8
{
"Emails": [
{
"To": [
{},
{}
],
"Cc": [
{},
{}
],
"Bcc": [
{},
{}
],
"Subject": "qui",
"HTMLBody": "ut",
"From": null,
"Sent": "2019-04-17T10:10:59.880413+02:00",
"Size": 804,
"Priority": "High",
"Flags": "Answered",
"MessageID": "veritatis",
"PlainBody": "corrupti",
"IsSent": false,
"EMailSOInfo": null,
"ServerId": 404,
"Attachments": [
{},
{}
],
"CustomHeaderList": [
{},
{}
],
"FolderName": "Murazik-Roberts",
"EmailItemId": 246,
"AccountId": 592,
"ReceivedAt": "2019-08-28T10:10:59.8814585+02:00",
"InReplyTo": null,
"RepliedAt": "2020-10-29T10:10:59.8814585+01:00",
"HasCalendarData": false,
"CalMethod": "Add",
"CalReplyStatus": "Accepted"
}
]
}
Sample response
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
[
{
"To": [
{
"ContactId": 935,
"ContactName": "GlobalCorp Industries",
"PersonId": 760,
"PersonName": "David Martinez",
"AssociateId": 252,
"Address": "david.martinez@globalcorp.com",
"EmailId": 414,
"DuplicatePersonIds": [
633,
377
],
"Name": "David Martinez",
"TableRight": null,
"FieldProperties": {
"fieldName": {
"FieldRight": null,
"FieldType": "System.String",
"FieldLength": 288
}
}
}
],
"Cc": [
{
"ContactId": 481,
"ContactName": "Nordic Solutions AS",
"PersonId": 484,
"PersonName": "Linda Chen",
"AssociateId": 424,
"Address": "linda.chen@nordicsolutions.no",
"EmailId": 42,
"DuplicatePersonIds": [
465,
870
],
"Name": "Linda Chen",
"TableRight": null,
"FieldProperties": {
"fieldName": {
"FieldRight": null,
"FieldType": "System.String",
"FieldLength": 747
}
}
}
],
"Bcc": [
{
"ContactId": 451,
"ContactName": "TechCorp Solutions",
"PersonId": 307,
"PersonName": "Sarah Johnson",
"AssociateId": 645,
"Address": "sarah.johnson@techcorp.com",
"EmailId": 526,
"DuplicatePersonIds": [
462,
279
],
"Name": "Sarah Johnson",
"TableRight": null,
"FieldProperties": {
"fieldName": {
"FieldRight": null,
"FieldType": "System.Int32",
"FieldLength": 349
}
}
}
],
"Subject": "Meeting Agenda - Product Roadmap Discussion",
"HTMLBody": "<p>Hi David,</p><p>I'm sending you the agenda for tomorrow's product roadmap discussion meeting. Please review the attached materials before the meeting.</p><p>Thanks,<br>John</p>",
"From": null,
"Sent": "2008-05-14T10:10:59.8844586+02:00",
"Size": 852,
"Priority": "High",
"Flags": "Answered",
"MessageID": "<20080514101059.34567@acmecorp.com>",
"PlainBody": "Hi David,\n\nI'm sending you the agenda for tomorrow's product roadmap discussion meeting. Please review the attached materials before the meeting.\n\nThanks,\nJohn",
"IsSent": false,
"EMailSOInfo": null,
"ServerId": 386,
"Attachments": [
{
"Description": "Product Roadmap Meeting Agenda",
"Filename": "Meeting_Agenda_Product_Roadmap.docx",
"Size": 845,
"Type": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
"Encoding": "base64",
"Id": "att_20080514_003",
"Disposition": "attachment",
"IsSafeFileExtension": true,
"Stream": "GIF89....File contents as raw bytes...",
"TableRight": null,
"FieldProperties": {
"fieldName": {
"FieldRight": null,
"FieldType": "System.Int32",
"FieldLength": 84
}
}
}
],
"CustomHeaderList": [
{
"Name": "X-Meeting-Request",
"Values": [
"true",
"2024-05-15T10:00:00"
],
"TableRight": null,
"FieldProperties": {
"fieldName": {
"FieldRight": null,
"FieldType": "System.Int32",
"FieldLength": 1002
}
}
},
{
"Name": "X-Calendar-Invite",
"Values": [
"REQUEST",
"VEVENT"
],
"TableRight": null,
"FieldProperties": {
"fieldName": {
"FieldRight": null,
"FieldType": "System.Int32",
"FieldLength": 1002
}
}
}
],
"FolderName": "Drafts",
"EmailItemId": 750,
"AccountId": 483,
"ReceivedAt": "2015-03-19T10:10:59.8844586+01:00",
"InReplyTo": null,
"RepliedAt": "2018-08-03T10:10:59.8844586+02:00",
"HasCalendarData": true,
"CalMethod": "Add",
"CalReplyStatus": "Accepted",
"TableRight": null,
"FieldProperties": {
"fieldName": {
"FieldRight": null,
"FieldType": "System.String",
"FieldLength": 197
}
}
}
]