PATCH/users/{userId}/mail/{mailId}

メールの属性を更新する。
設定できる属性は既読表示フラグおよび重要表示フラグ。

Authorization

oauth2

Access Token を指定します。
指定の方法や Access Token の取得方法は 共通仕様 を参照してください。

Scope

mail

HTTP Request

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

Path Parameters

ParameterTypeDescription
userId string 

ユーザーを特定する ID (URL エンコードする)

  • ユーザー ID (userId)
  • ログイン ID (email)
  • 自身 ("me")

required
example : me 
mailId string 

メール ID


required
example : 1 

Header Parameters

HeadertypeDescription
Authorization string 

Bearer {token}


required 
Content-Type string 

application/json


required
example : application/json 

Request Body

PropertyTypeDescription
readStatus boolean 

既読表示フラグ
メールが既読であるかどうか (true : 既読)

 
markStatus boolean 

重要表示フラグ
メールが重要であるかどうか (true : 重要)

 

Request Example

example

1{2  "readStatus": false,3  "markStatus": true4}

Response

HTTP 200

OK

PropertyTypeDescription
attachments array (AttachmentFile) 

添付ファイル情報


required
minItems : 0 
mail object (mail) 

メール


required 

AttachmentFile

PropertyTypeDescription
attachmentId integer 

添付ファイル ID
添付ファイルの種類により、コンテンツの取得方法が異なる

  • 正の整数 : 通常の添付ファイル
    添付ファイルのダウンロード を利用
  • -1 : ダウンロード期限が設定された添付ファイル
    bigFileFid を参照
  • -2 : インライン画像
    メールの取得 の説明を参照

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

  • "https://bigfile.mail.worksmobile.com/download?fid=" 形式でダウンロード期限があるファイルをダウンロードできる。
 
cid string 

Content-ID (インライン画像に使用する cid)


nullable : true 
contentDisposition string 

Content-Disposition

  • inline : インライン画像
  • attachment+ : 添付ファイル

Allowed values : inline, attachment 
data string 

インライン画像のデータ (Base64 でエンコードされたデータ)


nullable : true 

mail

PropertyTypeDescription
mailId integer 

メール ID


required
format : int64 
folderId integer 

メールフォルダ ID


required
format : int32 
status integer 

メールステータス

  • 0x4L : 既読 (現在の状態)
  • 0x8L : 返信済み
  • 0x10L : 転送済み
  • 0x20L : 重要メールとして表示済み
  • 0x100L : 送信済み
  • 0x800L : 相手が既読
  • 0x1000L : ダウンロード期限が設定されたファイル添付メール
  • 0x40000L : 返信を受信したメール
  • 0x00200000L : 自分が受信者として設定されているメール
  • 0x00400000L : スケジュールメール
    メールの状態 (status) は、bit AND 演算子を使用して確認する必要がある。
    メールの既読を確認するコードの例は次のとおりである。
public boolean IsRead(long status) {  return 0x4L == (0x4L & status);}

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 

情報レベル

  • General : 公開 (default)
  • Restricted : 社外秘
  • Confidential : 機密

default : General
Allowed values : General, Restricted, Confidential 
securityDeleteDate string 

情報レベルの指定による削除予定日

 
useForwarding boolean 

再送可否フラグ


default : true 
charset string 

閲覧時に使用する charset

 
spamType string 

迷惑メール分類コード

  • SYSTEM_DEFINE : システム振り分けルール
  • USER_DEFINE : ユーザー振り分けルール
  • USER_REPORT : ユーザーが迷惑メールとして報告
  • USER_MOVE : ユーザーが迷惑メールフォルダに移動
  • NORMAL : 一般メール

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

迷惑メールの詳細説明

 

from

PropertyTypeDescription
name string 

名前

 
email string 

メールアドレス (RFC822 フォーマット)


required
minLength : 1 

replyTo

PropertyTypeDescription
name string 

名前

 
email string 

メールアドレス (RFC822 フォーマット)


required
minLength : 1 

MailAddress

PropertyTypeDescription
name string 

名前

 
email string 

メールアドレス (RFC822 フォーマット)


required
minLength : 1 

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": "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}