Open mrowles opened 7 months ago
18.0.4
The AdVideo class suggests only 3 fields are available:
export default class AdVideo extends AbstractCrudObject { static get Fields(): Readonly<{ filepath: "filepath"; // <-- undefined id: "id"; slideshow_spec: "slideshow_spec"; // <-- undefined }>; ...
The FB API documentation is all over the shop, but this API in particular is rife with mistakes.
❌ The documentation for Ads Api -> Get Ad Videos: https://developers.facebook.com/docs/marketing-api/reference/ad-account/advideos/
✅ The documentation for Video: https://developers.facebook.com/docs/graph-api/reference/video/
import { AdAccount, AdVideo, FacebookAdsApi, } from 'facebook-nodejs-business-sdk'; FacebookAdsApi.init(...) const account = new AdAccount(...); const videos = await account.getAdVideos([ AdVideo.Field.filepath, AdVideo.Field.id, AdVideo.Field.slideshow_spec, ]);
The fields are missing a whole bunch described in the above documentation.
This is what we can actually get in terms of fields:
import { AdAccount, AdVideo, FacebookAdsApi, } from 'facebook-nodejs-business-sdk'; FacebookAdsApi.init(...) const account = new AdAccount(...); const videos = await account.getAdVideos([ AdVideo.Field.filepath, AdVideo.Field.id, AdVideo.Field.slideshow_spec, ]); const videos = await this.account.getAdVideos([ // this does not seem to exist // AdVideo.Fields.filepath, 'ad_breaks', 'backdated_time', 'backdated_time_granularity', 'content_category', 'content_tags', 'created_time', 'custom_labels', 'description', 'embed_html', 'embeddable', 'event', 'format', 'from', 'icon', AdVideo.Fields.id, 'is_crosspost_video', 'is_crossposting_eligible', 'is_episode', 'is_instagram_eligible', // copyright api only opens to page users // 'is_reference_only', 'length', 'live_status', // copyright api only opens to page users // 'music_video_copyright', 'permalink_url', 'place', 'post_id', 'post_views', 'premiere_living_room_status', 'privacy', 'published', // this does not seem to exist // AdVideo.Fields.slideshow_spec, 'scheduled_publish_time', 'source', 'status', 'title', 'universal_video_id', 'updated_time', 'views' ]);
Which SDK version are you using?
18.0.4
What's the issue?
The AdVideo class suggests only 3 fields are available:
The FB API documentation is all over the shop, but this API in particular is rife with mistakes.
❌ The documentation for Ads Api -> Get Ad Videos: https://developers.facebook.com/docs/marketing-api/reference/ad-account/advideos/
✅ The documentation for Video: https://developers.facebook.com/docs/graph-api/reference/video/
Steps/Sample code to reproduce the issue
Observed Results:
The fields are missing a whole bunch described in the above documentation.
Expected Results:
This is what we can actually get in terms of fields: