facebookfacebook-graph-apifacebook-fqlfacebook-graph-api-v2.2

Facebook Graph API apprequests node doesn't return "from"


Moving from FQL to Graph API, I found that the V2.2 Graph API apprequests node returns inconsistent responses.

https://graph.facebook.com/v2.2/<id>/apprequests

sometimes returns JSON with the "from" field and sometimes not. The correct JSON is:

 "application": {
        "name": "Myapp", 
        "namespace": "My NS", 
        "id": "123456"
      }, 
      "created_time": "2015-03-16T19:34:00+0000", 
      "data": "invite", 
      "from": {
        "id": "111111", 
        "name": "Sender name"
      }, 
      "message": "Come and play!", 
      "to": {
        "id": "99999", 
        "name": "Recipient"
      }, 
      "id": "123_456"
    }

However, the "from" field in the JSON is sometimes missing (even when requesting it specifically in the "fields" parameter).

When using FQL, I always get the sender_uid field (with the same app token and same user):

SELECT request_id, app_id, recipient_uid, sender_uid FROM apprequest   
      WHERE app_id = <appID> and recipient_uid=<FBID>

Can anybody explain the mystery?


Solution

  • Facebook's response after investigating this bug: This is by design. There are certain privacy restrictions on Graph API which didn't apply to the deprecated FQL.

    We investigated this on our end and found that this happens when the user blocked the application or completely removed Facebook's third party integration.