I need to check programmaticaly if in admin console setting ON or OFF. For example:
1. Log in to admin.google.com as an administrator.
2. Select Apps.
3. Select Google Workspace.
4. Select Gmail.
5. Under Safety - Spoofing and authentication, check - Protect against spoofing of employee names.
But I didn't find this Google API. Maybe someone know is this API exist?
I alreday checked this Google API: https://developers.google.com/gmail/api/reference/rest
https://cloud.google.com/identity/docs/apis
https://developers.google.com/admin-sdk/directory/reference/rest/v1/groups
Actually, I didn't find direct API to check ACTUAL STATE of admin console settings, but I used Method: reports.activities.list which allows you to check CHANGES OF STATE for settings. Here you can play with Google API TRY ME where userKey - admin email, applicationName - admin.
Java Usage:
`public Activities getAdminConsoleActivities(String rootEmail,
ServiceAccountCredentials apiToken,
GsuiteEventName eventName,
String nextPageToken,
LocalDateTime startTime) {
Reports service = getReportsService(apiToken);
return new GsuiteBackoffExecutor<Activities>(apiToken)
.get(() -> service.activities()
.list("all", "admin")
.setEventName(eventName.name())
.setPageToken(nextPageToken)
.setMaxResults(DEFAULT_PAGE_SIZE)
.setStartTime(startTime.format(DateTimeFormatter.ofPattern(YYYY_MM_DD_T_HH_MM_SS_SSS_Z)))
.setQuotaUser(rootEmail)
.execute());
}`
Event Names you can find here