title: Facebook API - Unsupported get request for page/post insights
body: <p>I know there's a multitude of questions regarding Facebook's SDK and API and this specific error response, however none of them seem to answer my question.</p>
  
  <p>I run a Facebook page and until a couple of days ago I had some code running that would collect the <code>insights</code> data for each post on my Facebook page.</p>
  
  <p>This is what I was doing:</p>
  
  <pre><code>define('FB_APP_ACCESS_TOKEN', 'omitted'); // Never expires, has permission to read insight data (and more)
  define('FB_APP_ID', 'omitted'); // ID of my Facebook App
  define('FB_APP_SECRET', 'omitted'); // Secret for App
  define('FB_ACCOUNT_ID', 'omitted'); // Facebook ID of my page
  define('FB_REQUEST', 'insights/post_impressions_unique,post_consumptions_by_type,post_negative_feedback_by_type,post_consumptions,post_story_adds_by_action_type');
  
  // .. Require Facebook SDK (Using composer)
  // .. Other processing
  
  
  // Initialise the Facebook SDK with our credentials and permanent access token.
  $fb = new Facebook\Facebook([
      'app_id' =&gt; FB_APP_ID,
      'app_secret' =&gt; FB_APP_SECRET,
      'default_graph_version' =&gt; 'v2.2'
  ]);
  $fb-&gt;setDefaultAccessToken(FB_APP_ACCESS_TOKEN);
  
  
  // .. Grab some posts from my database
  foreach ($posts as $post) {
      $postId = $post['id'];
      $request = FB_ACCOUNT_ID . '_' . $postId . '/' . FB_REQUEST;
      // Request will now contain something like...
      // &lt;PAGE_ID&gt;_&lt;POST_ID&gt;/insights/post_impressions_unique,post_consumptions_by_type,post_negative_feedback_by_type,post_consumptions,post_story_adds_by_action_type
  
      try {
          $fb-&gt;get($response); // This line fails and throw exception
  
          // .. Rest of my processing
      } catch (Facebook\Exceptions\FacebookSDKException $e) {
          die("\nEXCEPTION: {$e-&gt;getMessage()}\n{$e-&gt;getTraceAsString()}");
      }
  }
  </code></pre>
  
  <p>The above code was working great until a couple of days ago when I noticed my stats weren't pulling in. After some investigation and playing around using the Graph API Explorer I have found that I get the following output:</p>
  
  <blockquote>
    <p>EXCEPTION: Unsupported get request. Please read the Graph API documentation at <a href="https://developers.facebook.com/docs/graph-api" rel="nofollow">https://developers.facebook.com/docs/graph-api</a></p>
  </blockquote>
  
  <p>And using the Graph API Explorer:</p>
  
  <pre><code>{
    "error": {
      "message": "Unsupported get request. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api",
      "type": "GraphMethodException",
      "code": 100,
      "fbtrace_id": "XXXXXXX"
    }
  }
  </code></pre>
  
  <p>No matter what I have tried I don't seem to be able to get the insights for a single post on a page again. I've tried playing with the Graph API Explorer, trying a number of combinations but don't seem to be able to get anything back. I've even tried generating new tokens with the correct permissions to no avail. Some of the combinations I've tried:</p>
  
  <ul>
  <li><code>&lt;POST_ID&gt;/insights</code> - <code>(#12) singular statuses API is deprecated for versions v2.4 and higher</code></li>
  <li><code>&lt;PAGE_ID&gt;/insights</code> - Shows all insights for page, nothing about each specific post</li>
  </ul>
  
  <p>Does anyone know where I'm going wrong?</p>
  
  <p>Cheers</p>