我使用由ADMIN_DIRECTORY_USER api创建的G Suite帐户, 并尝试使用以下链接获取我刚刚创建的Google环聊数据(通过我创建的帐户)
以下是我的参数和链接
userKey:全部
applicationName:见面
eventName:call_ended
https://developers.google.com/admin-sdk/reports/v1/appendix/activity/meet
我得到的答复是
{
"error": {
"errors": [
{
"domain": "global",
"reason": "authError",
"message": "Access denied. You are not authorized to read activity records.",
"locationType": "header",
"location": "Authorization"
}
],
"code": 401,
"message": "Access denied. You are not authorized to read activity records."
}
}
任何人都可以帮忙!谢谢
答案 0 :(得分:1)
您尝试使用的API仅对管理员可用,这意味着该域的普通用户无法使用它,因此将收到401 Access denied. You are not authorized to read activity records.
错误。
如本文档here所述,先决条件之一是获得G Suite帐户并创建管理员。
因此,如果您创建的新用户是不是管理员,该错误将继续存在。
如果要更新创建的用户并使其成为管理员,只需使用以下请求即可。
HTTP请求
POST https://www.googleapis.com/admin/directory/v1/users/userKey/makeAdmin
身体
{
"status": true
}