Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AdVideo fields are incorrect #272

Open
mrowles opened this issue Jan 30, 2024 · 0 comments
Open

AdVideo fields are incorrect #272

mrowles opened this issue Jan 30, 2024 · 0 comments

Comments

@mrowles
Copy link

mrowles commented Jan 30, 2024

Which SDK version are you using?

18.0.4

What's the issue?

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/

Steps/Sample code to reproduce the issue

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,
]);

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:

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'
]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant