{"action":"opened","issue":{"url":"https://api.github.com/repos/facebook/facebook-php-ads-sdk/issues/83","labels_url":"https://api.github.com/repos/facebook/facebook-php-ads-sdk/issues/83/labels{/name}","comments_url":"https://api.github.com/repos/facebook/facebook-php-ads-sdk/issues/83/comments","events_url":"https://api.github.com/repos/facebook/facebook-php-ads-sdk/issues/83/events","html_url":"https://github.com/facebook/facebook-php-ads-sdk/issues/83","id":67205705,"number":83,"title":"InvalidArgumentException thrown when getting an AdAccounts AdVideos from API v2.3","user":{"login":"samkeen","id":17389,"avatar_url":"https://avatars.githubusercontent.com/u/17389?v=3","gravatar_id":"","url":"https://api.github.com/users/samkeen","html_url":"https://github.com/samkeen","followers_url":"https://api.github.com/users/samkeen/followers","following_url":"https://api.github.com/users/samkeen/following{/other_user}","gists_url":"https://api.github.com/users/samkeen/gists{/gist_id}","starred_url":"https://api.github.com/users/samkeen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samkeen/subscriptions","organizations_url":"https://api.github.com/users/samkeen/orgs","repos_url":"https://api.github.com/users/samkeen/repos","events_url":"https://api.github.com/users/samkeen/events{/privacy}","received_events_url":"https://api.github.com/users/samkeen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-04-08T19:52:05Z","updated_at":"2015-04-08T19:52:05Z","closed_at":null,"body":"`/v2.2/act_<account id>/advideos` does not return a `published` field, `/v2.3/act_<account id>/advideos` does (see example payload below)\r\n\r\nWe are using facebook-php-ads-sdk v2.3.0\r\n\r\nWhen we call the `getAdVideos` method (with no fields specified) on `FacebookAdAccount` we get an `InvalidArgumentException` with message: \"published is not a field of FacebookAds\\Object\\AdVideo\"\r\n\r\nThis originates at [AbstractCrudObject::setData](https://github.com/facebook/facebook-php-ads-sdk/blob/master/src/FacebookAds/Object/AbstractCrudObject.php#L204) \r\n\r\n```php\r\npublic function setData(array $data) {\r\n    foreach ($data as $key => $value) {\r\n      $this->{$key} = $value;\r\n    }\r\n    return $this;\r\n  }\r\n```\r\n\r\nSince [AdVideo](https://github.com/facebook/facebook-php-ads-sdk/blob/master/src/FacebookAds/Object/AdVideo.php#L41) has no `published` field, when the above loop tries to set `$this->published = true;` the exception is thrown\r\n\r\nExample (truncated) response to `https://graph.facebook.com/v2.3/act_<account id>/advideos` showing the `published field`\r\n```javascript\r\n{\r\n   \"data\":[\r\n      {\r\n         \"id\":\"10153079548779999\",\r\n         \"created_time\":\"2015-02-06T00:47:59+0000\",\r\n         \"embed_html\":\"\\u003Ciframe src=\\\"https:\\/\\/www.facebook.com\\/video\\/embed?video_id=10153079548779999\\\" width=\\\"640\\\" height=\\\"360\\\" frameborder=\\\"0\\\">\\u003C\\/iframe>\",\r\n         \"format\":[\r\n            {\r\n               \"embed_html\":\"\\u003Ciframe src=\\\"https:\\/\\/www.facebook.com\\/video\\/embed?video_id=10153079548779999\\\" width=\\\"130\\\" height=\\\"73\\\" frameborder=\\\"0\\\">\\u003C\\/iframe>\",\r\n               \"filter\":\"130x130\",\r\n               \"height\":73,\r\n               \"picture\":\"https:\\/\\/fbcdn-vthumb-a.akamaihd.net\\/hvthumb-ak-xpa1\\/v\\/t15.0-10\\/p160x160\\/10751484_10153079548948234_10153079548779999_45692_1846_b.jpg?oh=cf67559e145d3263bca51c6d65c9e368&oe=559993A4&__gda__=1436187962_3ce5195f0f021bfd58db8327fbc4e7e4\",\r\n               \"width\":130\r\n            },\r\n            {\r\n               \"embed_html\":\"\\u003Ciframe src=\\\"https:\\/\\/www.facebook.com\\/video\\/embed?video_id=10153079548779999\\\" width=\\\"480\\\" height=\\\"270\\\" frameborder=\\\"0\\\">\\u003C\\/iframe>\",\r\n               \"filter\":\"480x480\",\r\n               \"height\":270,\r\n               \"picture\":\"https:\\/\\/fbcdn-vthumb-a.akamaihd.net\\/hvthumb-ak-xpa1\\/v\\/t15.0-10\\/10751484_10153079548948234_10153079548779999_45692_1846_b.jpg?oh=c3322afcd9f3bc19c2f07d0e3dcb426b&oe=559F214F&__gda__=1437469064_d432d6764194e4ad83ffb2cb61c08318\",\r\n               \"width\":480\r\n            },\r\n            {\r\n               \"embed_html\":\"\\u003Ciframe src=\\\"https:\\/\\/www.facebook.com\\/video\\/embed?video_id=10153079548779999\\\" width=\\\"640\\\" height=\\\"360\\\" frameborder=\\\"0\\\">\\u003C\\/iframe>\",\r\n               \"filter\":\"native\",\r\n               \"height\":360,\r\n               \"picture\":\"https:\\/\\/fbcdn-vthumb-a.akamaihd.net\\/hvthumb-ak-xpa1\\/v\\/t15.0-10\\/10751484_10153079548948234_10153079548779999_45692_1846_b.jpg?oh=c3322afcd9f3bc19c2f07d0e3dcb426b&oe=559F214F&__gda__=1437469064_d432d6764194e4ad83ffb2cb61c08318\",\r\n               \"width\":640\r\n            }\r\n         ],\r\n         \"from\":{\r\n            \"id\":\"10152896328398234\",\r\n            \"name\":\"Bob Smith\"\r\n         },\r\n         \"icon\":\"https:\\/\\/fbstatic-a.akamaihd.net\\/rsrc.php\\/v2\\/yD\\/r\\/DggDhA4z4tO.gif\",\r\n         \"name\":\"foom\",\r\n         \"picture\":\"https:\\/\\/fbcdn-vthumb-a.akamaihd.net\\/hvthumb-ak-xpa1\\/v\\/t15.0-10\\/p128x128\\/10751484_10153079548948234_10153079548779999_45692_1846_b.jpg?oh=b42d46364120c5870fe441d990bad170&oe=55A7A49F&__gda__=1438055169_0bb3c601a8f7e56145e9b916a615a65a\",\r\n         \"source\":\"https:\\/\\/scontent.xx.fbcdn.net\\/hvideo-xpa1\\/v\\/t43.1792-2\\/10921600_755745654516018_992090670_n.mp4?rl=1500&vabr=352&oh=505e56d7b85b24a2854b2c6c46e8287c&oe=552737A4\",\r\n         \"updated_time\":\"2015-02-06T00:48:03+0000\",\r\n         \"published\":true\r\n      },\r\n      ...\r\n   ],\r\n   \"paging\":{\r\n      \"cursors\":{\r\n         \"before\":\"MTAxNTMwNzk1NDg3NzMyMzQ=\",\r\n         \"after\":\"MTAxNTI4OTY5MDk0ODMyMzQ=\"\r\n      }\r\n   }\r\n}\r\n```"}}