【问题标题】:Get Twitter screen name from "oauth_token" and "oauth_token_secret"从“oauth_token”和“oauth_token_secret”获取 Twitter 网名
【发布时间】:2012-08-10 23:36:38
【问题描述】:

我将“oauth_token”和“oauth_token_secret”值存储在数据库中。是否可以仅从这两个值中检索 twitter 帐户的用户名?

【问题讨论】:

    标签: api oauth twitter twitter-oauth


    【解决方案1】:

    您可以使用以下 REST 方法:GET https://api.twitter.com/1/account/verify_credentials.json(或 .xml,如果您更喜欢 XML 结果而不是 JSON)。这是一个经过身份验证的请求,因此您将照常在Authorization 标头中传递oauth_token。如果请求成功,它将返回 200 OK HTTP 代码以及相应的用户。否则它将返回 401 返回码。用于请求的 Twitter 应用程序当然必须得到用户的授权。

    【讨论】:

      猜你喜欢
      • 2011-11-14
      • 1970-01-01
      • 2014-08-16
      • 2011-12-01
      • 1970-01-01
      • 1970-01-01
      • 2012-08-16
      • 1970-01-01
      • 2011-12-12
      相关资源
      最近更新 更多