title: Facebook API Error: Pages Don't Match (Error Subcode: #1885029)
body: <p>I'm using the facebook sdk for PHP (v2.10) at the moment. And this is my code to create an AdSet (I created campaign already)</p>
  
  <pre><code>//create new AdSet      
  $adset = new AdSet(null, $_SESSION["facebook_account_id"]);
  
  $adset-&gt;setData(array(
      AdSetFields::NAME =&gt; 'Peter//MyAdSet//PromotedObject//13112017-2',
      AdSetFields::PROMOTED_OBJECT =&gt; array(
          'page_id' =&gt; 126120924732396
      ),
      AdSetFields::OPTIMIZATION_GOAL =&gt; AdSetOptimizationGoalValues::REACH,
      AdSetFields::BILLING_EVENT =&gt; AdSetBillingEventValues::IMPRESSIONS,
      AdSetFields::BID_AMOUNT =&gt; 2,
      AdSetFields::DAILY_BUDGET =&gt; 1000,
      AdSetFields::CAMPAIGN_ID =&gt; $campaign_id,
      AdSetFields::TARGETING =&gt; (new Targeting())-&gt;setData(array(
          TargetingFields::GEO_LOCATIONS =&gt; array(
              'countries' =&gt; array(
                  'VN',
              ),
          )
      )),
      AdSetFields::START_TIME =&gt;
          (new \DateTime("+1 week"))-&gt;format(\DateTime::ISO8601),
            AdSetFields::END_TIME =&gt;
          (new \DateTime("+2 week"))-&gt;format(\DateTime::ISO8601),
      ));
  
      $adset-&gt;validate()-&gt;create(array(
          AdSet::STATUS_PARAM_NAME =&gt; AdSet::STATUS_ACTIVE,
      ));
  </code></pre>
  
  <p>And then i create an Ad</p>
  
  <pre><code>$creative = new AdCreative(null, $_SESSION["facebook_account_id"]);
          $creative-&gt;setData(array(
              AdCreativeFields::NAME =&gt; 'Peter//AdCreative//Sample//1',
              AdCreativeFields::TITLE =&gt; 'Welcome to our app',
              AdCreativeFields::BODY =&gt; "We've got fun 'n' games",
              AdCreativeFields::IMAGE_HASH =&gt; $image-&gt;hash,
              AdCreativeFields::OBJECT_URL =&gt; 'https://www.facebook.com/Test-Page-126120924732396',           
          ));
  
          $ad = new Ad(null, $_SESSION["facebook_account_id"]);
          $ad-&gt;setData(array(         
              AdFields::CREATIVE =&gt; $creative,
              AdFields::NAME =&gt; 'Peter//My First Ad//1',
              AdFields::ADSET_ID =&gt; $adset-&gt;id,
          ));
  
          $ad-&gt;create(array(
              Ad::STATUS_PARAM_NAME =&gt; Ad::STATUS_PAUSED,
          ));
  </code></pre>
  
  <p>After that i got an error below</p>
  
  <pre><code>[error] =&gt; Array
       (
          [message] =&gt; Invalid parameter
          [type] =&gt; OAuthException
          [code] =&gt; 100
          [error_subcode] =&gt; 1885029
          [is_transient] =&gt; 
          [error_user_title] =&gt; Pages Don't Match
          [error_user_msg] =&gt; The Page selected for your ad doesn't match the Page associated with the object you're promoting, like a Page post or app.  Please make sure the Pages are the same.
          [fbtrace_id] =&gt; F0UwFAXCLQ2
        )
  </code></pre>
  
  <p>i use sandbox account to test facebook api, i connect my test page to sandbox account already. what's missing in my code?</p>