Identify if the post author is a page or a user?

207 views Asked by At

What is the proper way to identify if the author of a post is a user or a page?

v2.8/OrangeESP/feed?fields=id,from{id,name,link}

"data": [
{
  "id": "118067454874491_1584993008181921",
  "from": {
    "id": "1112315252115029",
    "name": "Clara Barranquero",
    "link": "https://www.facebook.com/app_scoped_user_id/1112315252115029/"
  }
},

I currently use the "from.link" for that and if it is of form

https://www.facebook.com/app_scoped_user_id// then is a User

if it's of from

https://www.facebook.com/ then it is a Page

In v2.4 I could have included from{category} in the response and if that was not empty it meant the author is a Page.

1

There are 1 answers

2
andyrandy On

Include a field that´s only available in the Page or User table:

Checking for app_scoped_user_id in the link field is not a bad idea though.