Groups

Web.API Controller Class for Group Entities: Groups and Contacts

Get Group List

GET https://account.sf-api.com/sf/v3/Groups 

Retrieves all Distribution Groups this user has permissions to View in this account

Returns: a list of Groups this user has access to

Get Group By ID

GET https://account.sf-api.com/sf/v3/Groups(id) 

Retrives a single Group by id

idString Group id to retrieve

Returns: A single Group object

Delete Group

DELETE https://account.sf-api.com/sf/v3/Groups(id) 

Removes a single Group by id

idString Group to remove

Create Group

POST https://account.sf-api.com/sf/v3/Groups 
            { 
              "Name":"Name", 
              "IsShared":true, 
              "Contacts":[{"Email":"user.one@domain.com"},{"Email":"user.two@domain.com"}] 
            } 

Creates a new group. The Post body must include the specification of the group.

groupGroup Specification of the group for creation

Returns: the new group instance

Update Group

PATCH https://account.sf-api.com/sf/v3/Groups(id) 
            { 
              "Name":"Name", 
              "IsShared":true, 
            } 

Updates an existing group. This operation will ignore the provided clients list. Use the \Contacts navigation link to add/remove elements from a group

idString The group identifier
groupGroup The partial group object containing the modified fields for updating

Returns: the modified group object

Get Group Contacts

GET https://account.sf-api.com/sf/v3/Groups(id)/Contacts 

Retrieves the Contacts navigation property of a Group

idString The group identifier

Returns: A feed of Contacts representing the members of the Group

Add Contacts to Group

POST https://account.sf-api.com/sf/v3/Groups(id)/Contacts 
            [{"Email":"user.one@domain.com"},{"Id":"abcd"}] 

Adds a list of contacts to a group The contact list may contain either contact ID (same as User ID) or Email.

idString A group identifier
contactsContact[] A list of contacts

Returns: The updated list of contacts for this group

Remove Contacts from Group

DELETE https://account.sf-api.com/sf/v3/Groups(id)/Contacts 
            [{"Email":"user.one@domain.com"},{"Id":"abcd"}] 

Removes contacts from a group The contact list may contain either contact ID (same as User ID) or Email. This method will ignore missing references in the provided list - i.e., if an email in the contacts list is not present in the group, it will be ignored. The method will not enforce that ID and Email match inside a single Contact instance: Id will be looked up first, then Email.

idString A group identifier
contactsContact[] A list of contacts

Returns: The updated list of contacts for this group

Export Group Contacts as document

GET https://account.sf-api.com/sf/v3/Groups(id)/ExportDocument?token=123 
idString A group identifier
documentTypeDocumentType Used to specify DocumentType format for export, default value is Xlsx
tokenString Token from call to Groups(id)/ExportDocument?getSignedUrl=true

Returns: Exports List of Contact (s) in a given group as SpreadSheet or CSV

Retrieve Groups associated with a User

GET https://account.sf-api.com/sf/v3/Users(id)/Groups 

Returns all groups the user is associated. This is currently limited to the authenticated user.

idString User Id

Returns: Feed of Groups