问题描述
以下是我在Google Playground上传递的请求,并尝试通过代码获取Access令牌和其他数据。这里使用的范围:https://www.googleapis.com/auth/fitness.activity.read
GET /fitness/v1/users/me/sessions?startTime=2019-12-05T00:00.000Z&endTime=2019-12-17T23:59:59.999Z&activityType=72 HTTP/1.1
Host: www.googleapis.com
Content-length: 0
Authorization: Bearer Auth_code
解决方法
您的开始时间格式不正确:
static
您需要几小时,几分钟和几秒钟:
startTime=2019-12-05T00:00.000Z
在OAuth运动场中的请求:
startTime=2019-12-05T00:00:00.000Z
响应:
GET /fitness/v1/users/me/sessions?startTime=2019-12-05T00:00:00.000Z&endTime=2019-12-17T23:59:59.999Z&activityType=72 HTTP/1.1
Host: www.googleapis.com
Content-length: 0
Authorization: ...