GET/users/{userId}/mail/{mailId}
메일을 읽는다.
참고
- 인라인 이미지
- 메일본문에서 cid:reddotiVBORw0KGgoAAAA 이런 문자열을 있으면 첨부 파일 정보에서 메일본문에 cid와 같은 값의 data로 변경해서 인라인 이미지 처리해야 이미지가 깨지지 않고 노출된다.
- 예제) 메일 본문을 아래처럼 치환해야 한다.
- AS-IS :
<img src='cid:reddotiVBORw0KGgoAAAA' alt='Red dot' >- TO-BE :
<img src='data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==' alt='Red dot' />- 메일 발송 시, 다시
<img src=\"cid:reddotiVBORw0KGgoAAAA\" alt=\"Red dot\" />치환해야한다. (RFC 2387)
- RFC 2387: https://www.rfc-editor.org/rfc/rfc2387"
OAuth 2.0 인증.
자세한 인증 방식은 인가·인증를 참고한다.
mail
mail.read
| Parameter | Type | Description |
|---|---|---|
| userId | string | 구성원 ID (URL인코딩하여 사용)
required example : me |
| mailId | string | 메일 ID required example : 1 |
| Parameter | Type | Description |
|---|---|---|
| hasThreads | boolean | 주고받은 메일 묶음 조회 여부 default : false allowEmptyValue : true |
| threadCount | integer | 주고받은 메일 묶음을 조회할 개수 default : 5 minimum : 0 maximum : 400 format : int32 allowEmptyValue : true |
| Header | type | Description |
|---|---|---|
| Authorization | string | Bearer {token} required |
OK
| Property | Type | Description |
|---|---|---|
| object (mail) | 메일 required | |
| attachments | array (AttachmentFile) | 첨부 파일 정보 required minItems : 0 |
| threads | array (Threads) |
| Property | Type | Description |
|---|---|---|
| mailId | integer | 메일 ID required format : int64 |
| folderId | integer | 메일함 ID required format : int32 |
| status | integer | 메일 상태
메일 상태(status)는 bit AND 연산자로 구해야 한다. required format : int64 |
| from | object (from) | 메일 정보 required |
| replyTo | object (replyTo) | 메일 정보 |
| to | array (MailAddress) | 받는사람 required minItems : 1 |
| cc | array (MailAddress) | 참조 minItems : 0 |
| bcc | array (MailAddress) | 숨은참조 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, Non-business |
| 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 format) required minLength : 1 |
| Property | Type | Description |
|---|---|---|
| name | string | 메일 이름 |
| string | 메일 주소 (RFC822 format) required minLength : 1 |
| Property | Type | Description |
|---|---|---|
| name | string | 메일 이름 |
| string | 메일 주소 (RFC822 format) required minLength : 1 |
| 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 | 파일 크기 (단위는 bytes) required format : int32 |
| bigFileExpireTime | string | 다운로드 기한이 있는 파일의 유효 기간 |
| bigFileFid | string | 다운로드 기한이 있는 파일의 fid
|
| 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 | string | 메일 상태
required |
| from | object (from) | 메일 정보 required |
| replyTo | object (replyTo) | 메일 정보 |
| to | array (MailAddress) | 받는사람 required minItems : 1 |
| cc | array (MailAddress) | 참조(주고받은 메일 묶음에서는 항상 빈값) minItems : 0 |
| bcc | array (MailAddress) | 숨은참조(주고받은 메일 묶음에서는 항상 빈값) minItems : 0 uniqueItems : true |
| subject | string | 메일 제목 required minLength : 1 maxLength : 180 |
| 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, Non-business |
| useForwarding | boolean | 재전송 가능 여부 default : true |
| attachCount | integer | 첨부 파일 개수 |
| preview | string | 미리보기용 텍스트 |
| isImportant | boolean | 메일을 쓸 때 중요 메일 여부(메일 제목에 빨간 느낌표 표시) |
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": "메일 제목",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 "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": "메일제목",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}Bad Request