I need to generate a json array from the graph api that is formatted like this ->
[
{"id": "12345678", "name": "Person 1"},
{"id": "12345678", "name": "Person 2"},
{"id": "12345678", "name": "Person 3"}
]
I can generate a list like this with php, but it is very slow.
Is there a quicker way to do this using the js sdk?
Cheers
When you query the graph you can specify which fields you want to be returned using a GET parameter, like this (obviously add a valid access token):
which returns
You can use that query however you like, in JS you would use
FB.api().You can play around with adding various filters to the test URLs here: https://developers.facebook.com/docs/reference/api/