【发布时间】:2018-10-15 20:40:09
【问题描述】:
我需要在网站上发布我客户的完整 Instagram 供稿。我尝试了几种访问 instagram 并获取整个提要的方法,但我遇到了一些错误。
使用 gem“instagram”(最简单最简单的方法)我尝试获取访问令牌时出现以下错误。
Instagram::BadRequest: POST https://api.instagram.com/oauth/access_token/: 400: OAuthException: Matching code was not found or was already used.
我尝试使用我的浏览器按照 instagram 文档 https://www.instagram.com/developer/authentication/ 上的指示获取访问令牌,但我无法在 ruby 中手动执行 http 调用。
我需要下载所有数据并将其保存在我的数据库中(就像我一直做的那样),所以我需要控制器中的所有内容。
我的代码很简单:
accessToken = Instagram.get_access_token(Instagram.client_id, :redirect_uri => CALLBACK_URL)
client = Instagram.client(access_token: accessToken)
response = client.user_recent_media
#other code to cycle inside posts and put everything in db
我肯定在我的 instragram 注册应用程序和我的代码中包含了相同的 redirect_url。
【问题讨论】:
-
能否请您重组您的问题?我似乎无法理解您需要什么。
标签: ruby-on-rails instagram access-token