【发布时间】:2019-03-04 12:16:49
【问题描述】:
我正在尝试使用 FitBit Web API。在访问 API 之前,我必须使用 OAuth2.0 框架。所以从FitBit API Documentation Page,有一个例子就是:
https://www.fitbit.com/oauth2/authorize?response_type=code&client_id=22942C&redirect_uri=http%3A%2F%2Fexample.com%2Ffitbit_auth&scope=activity%20nutrition%20heartrate%20location%20nutrition%20profile%20settings%20sleep%20social%20weight
第一个问题是:我应该使用 GET 还是 POST 方法?所需的信息位于创建的 URL 中,所以我的直觉告诉我应该使用 GET。
使用 GET 方法时,响应很奇怪。我希望有一些代码,这样我就可以在下一个 API 调用中使用它来获取实际测量值。我要打的电话是:
this.http.get('https://api.fitbit.com/1/user/userID/activities/heart/date/today/1d.json')
但我不确切知道如何使用令牌,OAuth2.0 进程不返回。
抱歉这个问题太长了,但有什么想法吗?
【问题讨论】:
标签: angular oauth angular7 fitbit