GET/users/{userId}/mail/{mailId}

Reads a message.

Note

  • Inline image
    • A text string such as "cid:reddotiVBORw0KGgoAAAA" in the message body must be changed to the data that matches the same cid in the attachment information to show an inline image.
  • Example) The message body must be replaced as in the following example.
    • AS-IS: <img src='cid:reddotiVBORw0KGgoAAAA' alt='Red dot' >
    • TO-BE: <img src='data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==' alt='Red dot' />
  • To send the message, the data must be changed to <img src=\"cid:reddotiVBORw0KGgoAAAA\" alt=\"Red dot\" /> again. (RFC 2387)
    • RFC 2387: https://www.rfc-editor.org/rfc/rfc2387"

Authorization

oauth2

OAuth 2.0 authentication.
For more information, see Authentication and Authorization.

Scope

mail
mail.read

HTTP Request

GEThttps://www.worksapis.com/v1.0/users/{userId}/mail/{mailId}

Path Parameters

ParameterTypeDescription
userId string 

Member ID (must be URL-encoded)

  • User ID
  • Login ID (email)
  • Me

required
example : me 
mailId string 

Message ID


required
example : 1 

Query Parameters

ParameterTypeDescription
hasThreads boolean 

Indicates whether to get an email thread.


default : false
allowEmptyValue : true 
threadCount integer 

Number of messages in the thread


default : 5
minimum : 0
maximum : 400
format : int32
allowEmptyValue : true 

Header Parameters

HeadertypeDescription
Authorization string 

Bearer {token}


required 

Response

HTTP 200

OK

PropertyTypeDescription
mail object (mail) 

Mail


required 
attachments array (AttachmentFile) 

Attachment information


required
minItems : 0 
threads array (Threads) 
 

mail

PropertyTypeDescription
mailId integer 

Message ID


required
format : int64 
folderId integer 

Folder ID


required
format : int32 
status integer 

Message status

  • 0x4L: Read (current status)
  • 0x8L: Replied
  • 0x10L: Forwarded
  • 0x20L: Marked as Important
  • 0x100L: Sent
  • 0x800L: Read by recipients
  • 0x1000L: Attachment with a limited retention period
  • 0x40000L: Reply received
  • 0x00200000L: To me
  • 0x00400000L: Scheduled

Use the bit AND operator to get the message status.
Here is an example to check whether the message is read.

public boolean IsRead(long status) {  return 0x4L == (0x4L & status);}

required
format : int64 
from object (from) 

Email information


required 
replyTo object (replyTo) 

Email information

 
to array (MailAddress) 

To


required
minItems : 1 
cc array (MailAddress) 

Cc


minItems : 0 
bcc array (MailAddress) 

Bcc


minItems : 0
uniqueItems : true 
subject string 

Subject


required
minLength : 1
maxLength : 180 
body string 

Body


required
minLength : 1 
receivedTime string 

Received time


required
example : 2021-07-16T19:20:30+09:00 
sentTime string 

Sent time


required
example : 2021-07-16T19:20:30+09:00 
size integer 

Message size in bytes


required
format : int32 
securityLevel string 

Security level of the message

  • General: General (default)
  • Restricted: Restricted
  • Confidential: Confidential
  • Non-business: Non-business

default : General
Allowed values : General, Restricted, Confidential, Non-business 
securityDeleteDate string 

The deletion date scheduled for the secure message

 
useForwarding boolean 

Indicates whether to allow forwarding.


default : true 
charset string 

Charset used to read the message.

 
spamType string 

Spam message filter

  • SYSTEM_DEFINE: Created by the system.
  • USER_DEFINE: Created by users.
  • USER_REPORT: Reported as spam messages by users.
  • USER_MOVE: Moved to Spam by users.
  • NORMAL: General message

Allowed values : SYSTEM_DEFINE, USER_DEFINE, USER_REPORT, USER_MOVE, NORMAL 
spamTypeDetail string 

Spam type details

 

from

PropertyTypeDescription
name string 

Email name

 
email string 

Email address (RFC822 format)


required
minLength : 1 

replyTo

PropertyTypeDescription
name string 

Email name

 
email string 

Email address (RFC822 format)


required
minLength : 1 

MailAddress

PropertyTypeDescription
name string 

Email name

 
email string 

Email address (RFC822 format)


required
minLength : 1 

AttachmentFile

PropertyTypeDescription
attachmentId integer 

Attachment ID
How to search content differs depending on the attachment type.

  • Positive: General attachment
    Use Download an attachment.
  • -1: Attachment with a limited retention period
    See bigFileFid.
  • -2: Inline image
    See Read a message.

required
format : int32 
contentType string 

Attachment content type


required 
charset string 

File's charset


nullable : true 
filename string 

File name


required
minLength : 1
maxLength : 250 
encoding string 

File encoding


nullable : true 
size integer 

File size (in bytes)


required
format : int32 
bigFileExpireTime string 

Validity period of the attachment with a limited retention period.

 
bigFileFid string 

Fid of the attachment with a limited retention period.

  • You can use the fid to download the attachment, as in https://bigfile.mail.worksmobile.com/download?fid=.
 
cid string 

Content-ID (cid used to add an inline image)


nullable : true 
contentDisposition string 

Content-Disposition

  • inline: Inline image
  • attachment+: Attachment

Allowed values : inline, attachment 
data string 

Inline image data (encoded with Base64)


nullable : true 

Threads

PropertyTypeDescription
mailId integer 

Message ID


required
format : int64 
folderId integer 

Folder ID


required
format : int32 
status string 

Message status

  • Unread: Unread message
  • Read: Read message

required 
from object (from) 

Email information


required 
replyTo object (replyTo) 

Email information

 
to array (MailAddress) 

To


required
minItems : 1 
cc array (MailAddress) 

Cc (always empty for an email thread)


minItems : 0 
bcc array (MailAddress) 

Bcc (always empty for an email thread)


minItems : 0
uniqueItems : true 
subject string 

Subject


required
minLength : 1
maxLength : 180 
receivedTime string 

Received time


required
example : 2021-07-16T19:20:30+09:00 
sentTime string 

Sent time


required
example : 2021-07-16T19:20:30+09:00 
size integer 

Message size in bytes


required
format : int32 
securityLevel string 

Security level of the message

  • General: General (default)
  • Restricted: Restricted
  • Confidential: Confidential
  • Non-business: Non-business

default : General
Allowed values : General, Restricted, Confidential, Non-business 
useForwarding boolean 

Indicates whether to allow forwarding.


default : true 
attachCount integer 

Number of attachments

 
preview string 

Text for preview

 
isImportant boolean 

Indicates whether the message is important (the red exclamation mark is added to the message's subject).

 

Response Example

example

1{2  "attachments": [3    {4      "attachmentId": 1,5      "contentType": "image/jpeg",6      "charset": null,7      "filename": "file1.jpg",8      "encoding": null,9      "size": 919,10      "bigFileExpireTime": "",11      "bigFileFid": ""12    },13    {14      "attachmentId": 2,15      "contentType": "image/jpeg",16      "charset": null,17      "filename": "file2.jpeg",18      "encoding": null,19      "size": 253,20      "bigFileExpireTime": "2022-10-27T00:02:01+09:00",21      "bigFileFid": "RwnmKqg9FAumKwYZHqUmHqUmKoumFxKwKxvmKquqHqurKoKmFqblaxvj1XUwHqg9aAM/axI0Fov9axpCMobqp6FSazEZaACSFA34aAUd&rl=24101"22    }23  ],24  "mail": {25    "mailId": 76285,26    "folderId": 6,27    "status": 4101,28    "from": {29      "name": "works",30      "email": "works@example.com"31    },32    "replyTo": {33      "name": "reply",34      "email": "reply@example.com"35    },36    "to": [37      {38        "name": "admin",39        "email": "admin@example.com"40      }41    ],42    "cc": [43      {44        "name": "admin",45        "email": "admin@example.com"46      }47    ],48    "bcc": [49      {50        "name": "admin",51        "email": "admin@example.com"52      }53    ],54    "subject": "Subject",55    "body": "Body",56    "receivedTime": "2022-10-27T00:02:01+09:00",57    "sentTime": "2022-10-27T00:02:01+09:00",58    "size": 1290078,59    "securityLevel": "General",60    "securityDeleteDate": "",61    "useForwarding": true,62    "charset": "",63    "spamType": "NORMAL",64    "spamTypeDetail": "NORMAL"65  },66  "threads": [67    {68      "mailId": 22715,69      "folderId": 0,70      "status": "Read",71      "from": {72        "name": "admin",73        "email": "admin@example.com"74      },75      "to": [76        {77          "name": "admin",78          "email": "admin@example.com"79        }80      ],81      "subject": "Email subject",82      "receivedTime": "2025-04-09T20:19:07+09:00",83      "sentTime": "2025-04-09T20:19:07+09:00",84      "size": 14452,85      "securityLevel": "General",86      "useForwarding": true,87      "attachCount": 0,88      "preview": "",89      "isImportant": true90    }91  ]92}

HTTP 400

Bad Request