0

To avoid overloading the API requests I am using Facebook Batch API to send app-to-user requests:

$access_token = MYAPPSACCESSTOKEN;

foreach($myusers as $user) {
    $body = array(
        'access_token' => $access_token,
        'template' => 'THIS IS MY TEMPLATE',
        'href' => '?time=' . date('d-m-Y'),
        'ref' => 'MY_REF'
    );
}

$results = $facebook->api('/?batch=' . \urlencode(\json_encode($fBqueries)), 'POST', array(
    'access_token' => $facebook->getAccessToken()
));

So this is working as expected, but I also need to record the RequestID for each app-to-user request. $results is returning header data for each request, but is there any way that I can get the Facebook Request ID as well?

wiseguydigital
  • 315
  • 2
  • 6
  • 15

1 Answers1

0

Just realised that I have been using the new notifications API and not the apprequests endpoint which indeed does return a request ID (as it is a request object).

I guess that at the moment the notifications API doesn't return any notification / request IDs which would have been very helpful for our app but never mind.

wiseguydigital
  • 315
  • 2
  • 6
  • 15
  • If you need some kind of unique ID for tracking, you can just put it into the `href` argument of the notification, so that you can read it as a GET parameter when the user clicks on the notification. – CBroe Jan 24 '13 at 08:52
  • Thanks CBroe, that's what we were doing for a bit but for such a small requirement for us, it meant rewriting too much code, so for now we have reverted to the apprequests. We will likely come back to this later though and reimplement. – wiseguydigital Jan 25 '13 at 09:16