Method: users.messages.import
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
SMTP를 통한 수신과 유사한 표준 이메일 전송 스캔 및 분류를 사용하여 이 사용자의 메일함에만 메일을 가져옵니다. 이 방법은 SPF 검사를 실행하지 않으므로 도메인 스푸핑을 시도하는 스팸 메일과 같은 일부 스팸 메일에는 작동하지 않을 수 있습니다. 이 메서드는 메시지를 전송하지 않습니다.
HTTP 요청
- 업로드 URI, 미디어 업로드 요청:
POST https://gmail.googleapis.com/upload/gmail/v1/users/{userId}/messages/import
- 메타데이터 URI, 메타데이터 전용 요청:
POST https://gmail.googleapis.com/gmail/v1/users/{userId}/messages/import
URL은 gRPC 트랜스코딩 문법을 사용합니다.
경로 매개변수
매개변수 |
userId |
string
사용자의 이메일 주소 인증된 사용자를 나타내는 데 특수 값 me 을 사용할 수 있습니다.
|
쿼리 매개변수
매개변수 |
internalDateSource |
enum (InternalDateSource )
Gmail의 메일 내부 날짜 소스입니다.
|
neverMarkSpam |
boolean
Gmail 스팸 분류 결정을 무시하고 이메일을 받은편지함에서 SPAM으로 표시하지 마세요.
|
processForCalendar |
boolean
이메일의 캘린더 초대를 처리하고 추출된 회의를 이 사용자의 Google Calendar에 추가합니다.
|
deleted |
boolean
이메일을 완전히 삭제된 것으로 표시하고 (휴지통이 아님) Vault 관리자에게만 Google Vault에 표시되도록 합니다. Google Workspace 계정에만 사용됩니다.
|
요청 본문
요청 본문에 Message
의 인스턴스가 포함됩니다.
응답 본문
성공한 경우 응답 본문에 Message
의 인스턴스가 포함됩니다.
승인 범위
다음 OAuth 범위 중 하나가 필요합니다.
https://mail.google.com/
https://www.googleapis.com/auth/gmail.modify
https://www.googleapis.com/auth/gmail.insert
자세한 내용은 승인 가이드를 참고하세요.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-07-25(UTC)
[null,null,["최종 업데이트: 2025-07-25(UTC)"],[],[],null,["# Method: users.messages.import\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Query parameters](#body.QUERY_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nImports a message into only this user's mailbox, with standard email delivery scanning and classification similar to receiving via SMTP. This method doesn't perform SPF checks, so it might not work for some spam messages, such as those attempting to perform domain spoofing. This method does not send a message.\n\n### HTTP request\n\n- Upload URI, for media upload requests: \n `POST https://gmail.googleapis.com/upload/gmail/v1/users/{userId}/messages/import`\n- Metadata URI, for metadata-only requests: \n `POST https://gmail.googleapis.com/gmail/v1/users/{userId}/messages/import`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|----------|-----------------------------------------------------------------------------------------------------------|\n| `userId` | `string` The user's email address. The special value `me` can be used to indicate the authenticated user. |\n\n### Query parameters\n\n| Parameters ||\n|----------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `internalDateSource` | `enum (`[InternalDateSource](/workspace/gmail/api/reference/rest/v1/InternalDateSource)`)` Source for Gmail's internal date of the message. |\n| `neverMarkSpam` | `boolean` Ignore the Gmail spam classifier decision and never mark this email as SPAM in the mailbox. |\n| `processForCalendar` | `boolean` Process calendar invites in the email and add any extracted meetings to the Google Calendar for this user. |\n| `deleted` | `boolean` Mark the email as permanently deleted (not TRASH) and only visible in [Google Vault](http://support.google.com/vault/) to a Vault administrator. Only used for Google Workspace accounts. |\n\n### Request body\n\nThe request body contains an instance of [Message](/workspace/gmail/api/reference/rest/v1/users.messages#Message).\n\n### Response body\n\nIf successful, the response body contains an instance of [Message](/workspace/gmail/api/reference/rest/v1/users.messages#Message).\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://mail.google.com/`\n- `\n https://www.googleapis.com/auth/gmail.modify`\n- `\n https://www.googleapis.com/auth/gmail.insert`\n\nFor more information, see the [Authorization guide](/workspace/guides/configure-oauth-consent)."]]