Facebook::api(...)This method can call a Facebook Graph API method or an FQL query depending on the parameters passed in.
To call a Graph API method, pass in the path as the first parameter; to run FQL queries pass in the array of parameters required for the API call, as described below.
To call a Graph API method, pass in the endpoint path you wish to retrieve as the first parameter, and other optional parameters as necessary:
$ret = $facebook->api($path, $method, $params);
| Name | Description |
|---|---|
path |
The Graph API path for the request, e.g. "/me" for the logged in user's profile. |
method |
(optional) Specify the HTTP method for this request: 'GET', 'POST', or 'DELETE'. |
params |
(optional) Parameters specific to the particular Graph API method you are calling. Passed in as an associative array of 'name' => 'value' pairs. |
To run an FQL query, pass the parameters in as an array, with the 'method' property set to 'fql.query':
$ret = $facebook->api( array(
'method' => 'fql.query',
'query' => 'SELECT . . . ',
));