我的Rails应用尝试获取用户相册:
@graph = Koala::Facebook::API.new(session[:fb_auth_token])
@albums_raw = @graph.get_connections("me", "albums")
@albums_raw.each do |a|
@cover_raw = @graph.get_object(a["cover_photo"])
a["cover"] = @cover_raw["picture"]
end
在此之前,我正在获取身份验证令牌:
[:fb_auth_token] = auth_hash["credentials"]["token"]
我查看了我的应用设置,并且没有年龄限制。
当我以只有一个图像(配置文件)的测试用户身份登录时,代码工作正常。如果我以很多相册的身份登录,我会收到错误:
在1037毫秒内完成500内部服务器错误
Koala::Facebook::ClientError (type: GraphMethodException, code: 100, message: Unsupported get request. [HTTP 400]):
app/controllers/mixtape_images_controller.rb:43:in `block in new'
app/controllers/mixtape_images_controller.rb:42:in `each'
app/controllers/mixtape_images_controller.rb:42:in `new'
Rendered /Users/svetter/.rvm/gems/ruby-2.0.0-p247/gems/actionpack-3.2.11/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.2ms)
Rendered /Users/svetter/.rvm/gems/ruby-2.0.0-p247/gems/actionpack-3.2.11/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (1.4ms)
Rendered /Users/svetter/.rvm/gems/ruby-2.0.0-p247/gems/actionpack-3.2.11/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (8.6ms)
有没有人知道我在这里做错了什么?
非常感谢你的推荐!