GET/users/{userId}/mail/{mailId}
メールを取得する。
受信したインライン画像付きのメールを表示するには :
- メール本文に含まれる img タグのうち、src 属性の値が cid: から始まる場合には、インライン画像を示す
- インライン画像は、添付ファイル情報 attachments より、対応する cid のオブジェクトを参照し、contentType、encoding、data を組み合わせて data URL スキーマに変換する (src="data:{contentType};{encoding},{data}" )
例 :
- 受信データ :
<img src="cid:reddotiVBORw0KGgoAAAA" alt="Red dot">- 置換後 :
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==" alt="Red dot"/>
参照 : RFC 2387 The MIME Multipart/Related Content-type
Access Token を指定します。
指定の方法や Access Token の取得方法は 共通仕様 を参照してください。
mail
mail.read
| Parameter | Type | Description |
|---|---|---|
| userId | string | ユーザーを特定する ID (URL エンコードする)
required example : me |
| mailId | string | メール ID required example : 1 |
| Header | type | Description |
|---|---|---|
| Authorization | string | Bearer {token} required |
OK
| Property | Type | Description |
|---|---|---|
| attachments | array (AttachmentFile) | 添付ファイル情報 required minItems : 0 |
| object (mail) | メール required |
| Property | Type | Description |
|---|---|---|
| attachmentId | integer | 添付ファイル ID
required format : int32 |
| contentType | string | ファイルの contentType required |
| charset | string | ファイルの charset nullable : true |
| filename | string | ファイル名 required minLength : 1 maxLength : 250 |
| encoding | string | ファイルのエンコード nullable : true |
| size | integer | ファイルサイズ (単位は Byte) required format : int32 |
| bigFileExpireTime | string | ダウンロード期限が設定されたファイルの有効期間 |
| bigFileFid | string | ダウンロード期限を設定した場合のファイル ID
|
| cid | string | Content-ID (インライン画像に使用する cid) nullable : true |
| contentDisposition | string | Content-Disposition
Allowed values : inline, attachment |
| data | string | インライン画像のデータ (Base64 でエンコードされたデータ) nullable : true |
| Property | Type | Description |
|---|---|---|
| mailId | integer | メール ID required format : int64 |
| folderId | integer | メールフォルダ ID required format : int32 |
| status | integer | メールステータス
required format : int64 |
| from | object (from) | メールアドレス required |
| replyTo | object (replyTo) | メールアドレス |
| to | array (MailAddress) | To required minItems : 1 uniqueItems : false |
| cc | array (MailAddress) | Cc minItems : 0 uniqueItems : false |
| bcc | array (MailAddress) | Bcc minItems : 0 uniqueItems : true |
| subject | string | 件名 required minLength : 1 maxLength : 180 |
| body | string | 本文 required minLength : 1 |
| receivedTime | string | 受信時刻 required example : 2021-07-16T19:20:30+09:00 |
| sentTime | string | 送信時刻 required example : 2021-07-16T19:20:30+09:00 |
| size | integer | メールサイズ (単位 : byte) required format : int32 |
| securityLevel | string | 情報レベル
default : General Allowed values : General, Restricted, Confidential |
| securityDeleteDate | string | 情報レベルの指定による削除予定日 |
| useForwarding | boolean | 再送可否フラグ default : true |
| charset | string | 閲覧時に使用する charset |
| spamType | string | 迷惑メール分類コード
Allowed values : SYSTEM_DEFINE, USER_DEFINE, USER_REPORT, USER_MOVE, NORMAL |
| spamTypeDetail | string | 迷惑メールの詳細説明 |
| Property | Type | Description |
|---|---|---|
| name | string | 名前 |
| string | メールアドレス (RFC822 フォーマット) required minLength : 1 |
| Property | Type | Description |
|---|---|---|
| name | string | 名前 |
| string | メールアドレス (RFC822 フォーマット) required minLength : 1 |
| Property | Type | Description |
|---|---|---|
| name | string | 名前 |
| string | メールアドレス (RFC822 フォーマット) required minLength : 1 |
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": "2021-06-07 14:59:59",21 "bigFileFid": "RwnmKqg9FAumKwYZHqUmHqUmKoumFxKwKxvmKquqHqurKoKmFqblaxvj1XUwHqg9aAM/axI0Fov9axpCMobqp6FSazEZaACSFA34aAUd&rl=24101"22 }23 ],24 "mail": {25 "mailId": 76285,26 "folderId": 6,27 "status": 4101,28 "from": {29 "name": "ワークス",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": "タイトル",55 "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}Bad Request