facebook api access a page's photo album
So really what i would like to do is access my page's photos albums to include them into my own website. So i can upload to facebook and have that viewable on my own site.
I using the php s开发者_运维问答kd but fql would be better for this as i can easily get a JSON object back and i believe i wouldn't need to use the sdk as this is for user's informtaion not a pages details.
So does anybody have ideas on this?
url i'm trying to access the query: https://api.facebook.com/method/fql.query?query=SELECT%20name%20FROM%20album%20Where%20aid=%27118818791532414%27&format=JSON
Page i am taking the photos from: www.facebook.com/mayfieldathleticfc
Album i am using as an example: http://www.facebook.com/media/set/?set=a.118818791532414.24873.118816378199322
I thought maybe i hadn't set the photos to public but after closer inspection i don't believe you can do this?
Anyway thoughts are welcome =)
That URL returns to you an informative error message:
{"error_code":102,"error_msg":"Session key invalid or no longer valid",
"request_args":[{"key":"method","value":"fql.query"},
{"key":"query","value":"SELECT name FROM album Where aid='118818791532414'"},
{"key":"format","value":"JSON"}]}
To call Facebook APIs, you have to pass in a session key - even to access 'public' things. A good starting point for learning how to authenticate and get a session key is http://developers.facebook.com/docs/authentication/
After a little more routing around i realised that it was my id's and owners details that was not correct: api.facebook.com/method/… i had this sorted it worked.
精彩评论