【问题标题】:getting userinformation after successful redirection from withings using withings example code使用withings示例代码从withings成功重定向后获取用户信息
【发布时间】:2014-02-05 06:13:56
【问题描述】:

我已经使用 withings 示例代码从 withings 成功重定向(回调 url)。

http://wbsapi.withings.com/cgi-bin/measure?action=getmeas&devtype=1
&oauth_consumer_key=xxxxxxxxx
&oauth_nonce=xxxxxxx
&oauth_signature=xxxxx
&oauth_signature_method=yyyy
&oauth_timestamp=yyyyy
&oauth_token=xxxxxx
&oauth_version=1.0&userid=xxx

我已经成功生成auth_tokenoauth_token_secret

Array( [oauth_token] => xxxxxxxxxxxxxxxxxxxxxxx[oauth_token_secret] => xxxxxxxxxxxxxxxx).

https://oauth.withings.com/account/access_token?
oauth_consumer_key=xxxxxxxxxxxxxxxxx
&oauth_nonce=xxxx
&oauth_signature=xxxxxxx
&oauth_signature_method=yyyyy
&oauth_timestamp=yyyyyyy
&oauth_token=yyyyyy
&oauth_version=1.0
&userid=xxxx

我已经从 withings 成功重定向(回调 url)。但我无法获取用户信息。我需要帮助来获取用户信息。

如下:

  1. 名字
  2. 姓氏
  3. 电子邮件
  4. 重量

【问题讨论】:

  • 你终于成功了吗?
  • 你有 userid=xxx。使用它,您可以简单地从数据库中获取数据??

标签: php api oauth withings


【解决方案1】:

根据 Withings API 文档 (https://developer.withings.com/oauth2/#section/Data-API/Index-Data-API),此信息不可用。您从 API 的成功身份验证中收到的是:

{
  "status": 0,
  "body": {
    "user": {
      "userid": 363,
      "access_token": "a075f8c14fb8df40b08ebc8508533dc332a6910a",
      "refresh_token": "f631236f02b991810feb774765b6ae8e6c6839ca",
      "expires_in": 10800,
      "scope": "user.info,user.metrics",
      "csrf_token": "PACnnxwHTaBQOzF7bQqwFUUotIuvtzSM",
      "token_type": "Bearer"
    }
  }
}

很遗憾,没有其他 API 调用来获取更多用户信息 - 您需要让用户在您的应用程序中填写此信息。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-01-12
    • 1970-01-01
    • 2013-07-11
    • 2016-02-17
    • 2013-08-02
    • 2013-12-05
    • 1970-01-01
    • 2016-07-23
    相关资源
    最近更新 更多