简体   繁体   中英

get logged in user details with Facebook sdk and .Net

I am following this link to get the logged in users details and using this code snippet below

 FacebookClient fb = new FacebookClient(string_access_token_here);
 dynamic myInfo = fb.Get("/me")
 dynamic myExtraInfo = fb.Get("/me?fields=albums.limit(5).fields(name, photos.limit(2).fields(name, picture, tags.limit(2))),posts.limit(5)");

While I get the basic details in myInfo, in my extra info variable I only end up getting an ID I suspect I have not crafted the URL properly. Is there something else I need to do?

You need to request the user_photos permission for your access token before you can request albums/photos.

The query itself is fine:

https://developers.facebook.com/tools/explorer?method=GET&path=me%3Ffields%3Dalbums.limit(5).fields(name%2C%20photos.limit(2).fields(name%2C%20picture%2C%20tags.limit(2)))%2Cposts.limit(5)&version=v2.0

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