POST Agents/EMail/SendEMails
Some tooltip text!
• 7 minutes to read
• 7 minutes to read
POST /api/v1/Agents/EMail/SendEMails
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/SendEMails?$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
OutgoingConnectionInfo, Emails, SentItemsConnectionInfo
| Property Name | Type | Description |
|---|---|---|
| OutgoingConnectionInfo | EMailConnectionInfo | All information needed to connect to a mailserver |
| Emails | Array | |
| SentItemsConnectionInfo | EMailConnectionInfo | All information needed to connect to a mailserver |
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/SendEMails
Authorization: Basic dGplMDpUamUw
Accept: application/json; charset=utf-8
Accept-Language: sv
Content-Type: application/json; charset=utf-8
{
"OutgoingConnectionInfo": null,
"Emails": [
{
"To": [
{},
{}
],
"Cc": [
{},
{}
],
"Bcc": [
{},
{}
],
"Subject": "provident",
"HTMLBody": "distinctio",
"From": null,
"Sent": "2001-10-05T10:11:00.0373793+02:00",
"Size": 69,
"Priority": "High",
"Flags": "Answered",
"MessageID": "placeat",
"PlainBody": "voluptatem",
"IsSent": true,
"EMailSOInfo": null,
"ServerId": 38,
"Attachments": [
{},
{}
],
"CustomHeaderList": [
{},
{}
],
"FolderName": "Goyette-DuBuque",
"EmailItemId": 761,
"AccountId": 19,
"ReceivedAt": "2021-11-28T10:11:00.0373793+01:00",
"InReplyTo": null,
"RepliedAt": "2023-04-23T10:11:00.0373793+02:00",
"HasCalendarData": false,
"CalMethod": "Add",
"CalReplyStatus": "Accepted"
}
],
"SentItemsConnectionInfo": null
}
Sample response
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
[
{
"To": [
{
"ContactId": 963,
"ContactName": "GlobalCorp Industries",
"PersonId": 951,
"PersonName": "David Martinez",
"AssociateId": 743,
"Address": "david.martinez@globalcorp.com",
"EmailId": 841,
"DuplicatePersonIds": [
812,
132
],
"Name": "Weber Inc and Sons",
"TableRight": null,
"FieldProperties": {
"fieldName": {
"FieldRight": null,
"FieldType": "System.Int32",
"FieldLength": 927
}
}
}
],
"Cc": [
{
"ContactId": 883,
"ContactName": "Acme Corporation",
"PersonId": 146,
"PersonName": "John Anderson",
"AssociateId": 562,
"Address": "john.anderson@acmecorp.com",
"EmailId": 960,
"DuplicatePersonIds": [
708,
852
],
"Name": "Schaden Inc and Sons",
"TableRight": null,
"FieldProperties": {
"fieldName": {
"FieldRight": null,
"FieldType": "System.String",
"FieldLength": 550
}
}
}
],
"Bcc": [
{
"ContactId": 310,
"ContactName": "Sporer, Oberbrunner and Grimes",
"PersonId": 700,
"PersonName": "Kshlerin-Thiel",
"AssociateId": 801,
"Address": "reprehenderit",
"EmailId": 707,
"DuplicatePersonIds": [
714,
841
],
"Name": "Emmerich-Raynor",
"TableRight": null,
"FieldProperties": {
"fieldName": {
"FieldRight": null,
"FieldType": "System.Int32",
"FieldLength": 45
}
}
}
],
"Subject": "Project Status Update",
"HTMLBody": "<html><body><p>Final project status update for Q1.</p></body></html>",
"From": null,
"Sent": "2007-03-29T10:11:00.0373793+02:00",
"Size": 98765,
"Priority": "High",
"Flags": "Answered",
"MessageID": "<20240117120000.msg017@globalcorp.com>",
"PlainBody": "Final project status update for Q1.",
"IsSent": false,
"EMailSOInfo": null,
"ServerId": 877,
"Attachments": [
{
"Description": "Business-focused hybrid matrix",
"Filename": "soluta",
"Size": 497,
"Type": "aliquid",
"Encoding": "voluptas",
"Id": "harum",
"Disposition": "quo",
"IsSafeFileExtension": false,
"Stream": "GIF89....File contents as raw bytes...",
"TableRight": null,
"FieldProperties": {
"fieldName": {
"FieldRight": null,
"FieldType": "System.Int32",
"FieldLength": 838
}
}
}
],
"CustomHeaderList": [
{
"Name": "Heaney, Ruecker and Labadie",
"Values": [
"quis",
"neque"
],
"TableRight": null,
"FieldProperties": {
"fieldName": {
"FieldRight": null,
"FieldType": "System.Int32",
"FieldLength": 980
}
}
},
{
"Name": "Heaney, Ruecker and Labadie",
"Values": [
"quis",
"neque"
],
"TableRight": null,
"FieldProperties": {
"fieldName": {
"FieldRight": null,
"FieldType": "System.Int32",
"FieldLength": 980
}
}
}
],
"FolderName": "Sent Items",
"EmailItemId": 473,
"AccountId": 477,
"ReceivedAt": "2024-10-26T10:11:00.0373793+02:00",
"InReplyTo": null,
"RepliedAt": "2016-11-11T10:11:00.0373793+01:00",
"HasCalendarData": false,
"CalMethod": "Add",
"CalReplyStatus": "Accepted",
"TableRight": null,
"FieldProperties": {
"fieldName": {
"FieldRight": null,
"FieldType": "System.Int32",
"FieldLength": 788
}
}
}
]