Method: users.labels.create
Solicitud HTTP
POST https://gmail.googleapis.com/gmail/v1/users/{userId}/labels
La URL usa la sintaxis de la transcodificación gRPC.
Parámetros de ruta de acceso
Parámetros |
userId |
string
La dirección de correo electrónico del usuario. Se puede usar el valor especial me para indicar el usuario autenticado.
|
Cuerpo de la solicitud
El cuerpo de la solicitud incluye una instancia de Label
.
Cuerpo de la respuesta
Si el proceso se realiza de forma correcta, el cuerpo de la respuesta contiene una instancia recién creada de Label
.
Permisos de autorización
Se necesita uno de los siguientes alcances de OAuth:
https://mail.google.com/
https://www.googleapis.com/auth/gmail.modify
https://www.googleapis.com/auth/gmail.labels
Para obtener más información, consulta la guía de autorización.
Salvo que se indique lo contrario, el contenido de esta página está sujeto a la licencia Atribución 4.0 de Creative Commons, y los ejemplos de código están sujetos a la licencia Apache 2.0. Para obtener más información, consulta las políticas del sitio de Google Developers. Java es una marca registrada de Oracle o sus afiliados.
Última actualización: 2024-09-05 (UTC)
[null,null,["Última actualización: 2024-09-05 (UTC)"],[[["Creates a new label for a user's Gmail account using an HTTP POST request."],["Requires providing the user's email address (or `me` for the authenticated user) as a path parameter."],["The request body should contain details of the new label, and a successful response will return the created label details."],["Requires specific authorization scopes, such as `https://mail.google.com/` or `https://www.googleapis.com/auth/gmail.labels`, for access."]]],["This documentation details the process for creating a new label via the Gmail API. A `POST` request is sent to `https://gmail.googleapis.com/gmail/v1/users/{userId}/labels`, with the `userId` path parameter specifying the user. The request body must include a `Label` instance. Successful requests return the newly created `Label` in the response body. Authorization requires specific OAuth scopes, including `https://mail.google.com/` and others. The operation can be tested using the `Try it!` function.\n"]]