Marketing API Version

Ad Account Advideos

Reading

The videos associated with this account

Graph API Explorer
GET /v2.10/{ad-account-id}/advideos HTTP/1.1
Host: graph.facebook.com
/* PHP SDK v5.0.0 */
/* make the API call */
$request = new FacebookRequest(
  $session,
  'GET',
  '/{ad-account-id}/advideos'
);
$response = $request->execute();
$graphObject = $response->getGraphObject();
/* handle the result */
/* make the API call */
FB.api(
    "/{ad-account-id}/advideos",
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{ad-account-id}/advideos",
    null,
    HttpMethod.GET,
    new GraphRequest.Callback() {
        public void onCompleted(GraphResponse response) {
            /* handle the result */
        }
    }
).executeAsync();
// For more complex open graph stories, use `FBSDKShareAPI`
// with `FBSDKShareOpenGraphContent`
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
                               initWithGraphPath:@"/{ad-account-id}/advideos"
                                      parameters:params
                                      HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];

Permissions

Developers usually request these permissions for this endpoint:

Marketing Apps
  • ads_management
Page management Apps
No data
Other Apps
No data

Parameters

This endpoint doesn't have any parameters.

Fields

Reading from this edge will return a JSON formatted result:

{ "data": [], "paging": {}, "summary": {} }

data

A list of Video nodes.

paging

For more details about pagination, see the Graph API guide.

summary

Aggregated information about the edge, such as counts. Specify the fields to fetch in the summary param (like summary=total_count).

FieldDescription

total_count

unsigned int32

Total number of videos returned by the query

Validation Rules

ErrorDescription
100Invalid parameter
200Permissions error
274The ad account is not enabled for usage in Ads API. Please add it in developers.facebook.com/apps -> select your app -> settings -> advanced -> advertising accounts -> Ads API
273This Ads API call requires the user to be admin of the ad account

Creating

You can make a POST request to advideos edge from the following paths:
When posting to this edge, a Video will be created.

Parameters

NameDescription
composer_session_id
string

composer session id

description
UTF-8 string

description

Supports Emoji
file_size
int64

The size of the video file in bytes. Using during chunked upload.

file_url
string

file url

fisheye_video_cropped
boolean

Whether the single fisheye video is cropped or not

front_z_rotation
float

The front z rotation in degrees on the single fisheye video

is_explicit_share
boolean

is explicit share

manual_privacy
boolean
Default value: false

manual privacy

name
string

The name of the video in the library.

og_action_type_id
numeric string or integer

og action type id

og_icon_id
numeric string or integer

og icon id

og_object_id
OG object ID or URL string

og object id

og_phrase
string

og phrase

og_suggestion_mechanism
string

og suggestion mechanism

original_fov
int64

Original field of view of the source camera

original_projection_type
enum {equirectangular, cubemap, equiangular_cubemap}

Original Projection type of the video being uploaded

referenced_sticker_id
numeric string or integer

referenced sticker id

slideshow_spec
JSON object

An object required for slideshow video.

images_urls
list<URL>

A 3-7 element array of the URLs of the images. Required.

Required
duration_ms
integer

The duration in milliseconds of each image. Default value is 1000.

transition_ms
integer

The duration in milliseconds of the crossfade transition between images. Default value is 1000.

source
string

The video, encoded as form data. See the Video Format doc for more details on video formats.

start_offset
int64

The start position in byte of the chunk that is being sent, inclusive. Used during chunked upload.

time_since_original_post
int64

time since original post

title
UTF-8 string

The name of the video being uploaded.

Supports Emoji
unpublished_content_type
enum {SCHEDULED, DRAFT, ADS_POST}

unpublished content type

upload_phase
enum {start, transfer, finish, cancel}

The phase during chunked upload. Using during chunked upload.

upload_session_id
numeric string or integer

The session ID of this chunked upload. Using during chunked upload.

video_file_chunk
string

The chunk of the video, between start_offset and end_offset. Using during chunked upload.

Return Type

Struct {
id: numeric string,
upload_session_id: numeric string,
video_id: numeric string,
start_offset: numeric string,
end_offset: numeric string,
success: bool,
skip_upload: bool,
transcode_bit_rate_bps: numeric string,
transcode_dimension: numeric string,
}

Validation Rules

ErrorDescription
100Invalid parameter
356There was a problem uploading your video file. Please try again.
6000There was a problem uploading your video file. Please try again with another file.
389Unable to fetch video file from URL.
390There was a problem uploading your video file. Please try again.
6001There was a problem uploading your video. Please try again.
352Sorry, the video file you selected is in a format that we don't support.
2633This shared login is disabled. Go to Ads Manager for more information.
200Permissions error

Updating

You can't perform this operation on this endpoint.

Deleting

You can't perform this operation on this endpoint.