如何判断ID是Facebook应用程序还是用户

如何判断ID是Facebook应用程序还是用户,facebook,facebook-graph-api,Facebook,Facebook Graph Api,我有一个页面,它使用OpenGraph和FBML在我的页面上放置一个“喜欢”和“发送”按钮。客户为我的每个请求提供了两个“用户ID”;然而,当我在fb:admins元标记中提交它们并对Facebook调试使用它时,尽管没有提供fb:app_id元标记,但我得到了以下错误指定的app id太多 我的问题很简单,如何确定提供的ID是用户ID还是应用ID?尝试将它们添加到Facebook图形URL并检查结果:https://graph.facebook.com/?ids=XXXXXXX,yyyyyyy

我有一个页面,它使用OpenGraph和FBML在我的页面上放置一个“喜欢”和“发送”按钮。客户为我的每个请求提供了两个“用户ID”;然而,当我在fb:admins元标记中提交它们并对Facebook调试使用它时,尽管没有提供fb:app_id元标记,但我得到了以下错误
指定的app id太多


我的问题很简单,如何确定提供的ID是用户ID还是应用ID?

尝试将它们添加到Facebook图形URL并检查结果:
https://graph.facebook.com/?ids=XXXXXXX,yyyyyyy
其中
XXXXXXX
YYYYYYYY
是ID,例如:

https://graph.facebook.com/?ids=579187142,40796308305
查询我的ID和可口可乐的页面ID将返回:

{
   "579187142": {
      "id": "579187142",
      "name": "Ibrahim Faour",
      "first_name": "Ibrahim",
      "last_name": "Faour",
      "username": "ifaour",
      "gender": "male",
      "locale": "en_US"
   },
   "40796308305": {
      "id": "40796308305",
      "name": "Coca-Cola",
      "picture": "http://profile.ak.fbcdn.net/hprofile-ak-snc4/203509_40796308305_256509_s.jpg",
      "link": "http://www.facebook.com/coca-cola",
      "likes": 33623022,
      "category": "Food/beverages",
      "website": "http://www.coca-cola.com",
      "username": "coca-cola",
      "founded": "1886",
      "products": "Coca-Cola is the most popular and biggest-selling soft drink in history, as well as the best-known product in the world.\n\nCreated in Atlanta, Georgia, by Dr. John S. Pemberton, Coca-Cola was first offered as a fountain beverage by mixing Coca-Cola syrup with carbonated water. Coca-Cola was introduced in 1886, patented in 1887, registered as a trademark in 1893 and by 1895 it was being sold in every state and territory in the United States. In 1899, The Coca-Cola Company began franchised bottling operations in the United States.\n\nCoca-Cola might owe its origins to the United States, but its popularity has made it truly universal. Today, you can find Coca-Cola in virtually every part of the world.",
      "parking": {
         "street": 0,
         "lot": 0,
         "valet": 0
      },
      "hours": {
         "mon_1_open": 0,
         "mon_1_close": 0,
         "tue_1_open": 0,
         "tue_1_close": 0,
         "wed_1_open": 0,
         "wed_1_close": 0,
         "thu_1_open": 0,
         "thu_1_close": 0,
         "fri_1_open": 0,
         "fri_1_close": 0,
         "sat_1_open": 0,
         "sat_1_close": 0,
         "sun_1_open": 0,
         "sun_1_close": 0,
         "mon_2_open": 0,
         "mon_2_close": 0,
         "tue_2_open": 0,
         "tue_2_close": 0,
         "wed_2_open": 0,
         "wed_2_close": 0,
         "thu_2_open": 0,
         "thu_2_close": 0,
         "fri_2_open": 0,
         "fri_2_close": 0,
         "sat_2_open": 0,
         "sat_2_close": 0,
         "sun_2_open": 0,
         "sun_2_close": 0
      },
      "payment_options": {
         "cash_only": 0,
         "visa": 0,
         "amex": 0,
         "mastercard": 0,
         "discover": 0
      },
      "restaurant_services": {
         "reserve": 0,
         "walkins": 0,
         "groups": 0,
         "kids": 0,
         "takeout": 0,
         "delivery": 0,
         "catering": 0,
         "waiter": 0,
         "outdoor": 0
      },
      "restaurant_specialties": {
         "breakfast": 0,
         "lunch": 0,
         "dinner": 0,
         "coffee": 0,
         "drinks": 0
      }
   }
}
并查询单个id:

https://graph.facebook.com/?id=291549705119
哪个是CityVille应用程序:

{
   "id": "291549705119",
   "name": "CityVille",
   "description": "Grab your hard hats and work boots, 'cause it's time to get building! Welcome to CityVille, where you and your friends can build the city of your dreams!  Play now at: http://zyn.ga/1qJ",
   "category": "Games",
   "subcategory": "Other",
   "link": "http://www.facebook.com/apps/application.php?id=291549705119"
}

尝试将它们添加到Facebook图形URL并检查结果:
https://graph.facebook.com/?ids=XXXXXXX,yyyyyyy
其中
XXXXXXX
YYYYYYYY
是ID,例如:

https://graph.facebook.com/?ids=579187142,40796308305
查询我的ID和可口可乐的页面ID将返回:

{
   "579187142": {
      "id": "579187142",
      "name": "Ibrahim Faour",
      "first_name": "Ibrahim",
      "last_name": "Faour",
      "username": "ifaour",
      "gender": "male",
      "locale": "en_US"
   },
   "40796308305": {
      "id": "40796308305",
      "name": "Coca-Cola",
      "picture": "http://profile.ak.fbcdn.net/hprofile-ak-snc4/203509_40796308305_256509_s.jpg",
      "link": "http://www.facebook.com/coca-cola",
      "likes": 33623022,
      "category": "Food/beverages",
      "website": "http://www.coca-cola.com",
      "username": "coca-cola",
      "founded": "1886",
      "products": "Coca-Cola is the most popular and biggest-selling soft drink in history, as well as the best-known product in the world.\n\nCreated in Atlanta, Georgia, by Dr. John S. Pemberton, Coca-Cola was first offered as a fountain beverage by mixing Coca-Cola syrup with carbonated water. Coca-Cola was introduced in 1886, patented in 1887, registered as a trademark in 1893 and by 1895 it was being sold in every state and territory in the United States. In 1899, The Coca-Cola Company began franchised bottling operations in the United States.\n\nCoca-Cola might owe its origins to the United States, but its popularity has made it truly universal. Today, you can find Coca-Cola in virtually every part of the world.",
      "parking": {
         "street": 0,
         "lot": 0,
         "valet": 0
      },
      "hours": {
         "mon_1_open": 0,
         "mon_1_close": 0,
         "tue_1_open": 0,
         "tue_1_close": 0,
         "wed_1_open": 0,
         "wed_1_close": 0,
         "thu_1_open": 0,
         "thu_1_close": 0,
         "fri_1_open": 0,
         "fri_1_close": 0,
         "sat_1_open": 0,
         "sat_1_close": 0,
         "sun_1_open": 0,
         "sun_1_close": 0,
         "mon_2_open": 0,
         "mon_2_close": 0,
         "tue_2_open": 0,
         "tue_2_close": 0,
         "wed_2_open": 0,
         "wed_2_close": 0,
         "thu_2_open": 0,
         "thu_2_close": 0,
         "fri_2_open": 0,
         "fri_2_close": 0,
         "sat_2_open": 0,
         "sat_2_close": 0,
         "sun_2_open": 0,
         "sun_2_close": 0
      },
      "payment_options": {
         "cash_only": 0,
         "visa": 0,
         "amex": 0,
         "mastercard": 0,
         "discover": 0
      },
      "restaurant_services": {
         "reserve": 0,
         "walkins": 0,
         "groups": 0,
         "kids": 0,
         "takeout": 0,
         "delivery": 0,
         "catering": 0,
         "waiter": 0,
         "outdoor": 0
      },
      "restaurant_specialties": {
         "breakfast": 0,
         "lunch": 0,
         "dinner": 0,
         "coffee": 0,
         "drinks": 0
      }
   }
}
并查询单个id:

https://graph.facebook.com/?id=291549705119
哪个是CityVille应用程序:

{
   "id": "291549705119",
   "name": "CityVille",
   "description": "Grab your hard hats and work boots, 'cause it's time to get building! Welcome to CityVille, where you and your friends can build the city of your dreams!  Play now at: http://zyn.ga/1qJ",
   "category": "Games",
   "subcategory": "Other",
   "link": "http://www.facebook.com/apps/application.php?id=291549705119"
}

另一种方法是使用param metadata=1查询obj ID

e、 g.查询12321312232131229?元数据=1&字段=id


在返回的元数据中,检查“type”字段中的值

另一种方法是使用param metadata=1查询obj ID

e、 g.查询12321312232131229?元数据=1&字段=id


在返回的元数据中,检查“type”字段中的值

尝试将它们添加到Facebook图形URL并检查结果:
https://graph.facebook.com/?ids=XXXXXXX,YYYYYYYY
其中,
XXXXXXX
yyyyyyyyyy
是ID。考虑到看起来像是应用程序的东西不会带任何东西回来,似乎就是这样。发布一个答案,我会给它应得的荣誉。尝试将它们添加到Facebook图形URL并检查结果:
https://graph.facebook.com/?ids=XXXXXXX,YYYYYYYY
其中,
XXXXXXX
yyyyyyyyyy
是ID。考虑到看起来像是应用程序的东西不会带任何东西回来,似乎就是这样。发布一个答案,我会给它应得的荣誉。