POST/users/{userId}/mail/filters

자동 분류를 추가하여 조건에 맞는 메일이 수신되면 읽음 또는 중요 메일로 표시하거나, 특정한 메일함으로 이동 또는 다른 사람에게 전달할 수 있다.

  • 분류 기준
    • 분류 기준 파라미터 중 하나는 필수로 지정해야 하며, 중복으로 지정할 수 있다.
    • 단, isReplyFromMe와 isCalendarMail 파라미터는 함께 지정할 수 없다.
  • 처리 방법
    • isMoveFolder, isTreatForwardEmail, isHighlightColor, isRead, isImportant, isDelete 6개 파라미터 중 하나는 필수로 지정해야 한다.
    • isMoveFolder를 지정하면 folderId를 입력해야 한다.
    • useForwardEmail을 지정하면 forwardEmail을 입력해야 한다.
    • ishighlightColor를 지정하면 highlightColor를 입력해야 한다.
    • isDelete를 지정하면 다른 처리 방법은 모두 무시된다.

Authorization

oauth2

OAuth 2.0 인증.
자세한 인증 방식은 인가·인증를 참고한다.

Scope

mail

HTTP Request

POSThttps://www.worksapis.com/v1.0/users/{userId}/mail/filters

Path Parameters

ParameterTypeDescription
userId string 

구성원 ID (URL인코딩하여 사용)

  • User ID
  • Login ID(email)
  • 자기자신(me)

required
example : me 

Header Parameters

HeadertypeDescription
Authorization string 

Bearer {token}


required 
Content-Type string 

application/json


required
example : application/json 

Request Body

PropertyTypeDescription
from string 

보낸사람 메일 주소(분류 기준)


minLength : 1 
toCc string 

받는사람 또는 참조 메일 주소(분류 기준)


minLength : 1 
to string 

받는사람 메일 주소(분류 기준)


minLength : 1 
cc string 

참조 메일 주소(분류 기준)


minLength : 1 
subject string 

메일 제목(분류 기준)


minLength : 2
maxLength : 180 
body string 

메일 본문(분류 기준)


minLength : 2 
hasAttach boolean 

첨부 파일이 있는 메일인지 여부(분류 기준)


default : false 
isReplyFromMe boolean 

내가 쓴 메일에 대한 답장인지 여부(분류 기준)


default : false 
isCalendarMail boolean 

캘린더 약속 메일인지 여부(분류 기준)


default : false 
folderId integer 

메일함 ID(처리 방법)


minimum : 0
format : int32 
highlightColor string 

강조색의 RGB값(처리 방법)


minLength : 1 
useForwardEmail boolean 

전달 여부(처리 방법)


default : false 
forwardEmail string 

전달할 메일의 수신 메일(처리 방법)


format : email 
isMoveFolder boolean 

메일함으로 이동 여부(처리 방법)


default : false 
isRead boolean 

읽음으로 표시 여부(처리 방법)


default : false 
isColor boolean 

색상 강조 여부(처리 방법)


default : false 
isImportant boolean 

중요 표시 여부(처리 방법)


default : false 
isDelete boolean 

삭제(휴지통으로 이동) 여부(처리 방법)


default : false 
isApplyExistingMails boolean 

기존 메일 적용 여부(처리 방법)


default : false 

Request Example

example

1{2  "from": "sender@example.com",3  "toCc": "tocc@example.com",4  "to": "to@example.com",5  "cc": "cc@example.com",6  "subject": "subjectstring",7  "body": "bodystring",8  "hasAttach": false,9  "isReplyFromMe": false,10  "isCalendarMail": false,11  "folderId": 0,12  "useForwardEmail": true,13  "forwardEmail": "forward@example.com",14  "isMoveFolder": false,15  "isread": false,16  "isColor": true,17  "highlightColor": "#e8f8fd",18  "isImportant": false,19  "isDelete": false,20  "isApplyExistingMails": false21}

Response

HTTP 201

Created

HTTP 400

Bad Request

HTTP 500

Internal Server Error