เรียกข้อมูลและอัปเดตการตั้งค่าสําหรับ Google Groups

เมื่ออัปเดตและเรียกข้อมูลการตั้งค่าสำหรับ Google Groups คำขอ API ต้องใช้การตรวจสอบสิทธิ์และคีย์ API ตามที่อธิบายไว้ในหัวข้อสร้างข้อมูลเข้าสู่ระบบ ดูข้อมูลเพิ่มเติมได้ในดูข้อมูลเกี่ยวกับการตรวจสอบสิทธิ์และการให้สิทธิ์

อัปเดตการตั้งค่าทั้งหมดสำหรับกลุ่ม

หากต้องการอัปเดตการตั้งค่าของกลุ่ม ให้ใส่ส่วนหัว Authorization และคีย์ API ในคำขอ HTTP PUT ต่อไปนี้

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

แทนที่ GROUP_ID ด้วยรหัสของกลุ่ม เช่น คำสั่งต่อไปนี้จะอัปเดตการตั้งค่ากลุ่ม salesgroup@example.com

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

เนื้อความของคำขออยู่ในรูปแบบ 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"
}

การตอบกลับที่สำเร็จจะแสดงรหัสสถานะ HTTP 200 นอกเหนือจากรหัสสถานะแล้ว การตอบสนองจะแสดงการตั้งค่ากลุ่มที่อัปเดตแล้วด้วย ดูข้อมูลเพิ่มเติมเกี่ยวกับการตั้งค่าเหล่านี้ได้ที่ข้อมูลอ้างอิง API

ตัวอย่างต่อไปนี้แสดงการตอบกลับ 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"
}

อัปเดตการตั้งค่าบางอย่างสำหรับกลุ่ม

หากต้องการอัปเดตการตั้งค่าเหล่านี้เพียงบางส่วน ให้ใช้คำขอ HTTP PATCH สำหรับการอัปเดตบางส่วน

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

เรียกข้อมูลการตั้งค่าของกลุ่ม

หากต้องการเรียกข้อมูลการตั้งค่าของกลุ่ม ให้ใส่ส่วนหัว Authorization ในคำขอ HTTP GET ต่อไปนี้

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

ตัวอย่างต่อไปนี้จะดึงข้อมูลการตั้งค่ากลุ่ม salesgroup@example.com

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

การตอบกลับที่สำเร็จจะแสดงรหัสสถานะ HTTP 200 นอกจากรหัสสถานะแล้ว การตอบกลับจะแสดงการตั้งค่าของกลุ่ม salesgroup@example.com ดูข้อมูลเพิ่มเติมเกี่ยวกับการตั้งค่าเหล่านี้ได้ที่เอกสารอ้างอิง API

ตัวอย่างต่อไปนี้แสดงการตอบกลับ 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"
}