Search code examples
ruby-on-railsfacebooktabskoala

Koala - Create tab in facebook (rails)


I want to create tabs on FB.

I have this code:

@graph = Koala::Facebook::API.new(Client.find(session[:id_client]).oauth_token)
@graph.put_connections("4154829881847172/tabs","POST", {:access_token => "AAABwdtYjsyoBAMcg558a4FYnZBkZBUiPKmcWWssssWoNZC2yjqE43ghoR9uTiFIhT3ErkQYx45RrrPeOD0ZCvFgnmRIUh9lqRUw5KIlWwxtRW3GvbIEUWp0yB2", :app_id => '1236553701115690'})

But I have a problem

-> OAuthException: (#210) Subject must be a page.


Solution

  • Is 4154829881847172 the correct ID for the page you're trying to add the tab to? And are you definitely using the page's access token? (as opposed to a user access token for the page admin)

    Either of those being incorrect means you're passing a something-other-than-a-page's ID in place of the Page ID