title: Invalid parameter Facebook video ad creative in Facebook Marketing API
body: <p>I am getting the same error while creating Ad Creative via Facebook Marketing API. I followed their guide but doesn't work. <a href="https://developers.facebook.com/docs/marketing-api/guides/videoads" rel="nofollow noreferrer">Facebook video ad creative reference </a>  </p>
  
  <pre><code>    $config = Config::get('facebook');
      $data['account_id'] = 'act_'.$config['ad_account_id'];
      $data['page_id'] = $config['page_id'];
  
      // Init facebook
      $api = Api::init($config['app_id'], $config['app_secret'], $config['access_token']);
  
      // Create product catalog
      $product_catalog = new ProductCatalog(null,  $config['business_id']);
      $product_catalog-&gt;setData(array(
          ProductCatalogFields::NAME =&gt; "Catalog",
      ));
      $product_catalog-&gt;create();
  
      $product_catalog_id = $product_catalog-&gt;id;
  
      // Setup Feed
      $product_feed = new ProductFeed(null, $product_catalog_id);
      $product_feed-&gt;setData(array(
          ProductFeedFields::NAME =&gt; 'Campaign Feed',
          ProductFeedFields::SCHEDULE =&gt; array(
              ProductFeedScheduleFields::INTERVAL =&gt; 'DAILY',
              ProductFeedScheduleFields::URL =&gt; 'http://example.com/facebook/dpa_product_catalog_sample_feed.csv',
              ProductFeedScheduleFields::HOUR =&gt; 22,
          ),
      ));
      $product_feed = $product_feed-&gt;create();
  
      // Create  Product Set
      $product_set = new ProductSet(null,  $product_catalog_id);
      $product_set-&gt;setData(array(
          ProductFeedFields::NAME =&gt; 'All Product',
      ));
      $product_set-&gt;create();
  
      $data['product_set_id'] = $product_set-&gt;id;
  
      $video = new Advideo(null, $data['account_id']);
      $video-&gt;{AdVideoFields::SOURCE} = public_path().'/facebook/video-demo.mp4';
      $video-&gt;create();
  
      $video_data = new AdCreativeVideoData();
      $video_data-&gt;setData(array(
        AdCreativeVideoDataFields::IMAGE_URL =&gt; 'http://example.com/facebook/resize-image.jpg',
        AdCreativeVideoDataFields::VIDEO_ID =&gt; $video-&gt;id,
        AdCreativeVideoDataFields::CALL_TO_ACTION =&gt; array(
          'type' =&gt; AdCreativeCallToActionTypeValues::LIKE_PAGE,
          'value' =&gt; array(
            'page' =&gt; $data['page_id'],
          ),
        ),
      ));
  
      $object_story_spec = new AdCreativeObjectStorySpec();
      $object_story_spec-&gt;setData(array(
        AdCreativeObjectStorySpecFields::PAGE_ID =&gt; $data['page_id'],
        AdCreativeObjectStorySpecFields::VIDEO_DATA =&gt; $video_data,
      ));
  </code></pre>
  
  <p>Above these code working and return response but when I call ad creative, the API return "Invalid parameter"</p>
  
  <pre><code>    $creative = new AdCreative(null, $data['account_id']);
      $creative-&gt;setData(array(
        AdCreativeFields::NAME =&gt; 'Video Ad Template Creative Sample',
        AdCreativeFields::OBJECT_STORY_SPEC =&gt; $object_story_spec,
        AdCreativeFields::PRODUCT_SET_ID =&gt; $data['product_set_id'],
      ));
  
      $creative-&gt;create();
  </code></pre>