-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
An access token is required to request this resource, OAuthException, code: 104 #97
Comments
Hi Thiago, as I said by email, it is just a matter of setting it correctly and using calls properly. Be calm. Regards, |
Hey mate, This is my simple example I'm talking about. I believe it might be some setup missing. If so, I'll contribute on the readme :) Thanks |
@serraventura You need to replace fanPageId with a Facebook App ID on this line:
create one here https://developers.facebook.com/apps |
Hi @GLiddiard , If you have a look on my Plunker you can see I'm using the name of my fanpage. Actually I tested with both the name(myfanpageapp) and ID(798758500213688) returns me the same error. If you access these links straightway you can see the same data But now I'm in doubt. Should I create an APP to get infos from a fanpage? Thanks |
@serraventura to use the Facebook SDK, you need to initialise it with an APP ID e.g:
then you can make API requests to any public endpoint via Facebook.api() method. $http.get('http://graph.facebook.com/myfanpageapp').then(function (res){
console.log(res.data);
}); |
I created an APP and tested the ID and I'm actually getting the same error. Even so, I cannot see the relation between the APP and the Fanpage. How does my APP know which Fanpage it should get the data? I'm guessing there's no need to create an APP. If I'm wrong let me know. thanks |
Ops I did not see your answer. I'll consider it. So, I should not use this library. I was thinking about it that maybe this library is not supposed to work in this way, only for facebook APPs. Thanks @GLiddiard |
@serraventura , i need the sample code for getting FB page info. I tried so many ways but i couldn't got the result. |
I'm trying to use the module just to get data from a public Fanpage no authentication needed at all.
Basically, I'm doing a very simple test.
I do the initialization, like below:
.config(function(FacebookProvider, FanPageConfig) {
FacebookProvider.setSdkVersion('v2.3');
FacebookProvider.init(FanPageConfig.fanPageId); //myfanpageapp
})
and in my Controller:
Facebook.api('/myfanpageapp', function(response) {
$scope.test = response;
});
In my Chrome Dev Tool I can see the request:
https://graph.facebook.com/v2.3/myfanpageapp?callback=FB.__globalCallbacks.f3d42770fc&method=get&pretty=0&sdk=joey
and I'm getting the following error:
{"error":{"message":"An access token is required to request this resource.","type":"OAuthException","code":104}}
If you access the URL straightway you can see the data:
https://graph.facebook.com/myfanpageapp
Is there any setup missing?
The text was updated successfully, but these errors were encountered: