REST API - POST Email Message

Updated

This operation returns a list of email messages.

Request

Syntax

POST <webservice>/Email/Search HTTP/1.1 Host: <host name> Accept: {application/xml | application/json} Authtoken: <authentication token> Content-type: application/xml <search_emails.xml>

where <webservice> is the root path used to route the API requests to the Web Server.

For more information, see Available Web Services for REST API.

Request Headers

Name

Description

Host

The host name of the Web Server or Web Console used in the API request.

Accept

The format of the response. Valid values are: application/xml or application/json.

Authtoken

The authentication token received after successfully logging on. For details on receiving an authentication token, see Authentication.

Content-type

The media type contained in the request body.

Request Body

Download the search_emails.xml file required for this request. The following table displays the parameters for the create_user_template.xml file.

Parameter

Description and Parameter Values

Element

Parent Element

subject

The subject line of the email message.

DM2ContentIndexing_EmailSearch

subclientID

The system-generated ID assigned to the subclient.

DM2ContentIndexing_EmailSearch

keyword

A keyword or regular expression to search for in the email messages.

DM2ContentIndexing_EmailSearch

clientId

The system-generated ID assigned to the client.

DM2ContentIndexing_EmailSearch

min_sizeKB

The minimum size of the email messages in kilobytes.

DM2ContentIndexing_EmailSearch

max_sizeKB

The maximum size of the email messages in kilobytes.

DM2ContentIndexing_EmailSearch

startDate

A start date based on the time stamp of the email message. Optional: Use the endDate parameter to define the end date of a range.

Valid values are UNIX-style timestamps (seconds since January 1, 1970).

DM2ContentIndexing_EmailSearch

endDate

An end date based on the time stamp of the email message. Optional: Use the startDate parameter to define the beginning date of a range.

Valid values are UNIX-style timestamps (seconds since January 1, 1970).

DM2ContentIndexing_EmailSearch

sortby

The field to sort by. Use the sortDirection parameter to define the direction of the sort.

Valid values are:

  • EMAIL_SUBJECT

  • OWNER

  • MODIFIEDTIME

  • SIZEINKB

  • CUSTODIAN

  • APPID

  • CLIENTID

  • EMAIL_FROM

  • EMAIL_TO

  • EMAIL_CC

  • EMAIL_BCC

DM2ContentIndexing_EmailSearch

sortDirection

The direction of the sort. Use the sortby parameter to define what to sort by.

Valid values are:

0, ascending

1, descending

DM2ContentIndexing_EmailSearch

start

The offset for the response. The default is 0.

DM2ContentIndexing_EmailSearch

page_size

The number of email messages to include in a single request.

DM2ContentIndexing_EmailSearch

fields

The fields to return in the response. Separate each field with a semi-colon (;).

Valid values are:

  • CONTENTID

  • EMAIL_ATTACHMENTNAME

  • EMAIL_ATTACHMENTS

  • EMAIL_BCC

  • EMAIL_CATEGORY

  • EMAIL_CC

  • EMAIL_CONVINDEX

  • EMAIL_CONVTOPIC

  • EMAIL_ENTRY_ID

  • EMAIL_FROM

  • EMAIL_FROMRECIPIENTLIST

  • EMAIL_HEADER

  • EMAIL_IMPORTANCE

  • EMAIL_MBNAME

  • EMAIL_MODIFIED_TIME

  • EMAIL_MSGFLAGS

  • EMAIL_PRIORITY

  • EMAIL_RECEIVED_TIME

  • EMAIL_RECIPIENTLIST

  • EMAIL_SENSITIVITY

  • EMAIL_SMTPBCC

  • EMAIL_SMTPCC

  • EMAIL_SMTPFROM

  • EMAIL_SMTPTO

  • EMAIL_SUBJECT

  • EMAIL_TO

  • EMAIL_TYPE

  • MODIFIEDTIME

DM2ContentIndexing_EmailSearch

intrafieldOp

If multiple recipients are listed in the <recipient> element, you can change the operator to AND. The default operator is OR.

Valid values are:

  • 0, or

  • 1, and

from

DM2ContentIndexing_EmailSearch

displayName

The name of the person who sent the email.

recipient

from

smtpAddress

The SMTP address of the person who sent the email.

recipient

from

intrafieldOp

If multiple recipients are listed in the <recipient> element, you can change the operator to AND. The default operator is OR.

Valid values are:

  • 0, or

  • 1, and

recipient

to

displayName

The name of the person who received the email.

recipient

to

smtpAddress

The SMTP address of the person who received the email.

recipient

to

Response

Response Parameters

Parameter

Description and Parameter Values

Element

Parent Element

total_records

DM2ContentIndexing_EmailSearchResp

subject

The subject line of the email message.

emails

DM2ContentIndexing_EmailSearchResp

subclientId

The system-generated ID assigned to the subclient.

emails

DM2ContentIndexing_EmailSearchResp

clientId

The system-generated ID assigned to the client.

emails

DM2ContentIndexing_EmailSearchResp

sizeKb

The size of the email messages in kilobytes.

emails

DM2ContentIndexing_EmailSearchResp

importance

The importance assigned to the email.

Valid values are:

  • 0, low

  • 1, normal

  • 2, high

emails

DM2ContentIndexing_EmailSearchResp

commcellNum

emails

DM2ContentIndexing_EmailSearchResp

mbguid

The globally unique identifier for the mailbox.

emails

DM2ContentIndexing_EmailSearchResp

sentReceivedTime

emails

DM2ContentIndexing_EmailSearchResp

archFileOffset

emails

DM2ContentIndexing_EmailSearchResp

mailbox

emails

DM2ContentIndexing_EmailSearchResp

folder

emails

DM2ContentIndexing_EmailSearchResp

itemPath

emails

DM2ContentIndexing_EmailSearchResp

appType

Valid value is 137.

emails

DM2ContentIndexing_EmailSearchResp

archFileId

emails

DM2ContentIndexing_EmailSearchResp

id

The system-generated ID assigned to the email message.

emails

DM2ContentIndexing_EmailSearchResp

displayName

The name of the person carbon copied on the email.

cc

emails

smtpAddress

The SMTP address of the person carbon copied on the email.

cc

emails

name

The name of any files attached to the email message.

attachments

emails

displayName

The name of the person who sent the email.

from

emails

smtpAddress

The SMTP address of the person who sent the email.

from

emails

displayName

The name of the person who received the email.

to

emails

smtpAddress

The SMTP address of the person who received the email.

to

emails

Examples

Sample Request

XML

POST <webservice>/Email/Search HTTP/1.1
Host: client.mydomain.com
Accept: application/xml
Authtoken: QSDK 38568012f4d1e8ee1841d283a47aa3ba78e124ea58354b5fc6
0f4dab8a63347d05cf5552484dafda3bfa4c5db84e580b1cb37bcf8e65b39f7f
8549a443e6f78a2c7be3f31b3d845e24776c835e498e8e883bb40c46bd15af4f
40ca94e823acedcdd4e9659e74b34a07a85c4586cd2ed914b6dce015874783ef7
68fda78183a4208930954a377f66eb56c8b92cexampl4s437a19317ca6ce7f323
3d5a01aca35dbad93468b833f2cf71010809006a937670adce711ca8be46638e8
Content-type: application/xml
<DM2ContentIndexing_EmailSearch  subclientID="71" keyword="testexch" endDate="1490014079" sortby="MODIFIEDTIME" sortDirection="1" page_size="10" fields="MODIFIEDTIME;EMAIL_SUBJECT;CONTENTID" > <from intrafieldOp="1"> <recipient displayName="admin" smtpAddress="TEST2010ADMINBB6"/> </from> <to intrafieldOp="1"> <recipient displayName="jsmith" smtpAddress="jsmith@testexch.mycompany.com" /> </to>
</DM2ContentIndexing_EmailSearch>
    

JSON

POST <webservice>/Email/Search HTTP/1.1
Host: client.mydomain.com
Accept: application/json
Authtoken: QSDK 38568012f4d1e8ee1841d283a47aa3ba78e124ea58354b5fc6
0f4dab8a63347d05cf5552484dafda3bfa4c5db84e580b1cb37bcf8e65b39f7f
8549a443e6f78a2c7be3f31b3d845e24776c835e498e8e883bb40c46bd15af4f
40ca94e823acedcdd4e9659e74b34a07a85c4586cd2ed914b6dce015874783ef7
68fda78183a4208930954a377f66eb56c8b92cexampl4s437a19317ca6ce7f323
3d5a01aca35dbad93468b833f2cf71010809006a937670adce711ca8be46638e8
Content-type: application/json
{ "endDate": "1490014079", "sortDirection": 1, "sortby": " MODIFIEDTIME", "subclient": 71, "keyword": "testexch", "fields": "MODIFIEDTIME;EMAIL_SUBJECT;CONTENTID", "page_size": 10, "from": { "intrafieldOp": 1, "recipient": [{ "displayName": "admin", "smtpAddress": "TEST2010ADMINBB6" }] }, "to": { "recipient": [{ "displayName": "jsmith", "smtpAddress": "jsmith@testexch.mycompany.com" }] }
}
    

Sample Response

JSON

{ "total_records": 367, "emails": [ { "subclientId": 71, "clientId": 1087, "sizeKb": 77306, "importance": 1, "subject": "sales presentation - 964509071", "commcellNum": 129420414, "mbguid": "28b14af1xd2eexample04xc5cf7ff1c281", "sentReceivedTime": "1518813936", "archFileOffset": 760554, "mailbox": "SGCI2 (SGCI2@testexch.mycompany.com)", "folder": "Inbox\\Test", "itemPath": "\\MB\\{28B14AF1XexampleCXA804XC5CF7FF1C281}\\Inbox\\Test\\cd2f36f74248d2d0bexample0a8a355dad2f6dfb3a393d6acd1243ff4082ee2b7", "appType": 137, "archFileId": 147206, "id": "cd2f36f74248d2d0bc4c18exampleb3a393d6acd1243ff4082ee2b7", "cc": [ { "displayName": "Angel Bamber", "smtpAddress": "AnBamber@testexch.mycompany.com" }, ], "attachments": [ { "name": "sales presentation - 964509071" } ], "from": [ { "displayName": "admin", "smtpAddress": "TEST2010ADMINBB6" } ], "to": [ { "displayName": "jsmith", "smtpAddress": "jsmith@testexch.mycompany.com" }, ] } ]
}
    

XML

<DM2ContentIndexing_EmailSearchResp total_records="367"> <emails subclientId="71" clientId="1087" sizeKb="77306" importance="1" subject="sales presentation - 964509071" commcellNum="129420414" mbguid="28b14af1xdexample804xc5cf7ff1c281" sentReceivedTime="1518813936" archFileOffset="760554" mailbox="SGCI2 (SGCI2@testexch.mycompany.com)" folder="Inbox\Test" itemPath="\MB\{28B14AF1XD2E2X46BCXA804XC5CF7FF1C281}\Inbox\Test\cd2f36f74248d2d0bc4c1860a8a355dad2f6dfb3a393d6acd1243ff4082ee2b7" appType="137" archFileId="147206" id="cd2f36f74248d2d0bc4c18examplead2f6dfb3a393d6acd1243ff4082ee2b7"> <cc displayName="Catalina Kinnard" smtpAddress="CaKinnard@testexch.mycompany.com" /> <cc displayName="Bessie Adams" smtpAddress="BeAdams@testexch.mycompany.com" /> <attachments name="sales presentation - 964509071" /> <from displayName="admin" smtpAddress="TEST2010ADMINBB6" /> <to displayName="jsmith" smtpAddress="jsmith@testexch.mycompany.com" /> </emails>
</DM2ContentIndexing_EmailSearchResp>