Cuando se actualiza y recupera la configuración de Grupos de Google, una solicitud a la API requiere la autenticación y la clave de API como se describe en Cómo crear credenciales de acceso. Para obtener más información, consulta Obtén información sobre la autenticación y la autorización.
Cómo actualizar toda la configuración de un grupo
Para actualizar la configuración de un grupo, incluye el encabezado Authorization
y la clave de API en la siguiente solicitud HTTP PUT
:
PUT https://www.googleapis.com/groups/v1/groups/GROUP_ID
Reemplaza GROUP_ID
por el ID del grupo. Por ejemplo, el siguiente comando actualiza la configuración del grupo salesgroup@example.com:
PUT https://www.googleapis.com/groups/v1/groups/salesgroup@example.com
El cuerpo de la solicitud está en formato JSON. En el siguiente ejemplo, se muestran todos los parámetros de configuración posibles:
{ "kind": "groupsSettings#groups", "email": "salesgroup@example.com", "name": "Sales Group", "description": "This is the sales group", "whoCanAdd": "ALL_MANAGERS_CAN_ADD", "whoCanJoin": "INVITED_CAN_JOIN", "whoCanViewMembership": "ALL_IN_DOMAIN_CAN_VIEW", "whoCanViewGroup": "ALL_IN_DOMAIN_CAN_VIEW", "whoCanInvite": "ALL_MANAGERS_CAN_INVITE", "allowExternalMembers": "false", "whoCanPostMessage": "ALL_IN_DOMAIN_CAN_POST", "allowWebPosting": "true", "primaryLanguage": "en", "maxMessageBytes": 10240, "isArchived": "true", "archiveOnly": "false", "messageModerationLevel": "MODERATE_NONE", "spamModerationLevel": "ALLOW", "replyTo": "REPLY_TO_IGNORE", "customReplyTo": "sales@example.com", "includeCustomFooter": "true", "customFooterText": "This messages is from the Sales Group at example.com", "sendMessageDenyNotification": "true", "defaultMessageDenyNotificationText": "Your Message has been denied.", "showInGroupDirectory": "false", "allowGoogleCommunication": "false", "membersCanPostAsTheGroup": "false", "messageDisplayFont": "DEFAULT_FONT", "includeInGlobalAddressList": "false", "whoCanLeaveGroup": "ALL_MEMBERS_CAN_LEAVE", "whoCanContactOwner": "ALL_IN_DOMAIN_CAN_CONTACT", "whoCanAddReferences": "ALL_MEMBERS", "whoCanAssignTopics": "NONE", "whoCanUnassignTopic": "NONE", "whoCanTakeTopics": "NONE", "whoCanMarkDuplicate": "NONE", "whoCanMarkNoResponseNeeded": "NONE", "whoCanMarkFavoriteReplyOnAnyTopic": "NONE", "whoCanMarkFavoriteReplyOnOwnTopic": "NONE", "whoCanUnmarkFavoriteReplyOnAnyTopic": "NONE", "whoCanEnterFreeFormTags": "NONE", "whoCanModifyTagsAndCategories": "NONE", "favoriteRepliesOnTop": "false", "whoCanApproveMembers": "ALL_MANAGERS_CAN_APPROVE", "whoCanBanUsers": "OWNERS_AND_MANAGERS", "whoCanModifyMembers": "OWNERS_AND_MANAGERS", "whoCanApproveMessages": "OWNERS_ONLY", "whoCanDeleteAnyPost": "OWNERS_AND_MANAGERS", "whoCanDeleteTopics": "OWNERS_AND_MANAGERS", "whoCanLockTopics": "OWNERS_AND_MANAGERS", "whoCanMoveTopicsIn": "NONE", "whoCanMoveTopicsOut": "NONE", "whoCanPostAnnouncements": "NONE", "whoCanHideAbuse": "OWNERS_AND_MANAGERS", "whoCanMakeTopicsSticky": "OWNERS_AND_MANAGERS", "whoCanModerateMembers": "OWNERS_AND_MANAGERS", "whoCanModerateContent": "OWNERS_ONLY", "whoCanAssistContent": "ALL_MEMBERS", "customRolesEnabledForSettingsToBeMerged": "false", "enableCollaborativeInbox": "false", "whoCanDiscoverGroup": "ALL_IN_DOMAIN_CAN_DISCOVER", "defaultSender": "DEFAULT_SELF" }
Si la respuesta es correcta, se mostrará un código de estado HTTP 200
. Junto con el código de estado, la respuesta muestra la configuración del grupo actualizada. Para obtener más información sobre esta configuración, consulta la referencia de la API.
En el siguiente ejemplo, se muestra la respuesta JSON:
{ "kind": "groupsSettings#groups", "email": "salesgroup@example.com", "name": "Sales Group", "description": "This is the sales group", "whoCanAdd": "ALL_MANAGERS_CAN_ADD", "whoCanJoin": "INVITED_CAN_JOIN", "whoCanViewMembership": "ALL_IN_DOMAIN_CAN_VIEW", "whoCanViewGroup": "ALL_IN_DOMAIN_CAN_VIEW", "whoCanInvite": "ALL_MANAGERS_CAN_INVITE", "allowExternalMembers": "false", "whoCanPostMessage": "ALL_IN_DOMAIN_CAN_POST", "allowWebPosting": "true", "primaryLanguage": "en", "maxMessageBytes": 10240, "isArchived": "true", "archiveOnly": "false", "messageModerationLevel": "MODERATE_NONE", "spamModerationLevel": "ALLOW", "replyTo": "REPLY_TO_IGNORE", "customReplyTo": "sales@example.com", "includeCustomFooter": "true", "customFooterText": "This messages is from the Sales Group at example.com", "sendMessageDenyNotification": "true", "defaultMessageDenyNotificationText": "Your Message has been denied.", "showInGroupDirectory": "false", "allowGoogleCommunication": "false", "membersCanPostAsTheGroup": "false", "messageDisplayFont": "DEFAULT_FONT", "includeInGlobalAddressList": "false", "whoCanLeaveGroup": "ALL_MEMBERS_CAN_LEAVE", "whoCanContactOwner": "ALL_IN_DOMAIN_CAN_CONTACT", "whoCanAddReferences": "ALL_MEMBERS", "whoCanAssignTopics": "NONE", "whoCanUnassignTopic": "NONE", "whoCanTakeTopics": "NONE", "whoCanMarkDuplicate": "NONE", "whoCanMarkNoResponseNeeded": "NONE", "whoCanMarkFavoriteReplyOnAnyTopic": "NONE", "whoCanMarkFavoriteReplyOnOwnTopic": "NONE", "whoCanUnmarkFavoriteReplyOnAnyTopic": "NONE", "whoCanEnterFreeFormTags": "NONE", "whoCanModifyTagsAndCategories": "NONE", "favoriteRepliesOnTop": "false", "whoCanApproveMembers": "ALL_MANAGERS_CAN_APPROVE", "whoCanBanUsers": "OWNERS_AND_MANAGERS", "whoCanModifyMembers": "OWNERS_AND_MANAGERS", "whoCanApproveMessages": "OWNERS_ONLY", "whoCanDeleteAnyPost": "OWNERS_AND_MANAGERS", "whoCanDeleteTopics": "OWNERS_AND_MANAGERS", "whoCanLockTopics": "OWNERS_AND_MANAGERS", "whoCanMoveTopicsIn": "NONE", "whoCanMoveTopicsOut": "NONE", "whoCanPostAnnouncements": "NONE", "whoCanHideAbuse": "OWNERS_AND_MANAGERS", "whoCanMakeTopicsSticky": "OWNERS_AND_MANAGERS", "whoCanModerateMembers": "OWNERS_AND_MANAGERS", "whoCanModerateContent": "OWNERS_ONLY", "whoCanAssistContent": "ALL_MEMBERS", "customRolesEnabledForSettingsToBeMerged": "false", "enableCollaborativeInbox": "false", "whoCanDiscoverGroup": "ALL_IN_DOMAIN_CAN_DISCOVER", "defaultSender": "DEFAULT_SELF" }
Actualiza algunos parámetros de configuración de un grupo
Si deseas actualizar un subconjunto de estas configuraciones, usa la solicitud HTTP PATCH
para realizar una actualización parcial.
PATCH https://www.googleapis.com/groups/v1/groups/GROUP_ID
Cómo recuperar la configuración de un grupo
Para recuperar la configuración de un grupo, incluye el encabezado Authorization
en la siguiente solicitud HTTP GET
:
GET https://www.googleapis.com/groups/v1/groups/groupUniqueId
En el siguiente ejemplo, se recupera la configuración del grupo salesgroup@example.com:
GET https://www.googleapis.com/groups/v1/groups/salesgroup@example.com
Una respuesta correcta muestra un código de estado HTTP 200
. Junto con el código de estado, la respuesta muestra la configuración del grupo salesgroup@example.com. Para obtener más información sobre estos parámetros de configuración, consulta la referencia de la API.
En el siguiente ejemplo, se muestra la respuesta JSON:
{ "kind": "groupsSettings#groups", "email": "salesgroup@example.com", "name": "Sales Group", "description": "This is the sales group", "whoCanAdd": "ALL_MANAGERS_CAN_ADD", "whoCanJoin": "INVITED_CAN_JOIN", "whoCanViewMembership": "ALL_IN_DOMAIN_CAN_VIEW", "whoCanViewGroup": "ALL_IN_DOMAIN_CAN_VIEW", "whoCanInvite": "ALL_MANAGERS_CAN_INVITE", "allowExternalMembers": "false", "whoCanPostMessage": "ALL_IN_DOMAIN_CAN_POST", "allowWebPosting": "true", "primaryLanguage": "en", "maxMessageBytes": 10240, "isArchived": "true", "archiveOnly": "false", "messageModerationLevel": "MODERATE_NONE", "spamModerationLevel": "ALLOW", "replyTo": "REPLY_TO_IGNORE", "customReplyTo": "sales@example.com", "includeCustomFooter": "true", "customFooterText": "This messages is from the Sales Group at example.com", "sendMessageDenyNotification": "true", "defaultMessageDenyNotificationText": "Your Message has been denied.", "showInGroupDirectory": "false", "allowGoogleCommunication": "false", "membersCanPostAsTheGroup": "false", "messageDisplayFont": "DEFAULT_FONT", "includeInGlobalAddressList": "false", "whoCanLeaveGroup": "ALL_MEMBERS_CAN_LEAVE", "whoCanContactOwner": "ALL_IN_DOMAIN_CAN_CONTACT", "whoCanAddReferences": "ALL_MEMBERS", "whoCanAssignTopics": "NONE", "whoCanUnassignTopic": "NONE", "whoCanTakeTopics": "NONE", "whoCanMarkDuplicate": "NONE", "whoCanMarkNoResponseNeeded": "NONE", "whoCanMarkFavoriteReplyOnAnyTopic": "NONE", "whoCanMarkFavoriteReplyOnOwnTopic": "NONE", "whoCanUnmarkFavoriteReplyOnAnyTopic": "NONE", "whoCanEnterFreeFormTags": "NONE", "whoCanModifyTagsAndCategories": "NONE", "favoriteRepliesOnTop": "false", "whoCanApproveMembers": "ALL_MANAGERS_CAN_APPROVE", "whoCanBanUsers": "OWNERS_AND_MANAGERS", "whoCanModifyMembers": "OWNERS_AND_MANAGERS", "whoCanApproveMessages": "OWNERS_ONLY", "whoCanDeleteAnyPost": "OWNERS_AND_MANAGERS", "whoCanDeleteTopics": "OWNERS_AND_MANAGERS", "whoCanLockTopics": "OWNERS_AND_MANAGERS", "whoCanMoveTopicsIn": "NONE", "whoCanMoveTopicsOut": "NONE", "whoCanPostAnnouncements": "NONE", "whoCanHideAbuse": "OWNERS_AND_MANAGERS", "whoCanMakeTopicsSticky": "OWNERS_AND_MANAGERS", "whoCanModerateMembers": "OWNERS_AND_MANAGERS", "whoCanModerateContent": "OWNERS_ONLY", "whoCanAssistContent": "ALL_MEMBERS", "customRolesEnabledForSettingsToBeMerged": "false", "enableCollaborativeInbox": "false", "whoCanDiscoverGroup": "ALL_IN_DOMAIN_CAN_DISCOVER", "defaultSender": "DEFAULT_SELF" }