How to obtain username/name for a company facebook account?

你说的曾经没有我的故事 提交于 2019-12-11 10:31:40

问题


Right now I am using the graph API explorer and I have a company type Facebook account. However, the following command do not return "username"/"name" field. I did set a proper username in the Profile page -> Basic Information -> Name/Username (both)

http://graph.facebook.com/11234545656556 (the number is fake for now)

This is the response that I received:

{"id": "11234545656556",   
 "link": "http://www.facebook.com/profile.php?id=11234545656556",   
 "timezone": 0,   
 "locale": "en_US",   
 "verified": true,   
 "updated_time": "2012-05-31T22:32:52+0000",   
 "type": "user"}

However if I query my own individual account, I received the expected response:

{"id": "11234512345",
 "name": "John Doe",
 "first_name": "John",
 "last_name": "Doe",
 "link": "http://www.facebook.com/people/John-Doe/11234512345",
 "gender": "male",
 "locale": "en_US"}

So what can I do to obtain the username/name for the company accounts?


回答1:


Business accounts don't work properly with the API and they don't have names or usernames. They exist on Facebook specifically for managing pages and apps - they should work with the Pages and Ads APIs just fine, but most other calls in the API will not work (for example, they also don't have gender, friends, posts, etc)

If you're talking about a Page, those are accessed differently - see the Page login documentation for details - https://developers.facebook.com/docs/howtos/login/login-as-page/

Specifically, you authorise an app with the manage_pages permission and you can make an API call to /me/accounts to get an access token which you can then use to act on behalf of the page



来源:https://stackoverflow.com/questions/10857138/how-to-obtain-username-name-for-a-company-facebook-account

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!