Home Get type of profile in from-field on a post
Reply: 1

Get type of profile in from-field on a post

Marcus Published in 2018-01-12 09:30:16Z

I'm getting all posts from a feed by using

GET https://graph.facebook.com/v2.11/<user-id>/feed?fields=id,admin_creator,...,from

and all works well. But the from-field in a post is a profile and the data returned does not tell me if the profile is of the type user, page etc. Is there a way to get that information? I had a look at this stackoverflow-post and it says I can use parameter metadata=1 to get the type, but how do I use it to get the type for each from-field in the collection returned?

CBroe Reply to 2018-01-12 09:57:43Z

No, adding metadata=1 is not the solution - that only lists what fields are available.

But you can for example ask for the fan_count field - only pages have a fan count, users don’t, so from whether that sub-field will be present, you can determine whether you are dealing with a page or a user. (Keep in mind that the fan count might be 0, so a simple if(fan_count) won’t do here.)

Syntax would be ?fields=from{fan_count}

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.308066 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO