Mazdak
Mazdak

Reputation: 781

Facebook Graph API to get public video Info

I was using simple HTTP Get call like the code below to get PUBLIC video information from facebook. The user enter a video url and with this code I got video information:

var request=$.ajax({
            url:'http://graph.facebook.com/'+id + '?fields=format,source,title',                
            timeout:5000,
            success:function(data){         

                // do some stuff with data

            },
            error:function(){
                displayError('facebook');   
            }
        });

The code was working fine but recently this starts to return an error

error: {
  message: "An access token is required to request this resource.",
  type: "OAuthException",
  code: 104,
  fbtrace_id: "HYdRovB1cyn"
}

It seems that I have to pass AccessToken in some way to the API but, the question is how/where should I get this token while I do not want the user login into facebook, cause I just simply need some info of a public video.

Upvotes: 0

Views: 403

Answers (1)

Koas
Koas

Reputation: 420

Yes, you must send a token in your request. You will get the token when you create a Facebook Application, there is a guide in this blog: http://mattpilz.com/facebook-graph-access-token-photo-album/

Upvotes: 1

Related Questions