how to find a facebook url is community url or profile url using facebook API
For example
http://www.facebook.com/adelphi.panthers
http://www.facebook.com/BryantAthletics
Which is profile url and which is community url, how to find?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Well as @Lix has suggested you could do something like this:
Request: https://graph.facebook.com/BryantAthletics?fields=gender
HTTP Response: 400 Bad Request
JSON Response:
This tells us its NOT a User object. But then it could be a group or a page.. So you need to make another request using an attribute that is unique either to a group or page. Depending on how you make the request, you could decide to handle the result accordingly.
Consider,
Request: https://graph.facebook.com/adelphi.panthers?fields=gender
HTTP Response: 200 OK
JSON Response:
Now this tells us that the gender attribute exist within this Facebook object and so it is definitely a user.
I’m assuming you are using JQuery to capture and parse the response. Then you would check for the error attribute in the JSON variable to determine the object type.