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.
Represents a listing for vehicle in a catalog
GET /v9.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
}];
Field | Description |
---|---|
id numeric string | Id |
address VehicleLocationAddressData | Address |
applinks | App links for native platforms, e.g. Android, iOS and Windows Phone |
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 |
Error | Description |
---|---|
100 | Invalid parameter |
368 | The action attempted has been deemed abusive or is otherwise disallowed |
/{vehicle_id}
.Parameter | Description |
---|---|
address JSON object | address |
applinks Object | applinks |
availability enum {AVAILABLE, NOT_AVAILABLE, PENDING} | 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 |
fb_page_id string | fb_page_id |
fuel_type enum {DIESEL, ELECTRIC, GASOLINE, FLEX, HYBRID, OTHER, PETROL, PLUGIN_HYBRID, NONE} | fuel_type |
images list<Object> | images |
interior_color string | interior_color |
make string | make |
mileage JSON object | mileage |
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 |
success
: bool, Error | Description |
---|---|
200 | Permissions error |