我正在尝试使用OAuth.io来允许用户将Fitbit连接到我们的应用程序。现在,我正在尝试了解使用以下代码使用开箱即用的Fitbit配置可以获得哪些信息:
$scope.connectFitbit = function() {
OAuth.initialize(OAUTHIO_KEY);
OAuth.popup('fitbit').done(function(result) {
console.log(result);
});
};我在响应中接收到一个令牌和令牌秘密,这很好,但是我不知道如何获得Fitbit用户ID,我需要存储所有这三个来发出API请求。文件不清楚的下一个步骤,所以任何帮助将不胜感激!
包括控制台输出以供参考。
Object {oauth_token: "TOKEN", oauth_token_secret: "TOKEN_SECRET", get: function, post: function, put: function…}
del: function (opts, opts2) {
get: function (opts, opts2) {
me: function (filter) {
oauth_token: "TOKEN"
oauth_token_secret: "TOKEN_SECRET"
patch: function (opts, opts2) {
post: function (opts, opts2) {
put: function (opts, opts2) {
__proto__: Object发布于 2015-08-06 04:26:32
所以,尽管这里没有广播,我还是慢吞吞地找出了答案。然后,您需要调用用户配置文件API,但要使用经过身份验证的用户方法。
把这个放进你的完成区:
result.get("/1/user/-/profile.json").done(function(data)
{
uID = data.user.encodedId;
// Store uID along with token and secret for future use
}https://stackoverflow.com/questions/31628622
复制相似问题