You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the following example we will make two requests.
167
+
* One to post a status update on the user's feed
168
+
* and one to receive the last post of the user (which should be the one that we posted with first request).
169
+
170
+
Since we want the second request to be executed after the first one is completed, we have to set the `depends_on` option of the second request to point to the name of the first request. We assume that we have the following options granted from the user: `user_posts`, `publish_actions`.
171
+
172
+
```php
173
+
<?php
174
+
$fb = new Facebook\Facebook([
175
+
'app_id' => '{app-id}',
176
+
'app_secret' => '{app-secret}',
177
+
'default_graph_version' => 'v2.8',
178
+
]);
179
+
180
+
// Since all the requests will be sent on behalf of the same user,
181
+
// we'll set the default fallback access token here.
> **Warning:** The response object should return a `null` response for any request that was pointed to with the `depends_on` option as is [the behaviour of the batch functionality of the Graph API](https://developers.facebook.com/docs/graph-api/making-multiple-requests/#operations). If we want to receive the response anyway we have to set the `omit_response_on_success` option to `false`. [See example](#force-response-example).
232
+
164
233
## Multiple User Example
165
234
166
235
Since the requests sent in a batch are unrelated by default, we can make requests on behalf of multiple users and pages in the same batch request.
0 commit comments