function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Alejandro GRAlejandro GR 

Get all emails from group members

I'm trying to get emails of all group members in a given group. I can request for all members in the group, but the users comes without the email field.

Im using this endpoint: /chatter/groups/GROUP_ID/members

Is there any way to recover all user emails inside a chatter group?
Best Answer chosen by Alejandro GR
alouie_sfdcalouie_sfdc
The easiest way is to make a SOQL query that looks like this:

SELECT Member.Name, Member.Email FROM CollaborationGroupMember WHERE CollaborationGroupId = 'YOUR_GROUP_ID'

In REST, the query would be:

GET /services/data/v34.0/query?q=SELECT+Member.Name,+Member.Email+FROM+CollaborationGroupMember+WHERE+CollaborationGroupId+=+'YOUR_GROUP_ID'

All Answers

alouie_sfdcalouie_sfdc
The easiest way is to make a SOQL query that looks like this:

SELECT Member.Name, Member.Email FROM CollaborationGroupMember WHERE CollaborationGroupId = 'YOUR_GROUP_ID'

In REST, the query would be:

GET /services/data/v34.0/query?q=SELECT+Member.Name,+Member.Email+FROM+CollaborationGroupMember+WHERE+CollaborationGroupId+=+'YOUR_GROUP_ID'
This was selected as the best answer
alouie_sfdcalouie_sfdc
(substitute v34.0 with the API version you're using)
Alejandro GRAlejandro GR
Thank you very much alouie, it works like a charm!