Graph API Version

Dynamic Ads, Vehicle

Enables you to create Dynamics Ads which advertise cars, trucks and other types of vehicles. This API is available on a limited basis as a alpha release.

Reading

Represents a listing for vehicle in a catalog

Example

Graph API Explorer
GET /v4.0/{vehicle-id} 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(
    '/{vehicle-id}',
    '{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(
    "/{vehicle-id}",
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{vehicle-id}",
    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:@"/{vehicle-id}"
                                      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

This endpoint doesn't have any parameters.

Fields

FieldDescription
id
numeric string

Id

address
VehicleLocationAddressData

Address

applinks

Applinks

availability
enum

Availability

body_style
enum

BodyStyle

condition
enum

Condition

currency
string

Currency

custom_label_0
string

CustomLabel0

date_first_on_lot
string

DateFirstOnLot

dealer_communication_channel
enum

DealerCommunicationChannel

dealer_email
string

DealerEmail

dealer_id
string

DealerId

dealer_name
string

DealerName

dealer_phone
string

DealerPhone

dealer_privacy_policy_url
string

DealerPrivacyPolicyUrl

description
string

Description

drivetrain
enum

Drivetrain

exterior_color
string

ExteriorColor

fb_page_id

FbPageID

features
list<VehicleTMarketplaceVehicleFeature>

Features

fuel_type
enum

FuelType

images
list<string>

Images

interior_color
string

InteriorColor

legal_disclosure_impressum_url
string

LegalDisclosureImpressumUrl

make
string

Make

mileage
VehicleCatalogItemMileageData

Mileage

model
string

Model

previous_currency
string

PreviousCurrency

previous_price
string

PreviousPrice

price
string

Price

sale_currency
string

SaleCurrency

sale_price
string

SalePrice

sanitized_images
list<string>

SanitizedImages

state_of_vehicle
enum

StateOfVehicle

title
string

Title

transmission
enum

Transmission

trim
string

Trim

url
string

Url

vehicle_id
string

VehicleId

vehicle_registration_plate
string

VehicleRegistrationPlate

vehicle_specifications
list<VehicleVehicleSpecification>

VehicleSpecifications

vehicle_type
enum

VehicleType

vin
string

Vin

year
unsigned int32

Year

Validation Rules

ErrorDescription
100Invalid parameter
278Reading advertisements requires an access token with the extended permission ads_read

Creating

You can't perform this operation on this endpoint.

Updating

You can update a Vehicle by making a POST request to /{vehicle_id}.

Parameters

ParameterDescription
address
JSON object

address

city
string
Default value: ""

city

city_id
string

city_id

country
string
Default value: ""

country

latitude
float

latitude

longitude
float

longitude

neighborhoods
array<string>

neighborhoods

postal_code
string
Default value: ""

postal_code

region
string
Default value: ""

region

street_address
string
Default value: ""

street_address

applinks
Object

applinks

android

ios

ipad

iphone

windows_phone

availability
enum {AVAILABLE, NOT_AVAILABLE}

availability

body_style
enum {CONVERTIBLE, COUPE, CROSSOVER, HATCHBACK, MINIVAN, SMALL_CAR, TRUCK, SUV, SEDAN, VAN, WAGON, OTHER, NONE}

body_style

condition
enum {EXCELLENT, VERY_GOOD, GOOD, FAIR, POOR, OTHER, NONE}

condition

currency
ISO 4217 Currency Code

currency

date_first_on_lot
string

date_first_on_lot

dealer_id
string

dealer_id

dealer_name
string

dealer_name

dealer_phone
string

dealer_phone

description
string

description

drivetrain
enum {TWO_WD, FOUR_WD, AWD, FWD, RWD, OTHER, NONE}

drivetrain

exterior_color
string

exterior_color

fuel_type
enum {DIESEL, ELECTRIC, GASOLINE, FLEX, HYBRID, OTHER, PETROL, PLUGIN_HYBRID, NONE}

fuel_type

images
list<Object>

images

image_url
URL

Required
tags
list<string>

interior_color
string

interior_color

make
string

make

mileage
JSON object

mileage

unit
enum {KILOMETERS, MILES}
Default value: "MILES"

unit

value
int64
Default value: 0

value

model
string

model

price
int64

price

state_of_vehicle
enum {NEW, USED, CPO}

state_of_vehicle

title
string

title

transmission
enum {AUTOMATIC, MANUAL, OTHER, NONE}

transmission

trim
string

trim

url
URI

url

vehicle_type
enum {BOAT, CAR_TRUCK, COMMERCIAL, MOTORCYCLE, OTHER, POWERSPORT, RV_CAMPER, TRAILER}

vehicle_type

vin
string

vin

year
int64

year

Return Type

This endpoint supports read-after-write and will read the node to which you POSTed.
Struct {
success: bool,
}

Validation Rules

ErrorDescription
200Permissions error

Deleting

You can't perform this operation on this endpoint.