简体   繁体   中英

How can I get the JSON data for the photos in my Facebook albums?

The example given on the Facebook Graph API page was https://graph.facebook.com/98423808305 - and this gives all the photos in the album and their URL. I am assuming that 98423808305 part is the Album ID. The trouble is, how do I get my own Album IDs? Where can I find this in the URL of my albums?

The first element in the query string is ?set=a.xxxx.yyyy.zzzz , with more digits than that of course. I tried using xxx, yyyy, zzzz. Using zzzzz gave me brief details of my own profile. Using yyyyy gave me someone else's profile. Using zzzzz gave me false .

I am a total newbie in Facebook APIs and finding it all very overwhelming, not knowing exactly where to start. Any assistance would be greatly appreciated.

Thanks, D.

CLARIFICATION: I am hoping to embed photos from my public FB albums in my own website. It is CMS driven so I thought it'd be nice if I can provide a macro of some sort, the user/editor can then enter some details (album ID, or whatever) and the macro will fetch the JSON data, and generate an album out of it on the CMS page. From what I can see in the client-side authentication method there's a process which requires me to authenticate on FB to get an access token. Is there any way to fetch a public album without authentication?

Trying to extract API object ids from urls will always be brittle, as Facebook could change the url format at any time. If you're planning to use the Graph API, GET /me/albums will include the Graph API ids of your albums.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM