OAuthException "(#210) Subject must be a page."
Asked Answered
D

2

8

I Keep getting OAuthException (#210) Subject must be a page. error even if I am using the Page Access Token and not the App Access Token.

I am using the following:

  1. Latest JavaScript SDK from facebook (//connect.facebook.net/en_US/all.js)
  2. Calling the /{PAGE_ID}/tabs?app_id={APP_ID}&method=POST&access_token={PAGE_ACCESS_TOKEN} using the FB.api method once the user is logged in.

My Application is not FBML but a Canvas / iFrame App. What am i doing wrong?

I have researched the web including the Stackoverflow and other facebook forums but still no answer on this. OAuth is Enabled for my Application.

Also, If i copy and paste the link in Browser it works fine. It does not if I do it using the API.

Depredate answered 6/12, 2011 at 7:2 Comment(0)
D
5

I finally got it working.

However, Instead of using the FB.api to call the link above, i used jQuery.

I used jQuery "$.getJson(url)" and it worked.

It works as below.

Construct the link as below.

"https://graph.facebook.com/{PAGE_ID}/tabs?app_id={APP_ID}&method=POST&access_token={PAGE_ACCESS_TOKEN}&callback=?"

Call the jQuery method as below. "$.getJSON(pageUrl, OnCallBack);" where "OnCallBack" is the call back method. You can do anything that you would need in the call back. In my case it was something like below.

    function OnCallBack(r, s) {

        var html = "";
        if (s == "success" && !r.error) {
            for (p in r) {
                html += p + ": " + r[p] + "<br />";
            }
        } else {
            html = r.error.message;
        }
        $("#dv").html(html);
    }
Depredate answered 8/12, 2011 at 6:27 Comment(0)
F
3

To anybody who gets this error again: I have get the same error message while I use wininet to post a https request to https://graph.facebook.com/......

I just changed the verb from "POST" to "GET" , and then it works well:

//string strVerb = "POST";
string strVerb = "GET";

PS: variable "strVerb" is used as the 2nd parameter of windows function HttpOpenRequest.

Feretory answered 30/7, 2012 at 6:38 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.