Recuperare & aggiornare le impostazioni per Google Gruppi

Durante l'aggiornamento e il recupero delle impostazioni per Google Gruppi, una richiesta API richiede l'autenticazione e la chiave API, come descritto in Creare credenziali di accesso. Per maggiori informazioni, consulta Informazioni su autenticazione e autorizzazione.

Aggiornare tutte le impostazioni di un gruppo

Per aggiornare le impostazioni di un gruppo, includi l'intestazione Authorization e la chiave API nella seguente richiesta HTTP PUT:

PUT https://www.googleapis.com/groups/v1/groups/GROUP_ID

Sostituisci GROUP_ID con l'ID del gruppo; ad esempio, quanto segue aggiorna le impostazioni del gruppo gruppo vendite@example.com:

PUT https://www.googleapis.com/groups/v1/groups/salesgroup@example.com

Il corpo della richiesta è in formato JSON. L'esempio seguente mostra tutte le possibili impostazioni:

{
 "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"
}

Una risposta corretta restituisce un codice di stato HTTP 200. Insieme al codice di stato, la risposta restituisce le impostazioni del gruppo aggiornate. Per ulteriori informazioni su queste impostazioni, consulta i riferimenti per le API.

L'esempio seguente mostra la risposta 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"
}

Aggiornare alcune impostazioni di un gruppo

Se vuoi aggiornare un sottoinsieme di queste impostazioni, utilizza la richiesta HTTP PATCH per un aggiornamento parziale.

  PATCH https://www.googleapis.com/groups/v1/groups/GROUP_ID
  

Recuperare le impostazioni per un gruppo

Per recuperare le impostazioni di un gruppo, includi l'intestazione Authorization nella seguente richiesta HTTP GET:

GET https://www.googleapis.com/groups/v1/groups/groupUniqueId

L'esempio seguente recupera le impostazioni del gruppo gruppo vendite@example.com:

GET https://www.googleapis.com/groups/v1/groups/salesgroup@example.com

Una risposta corretta restituisce un codice di stato HTTP 200. Insieme al codice di stato, la risposta restituisce le impostazioni del gruppo gruppo vendite@example.com. Per ulteriori informazioni su queste impostazioni, consulta i riferimenti per le API.

L'esempio seguente mostra la risposta 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"
}