Email Management API
This is a technical guide on the development of OElite Management Portal.
Production API Endpoint | https://ama-beta.api.oelite.io |
|---|---|
Production API Swagger |
Email Accounts
{
"data":[
{
"name":"Test User",
"displayName":"Test User",
"isExternalAccount":false,
"emailAddress":"[email protected]",
"integratedMailAccountUserId":"635b6d31a3ea7b3fa0fb93f5",
"outgoingMailServerPort":0,
"sslEnabled":false,
"ownerAccountId":121,
"ownerUserId":323,
"createdOnUtc":"2022-09-09T17:40:49Z",
"incomingMailServerPort":0,
"sharedUserId":0,
"canRead":true,
"canWrite":true,
"canDelete":true,
"sharedUserStatus":10,
"searchIndexAllowed":true,
"id":1,
"status":0,
"baseSearchCount":0,
"searchIndexId":"1",
"isDeleted":false
},
{
"name":"Test Shared",
"displayName":" Test Shared",
"isExternalAccount":false,
"integratedMailAccountUserId":"621b6dab5c20c8b24be9f00d",
"outgoingMailServerPort":0,
"sslEnabled":false,
"ownerAccountId":121,
"ownerUserId":323,
"createdOnUtc":"2022-09-09T17:40:50Z",
"incomingMailServerPort":0,
"sharedUserId":0,
"canRead":true,
"canWrite":true,
"canDelete":true,
"sharedUserStatus":10,
"searchIndexAllowed":true,
"id":2,
"status":0,
"baseSearchCount":0,
"searchIndexId":"2",
"isDeleted":false
}
],
"total":2,
"message":"",
"success":true,
"createdOnUtc":"0001-01-01T00:00:00Z",
"expiryOnUtc":"0001-01-01T00:00:00Z",
"graceTillUtc":"0001-01-01T00:00:00Z",
"associatedTotalCountPropertyName":"TotalRecordsCount"
}Response
A list of "MailAccount" should be expected.
Mailboxes
- mailAccountIdNumberrequiredDescription
- specialUseBooleanDescription
- showHiddenBooleanDescription
- countersBooleanDescription
- sizesBooleanDescription
{
"data": [
{
"id": "631b6c3153ea7b3fa0fb93f6",
"name": "INBOX",
"path": "INBOX",
"modifyIndex": 90,
"subscribed": true,
"total": 26,
"unseen": 4
},
{
"id": "631db923ea92bcffbb88c60a",
"name": "Archive",
"path": "Archive",
"modifyIndex": 0,
"subscribed": true,
"total": 0,
"unseen": 0
},
{
"id": "631b6c3153ea7b3fa0fb93f9",
"name": "Drafts",
"path": "Drafts",
"specialUse": "\\Drafts",
"modifyIndex": 397,
"subscribed": true,
"total": 1,
"unseen": 0
},
{
"id": "631b6c3153ea7b3fa0fb93fa",
"name": "Junk",
"path": "Junk",
"specialUse": "\\Junk",
"modifyIndex": 0,
"subscribed": true,
"total": 0,
"unseen": 0
},
{
"id": "631b6c3153ea7b3fa0fb93f7",
"name": "Sent Mail",
"path": "Sent Mail",
"specialUse": "\\Sent",
"modifyIndex": 3,
"subscribed": true,
"total": 3,
"unseen": 0
},
{
"id": "631b6c3153ea7b3fa0fb93f8",
"name": "Trash",
"path": "Trash",
"specialUse": "\\Trash",
"modifyIndex": 6,
"subscribed": true,
"total": 6,
"unseen": 0
}
],
"total": 1,
"message": "",
"success": true,
"createdOnUtc": "0001-01-01T00:00:00Z",
"expiryOnUtc": "0001-01-01T00:00:00Z",
"graceTillUtc": "0001-01-01T00:00:00Z",
"associatedTotalCountPropertyName": "TotalRecordsCount"
}{
"message": "Ain't no cake like that."
}Response
A list of "WdMailboxInfo" should be expected.
- mailAccountIdNumberrequiredDescription
- mailboxIdstringrequiredDescription
true{
"message": "Ain't no cake like that."
}Response
"true" or "false" should be expected
Mailbox Messages
- mailAccountIdNumberrequiredDescription
- mailboxIdstringrequiredDescription
- pageSizeNumberDescription
- pageIndexNumberDescription
- unreadOnlyBooleanDescription
- includeMetaDataBooleanDescription
- includeThreadMessageCountBooleanDescription
- sortOrderstringDescription
- nextCursorstringDescription
- previousCursorstringDescription
{
"pageSize":20,
"pageIndex":0,
"mailboxId":"631b6c3153ea7b3fa0fb93f6"
}{
"success":true,
"total":1,
"page":1,
"previousCursor":"false",
"nextCursor":"false",
"results":[
{
"id":1,
"mailbox":"631b6c3153ea7b3fa0fb93f6",
"thread":"631db933ea92bcffbb88c60d",
"from":{
"name":"",
"address":"[email protected]"
},
"to":[
{
"name":"",
"address":"[email protected]"
}
],
"cc":[
],
"bcc":[
],
"subject":"test-test-to-self",
"intro":"test This e-mail is scanned by OElite Enterprise Mail Gateway for virus and intentional spam checks. E-mail transmission cannot…",
"attachments":false,
"seen":false,
"deleted":false,
"draft":false,
"flagged":false,
"answered":false,
"forwarded":false,
"contentType":{
"value":"multipart/alternative",
"params":{
"boundary":"--=_RainLoop_617_437411321.1662892339"
}
}
}
]
}Response
A "WdBaseEntityCollectionResponse<WdMessageBaseInfo>" object should be expected
- mailAccountIdNumberrequiredDescription
- mailboxIdstringrequiredDescription
- messageIdsArrayrequiredDescription
- moveToMailboxIdstringDescription
- markAsSeenBooleanDescription
- markAsFlaggedBooleanDescription
- markAsDraftBooleanDescription
- expiresstringDescription
- metaDatastringDescription
{
"messagIds": [],
"moveToMailboxId": "string",
"markAsSeen": true,
"markAsFlagged": true,
"markAsDraft": true,
"expires": "string",
"metaData": "string"
}{
success: true,
data: {
ids: [
6,
12
],
updateCount: 2
}
}{
"message": "Ain't no cake like that."
}Response
A ResponseMessage object will be returned. If successful, the 'data' field should contain field "ids" which is an array of messageId and "updateCount" which indicates how many messages were updated. In OElite OCC project, a "WdMessageUpdateResponse" object is defined for the return data.
- mailAccountIdstringrequiredDescription
- mailboxIdstringrequiredDescription
- messageIdNumberrequiredDescription
{
"success":true,
"total":1,
"page":1,
"previousCursor":"false",
"nextCursor":"false",
"results":[
{
"id":1,
"mailbox":"631b6c3153ea7b3fa0fb93f6",
"thread":"631db933ea92bcffbb88c60d",
"from":{
"name":"",
"address":"[email protected]"
},
"to":[
{
"name":"",
"address":"[email protected]"
}
],
"cc":[
],
"bcc":[
],
"subject":"test-test-to-self",
"intro":"test This e-mail is scanned by OElite Enterprise Mail Gateway for virus and intentional spam checks. E-mail transmission cannot…",
"attachments":false,
"seen":false,
"deleted":false,
"draft":false,
"flagged":false,
"answered":false,
"forwarded":false,
"contentType":{
"value":"multipart/alternative",
"params":{
"boundary":"--=_RainLoop_617_437411321.1662892339"
}
}
}
]
}Response
A "WdMessageDetail" object should be expected
- mailAccountIdNumberrequiredDescription
- mailboxIdstringrequiredDescription
- seenBooleanDescription
- draftBooleanDescription
- flaggedstringDescription
- rawstringDescription
- fromObjectrequiredDescription
- toArrayrequiredDescription
- ccArrayDescription
- bccArrayDescription
- subjectstringrequiredDescription
- textstringDescription
- htmlstringDescription
- headersArrayDescription
- filesArrayDescription
- attachmentsArrayDescription
- metaDataStringDescription
- referenceObjectDescription
- replacePreviousObjectDescription
- mailboxstringrequiredDescription
- idstringrequiredDescription
- essstringDescription
- ipstringDescription
{
"unseen": true,
"draft": true,
"flagged": true,
"raw": "string",
"from": {
"name": "string",
"address": "string"
},
"to": [
{
"name": "string",
"address": "string"
}
],
"cc": [
{
"name": "string",
"address": "string"
}
],
"bcc": [
{
"name": "string",
"address": "string"
}
],
"subject": "string",
"text": "string",
"html": "string",
"headers": [
{
"key": "string",
"value": "string"
}
],
"files": [
"string"
],
"attachments": [
{
"content": "string",
"filename": "string",
"contentType": "string",
"cid": "string"
}
],
"metaData": {},
"reference": {
"mailbox": "string",
"id": 0,
"action": "string",
"attachments": [
"string"
]
},
"replacePrevious": {
"mailbox": "string",
"id": 0
},
"sess": "string",
"ip": "string"
}{
success: "true",
data: {
id: 511,
mailbox: "631b6c3153ea7b3fa0fb93f8"
}
}{
"message": "Ain't no cake like that."
}Request Body
Note: the body is "WdMessageUploadDetails" object, a derived structure from "WdMessageDetails". Only the fields listed above in Boday Parameters are used for the request.
Response
A ResponseMessage object with data containing the message id and mailbox id should be expected.
- mailAccountIdNumberrequiredDescription
- mailboxIdstringrequiredDescription
- messageIdNumberrequiredDescription
true{
"message": "Ain't no cake like that."
}
- mailAccountIdNumberrequiredDescription
- *ArrayrequiredDescription
[
{
mailboxId: "string",
messageId: number
},
{
mailboxId: "string",
messageId: number
}
]{
success: true,
deleted: 2
}{
"message": "Ain't no cake like that."
}Response
An object of WdDeleteMessageResult should be expected.
- mailAccountIdNumberrequiredDescription
- mailboxIdstringrequiredDescription
- messageIdNumberrequiredDescription
- idstringrequiredDescription
- filenamestringrequiredDescription
- contentTypestringDescription
{
"id": "AT00001",
"filename": "text.xls",
"contentType": "application/vnd.ms-excel"
}{
"message": "Ain't no cake like that."
}Response
A direct download file stream in "application/octet-stream" content type.
- mailAccountIdNumberrequiredDescription
- mailboxIdstringrequiredDescription
- messageIdNumberrequiredDescription
- deleteFilesstringrequiredDescription
- sendTimestringDescription
{
"deleteFiles": false
}{
"success": true,
"data": {
"id": 0,
"mailbox": "string",
"size": 0
}
}
{
"message": "Ain't no cake like that."
}Request Body
The Body parameters is available as "WdMessageDeliverRequest" object
Response
A "ResponseMessage" should be expected.