we would need to integrate with GSuite API to retrieve the group members and the user details of them by a daily job.
I've followed the guide and:
- setup a service account
- enabled "Admin SDK" at "Google Cloud console"
- checked "Enable API access" at GSuite "Google Admin" -> "API Reference"
- granted permission to the service account at "Manage API client access" with the following:
- View group subscriptions on your domain https://www.googleapis.com/auth/admin.directory.group.member.readonly
- View groups on your domain https://www.googleapis.com/auth/admin.directory.group.readonly
- View users on your domain https://www.googleapis.com/auth/admin.directory.user.readonly
However the response I got when I try to call: - https://www.googleapis.com/admin/directory/v1/groups/{group id}/members, or - https://www.googleapis.com/admin/directory/v1/users/{user email}
I got "Not Authorized to access this resource/api".
I've tried to use CURL to exchange access token, and tried to use JAVA SDK, both returned the same error.
Please let me know if I've missed out anything. Thanks a lot.