我需要以编程方式检查管理控制台中的设置是否打开或关闭。 例如:
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.
但是我没有找到这个Google API。 也许有人知道这个API是否存在?
我已经检查过这个 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
实际上,我没有找到直接的 API 来检查管理控制台设置的实际状态,但我使用了方法:reports.activities.list,它允许您检查设置的状态更改。 在这里您可以使用 Google API 尝试一下,其中 userKey - 管理员电子邮件,applicationName - 管理员。
Java 用法:
`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());
}`
您可以在此处
找到活动名称