我尝试通过 api 获取调查结果,但仍然出现错误。我能够获取谷歌日历事件,但是当我尝试获取调查列表或结果(https://www.googleapis.com/surveys/v2/surveys/{survey_ID}/results)时,我得到:
"domain": "global",
"reason": "INVALID_CREDENTIALS",
"message": "User must be authenticated to make this call. Request Id: 5a73195500ff0c64532dccb0ef0001737e3430322d747269616c320001707573682d30312d33312d72313100010163",
"locationType": "header",
"location": "Authorization"
}
看起来我的访问令牌不正确,但是使用相同的令牌和方法,我得到了例如日历事件。看起来我没有范围,但是当我发出这个请求时,https://www.googleapis.com/oauth2/v1/tokeninfo?access_token={valid_token}
我得到了正确的答案:
"issued_to": "822311642112-***********.apps.googleusercontent.com",
"audience": "822311642112-***********.apps.googleusercontent.com",
"scope": "https://www.google.com/calendar/feeds/ https://www.googleapis.com/auth/surveys",
"expires_in": 2983,
"access_type": "offline"
我在我的帐户中启用了调查 api。我正在通过 windows 对象 Microsoft.XMLHTTP 从视觉 foxpro 桌面应用程序运行此代码
知道我在做什么错吗?
编辑:这不是这个问题的重复,因为我的身份验证凭证适用于日历,但不适用于调查。看起来 Maia Werbos 对我有正确的答案,现在我收到请求正确的响应(状态:200),但响应只包含 requestId。
玛雅非常感谢你。