Graph API Version

Ad Account Advideos

Reading

GET GraphAdAccountAdVideosEdge

Example

Graph API Explorer
GET /v4.0/{ad-account-id}/advideos HTTP/1.1
Host: graph.facebook.com
/* PHP SDK v5.0.0 */
/* make the API call */
try {
  // Returns a `Facebook\FacebookResponse` object
  $response = $fb->get(
    '/{ad-account-id}/advideos',
    '{access-token}'
  );
} catch(Facebook\Exceptions\FacebookResponseException $e) {
  echo 'Graph returned an error: ' . $e->getMessage();
  exit;
} catch(Facebook\Exceptions\FacebookSDKException $e) {
  echo 'Facebook SDK returned an error: ' . $e->getMessage();
  exit;
}
$graphNode = $response->getGraphNode();
/* 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
}];
If you want to learn how to use the Graph API, read our Using Graph API guide.

Parameters

ParameterDescription
max_aspect_ratio
float

Maximum video aspect ratio to be used in the video aspect ratio filter.

maxheight
int64

Maximum video height to be used in the video height filter.

maxlength
int64

Maximum video duration to be used in the video duration filter.

maxwidth
int64

Maximum video width to be used in the video width filter.

min_aspect_ratio
float

Minimum video aspect ratio to be used in the video aspect ratio filter.

minheight
int64

Minimum video height to be used in the video height filter.

minlength
int64

Minimum video duration to be used in the video duration filter.

minwidth
int64

Minimum video width to be used in the video width filter.

title
string

Video name used in the video names filter.

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
80004There have been too many calls to this ad-account. Wait a bit and try again. For more info, please refer to https://developers.facebook.com/docs/graph-api/overview/rate-limiting.
200Permissions error

Creating

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

Example

Graph API Explorer
POST /v4.0/act_<AD_ACCOUNT_ID>/advideos HTTP/1.1
Host: graph.facebook.com

source=%40%3CVIDEO_PATH%3E
/* PHP SDK v5.0.0 */
/* make the API call */
try {
  // Returns a `Facebook\FacebookResponse` object
  $response = $fb->post(
    '/act_<AD_ACCOUNT_ID>/advideos',
    array (
      'source' => '@<VIDEO_PATH>',
    ),
    '{access-token}'
  );
} catch(Facebook\Exceptions\FacebookResponseException $e) {
  echo 'Graph returned an error: ' . $e->getMessage();
  exit;
} catch(Facebook\Exceptions\FacebookSDKException $e) {
  echo 'Facebook SDK returned an error: ' . $e->getMessage();
  exit;
}
$graphNode = $response->getGraphNode();
/* handle the result */
/* make the API call */
FB.api(
    "/act_<AD_ACCOUNT_ID>/advideos",
    "POST",
    {
        "source": "@<VIDEO_PATH>"
    },
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
Bundle params = new Bundle();
params.putString("source", "@<VIDEO_PATH>");
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/act_<AD_ACCOUNT_ID>/advideos",
    params,
    HttpMethod.POST,
    new GraphRequest.Callback() {
        public void onCompleted(GraphResponse response) {
            /* handle the result */
        }
    }
).executeAsync();
// For more complex open graph stories, use `FBSDKShareAPI`
// with `FBSDKShareOpenGraphContent`
NSDictionary *params = @{
  @"source": @"@<VIDEO_PATH>",
};
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
                               initWithGraphPath:@"/act_<AD_ACCOUNT_ID>/advideos"
                                      parameters:params
                                      HTTPMethod:@"POST"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];
curl -X POST \
     -d "source=%40%3CVIDEO_PATH%3E" \
        https://graph.facebook.com/v4.0/act_<AD_ACCOUNT_ID>/advideos
If you want to learn how to use the Graph API, read our Using Graph API guide.

Parameters

ParameterDescription
audio_story_wave_animation_handle
string

Everstore handle of wave animation used to burn audio story video

composer_session_id
string

SELF_EXPLANATORY

description
UTF-8 string

SELF_EXPLANATORY

Supports Emoji
end_offset
int64

end_offset

file_size
int64

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

file_url
string

SELF_EXPLANATORY

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

name
string

The name of the video in the library.

og_action_type_id
numeric string or integer

SELF_EXPLANATORY

og_icon_id
numeric string or integer

SELF_EXPLANATORY

og_object_id
OG object ID or URL string

SELF_EXPLANATORY

og_phrase
string

SELF_EXPLANATORY

og_suggestion_mechanism
string

SELF_EXPLANATORY

original_fov
int64

Original field of view of the source camera

original_projection_type
enum {equirectangular, cubemap, equiangular_cubemap, half_equirectangular}

Original Projection type of the video being uploaded

react_mode_metadata
JSON-encoded string

This metadata is used in clip reaction feature

referenced_sticker_id
numeric string or integer

SELF_EXPLANATORY

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

SELF_EXPLANATORY

title
UTF-8 string

The name of the video being uploaded. Must be less than 255 characters. Special characters may count as more than 1 character.

Supports Emoji
transcode_setting_properties
string

Properties used in computing transcode settings for the video

unpublished_content_type
enum {SCHEDULED, SCHEDULED_RECURRING, DRAFT, ADS_POST, INLINE_CREATED, PUBLISHED}

SELF_EXPLANATORY

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,
upload_domain: string,
region_hint: string,
transcode_bit_rate_bps: numeric string,
transcode_dimension: numeric string,
action_id: string,
}

Validation Rules

ErrorDescription
100Invalid parameter
6000There was a problem uploading your video file. Please try again with another file.
200Permissions error
356There was a problem uploading your video file. Please try again.
294Managing advertisements requires an access token with the extended permission for ads_management
389Unable to fetch video file from URL.
352The video file you selected is in a format that we don't support.
6001There was a problem uploading your video. Please try again.
390There was a problem uploading your video file. Please try again.
351There was a problem with your video file. Please try again with another file,

Updating

You can't perform this operation on this endpoint.

Deleting

You can dissociate a Video from an AdAccount by making a DELETE request to /act_{ad_account_id}/advideos.

Parameters

ParameterDescription
video_id
video ID

Ad account library video ID

Required

Return Type

Struct {
success: bool,
}

Validation Rules

ErrorDescription
100Invalid parameter