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
Copy file name to clipboardExpand all lines: docs/examples/batch_request.md
+64-1Lines changed: 64 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -96,7 +96,70 @@ My next 2 events are House Warming Party,Some Foo Event.
96
96
97
97
It should also contain a response containing two photos from the user.
98
98
99
-
> **Warning:** The response object should return a `null` response for any request that was pointed to with JSONPath as is [the behaviour of the batch functionality of the Graph API](https://developers.facebook.com/docs/graph-api/making-multiple-requests/#operations).
99
+
> **Warning:** The response object should return a `null` response for any request that was pointed to with JSONPath 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 the example below](#force-response-example).
100
+
101
+
## Force Response Example
102
+
103
+
The following example is a subset of the [first example](#example). We will only use the `user-events` and `post-to-feed` requests of the [first example](#example), but in this case we will force the server to return the response of the `user-events` request.
104
+
105
+
```php
106
+
<?php
107
+
$fb = new Facebook\Facebook([
108
+
'app_id' => '{app-id}',
109
+
'app_secret' => '{app-secret}',
110
+
'default_graph_version' => 'v2.8',
111
+
]);
112
+
113
+
// Since all the requests will be sent on behalf of the same user,
114
+
// we'll set the default fallback access token here.
0 commit comments