Users.settings: updateVacation

Requires authorization

Updates vacation responder settings. Try it now.

Request

HTTP request

PUT https://www.googleapis.com/gmail/v1/users/userId/settings/vacation

Parameters

Parameter name Value Description
Path parameters
userId string User's email address. The special value "me" can be used to indicate the authenticated user.

Authorization

This request requires authorization with the following scope (read more about authentication and authorization).

Scope
https://www.googleapis.com/auth/gmail.settings.basic

Request body

In the request body, supply data with the following structure:

{
  "enableAutoReply": boolean,
  "responseSubject": string,
  "responseBodyPlainText": string,
  "responseBodyHtml": string,
  "restrictToContacts": boolean,
  "restrictToDomain": boolean,
  "startTime": long,
  "endTime": long
}
Property name Value Description Notes
enableAutoReply boolean Flag that controls whether Gmail automatically replies to messages.
responseSubject string Optional text to prepend to the subject line in vacation responses. In order to enable auto-replies, either the response subject or the response body must be nonempty.
responseBodyPlainText string Response body in plain text format.
responseBodyHtml string Response body in HTML format. Gmail will sanitize the HTML before storing it.
restrictToContacts boolean Flag that determines whether responses are sent to recipients who are not in the user's list of contacts.
restrictToDomain boolean Flag that determines whether responses are sent to recipients who are outside of the user's domain. This feature is only available for G Suite users.
startTime long An optional start time for sending auto-replies (epoch ms). When this is specified, Gmail will automatically reply only to messages that it receives after the start time. If both startTime and endTime are specified, startTime must precede endTime.
endTime long An optional end time for sending auto-replies (epoch ms). When this is specified, Gmail will automatically reply only to messages that it receives before the end time. If both startTime and endTime are specified, startTime must precede endTime.

Response

If successful, this method returns a response body with the following structure:

{
  "enableAutoReply": boolean,
  "responseSubject": string,
  "responseBodyPlainText": string,
  "responseBodyHtml": string,
  "restrictToContacts": boolean,
  "restrictToDomain": boolean,
  "startTime": long,
  "endTime": long
}
Property name Value Description Notes
enableAutoReply boolean Flag that controls whether Gmail automatically replies to messages.
responseSubject string Optional text to prepend to the subject line in vacation responses. In order to enable auto-replies, either the response subject or the response body must be nonempty.
responseBodyPlainText string Response body in plain text format.
responseBodyHtml string Response body in HTML format. Gmail will sanitize the HTML before storing it.
restrictToContacts boolean Flag that determines whether responses are sent to recipients who are not in the user's list of contacts.
restrictToDomain boolean Flag that determines whether responses are sent to recipients who are outside of the user's domain. This feature is only available for G Suite users.
startTime long An optional start time for sending auto-replies (epoch ms). When this is specified, Gmail will automatically reply only to messages that it receives after the start time. If both startTime and endTime are specified, startTime must precede endTime.
endTime long An optional end time for sending auto-replies (epoch ms). When this is specified, Gmail will automatically reply only to messages that it receives before the end time. If both startTime and endTime are specified, startTime must precede endTime.

Try it!

Use the APIs Explorer below to call this method on live data and see the response.

フィードバックを送信...

ご不明な点がありましたら、Google のサポートページをご覧ください。