Retrieve vehicles from a product catalog.
GET /v18.0/{product-catalog-id}/vehicles 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(
'/{product-catalog-id}/vehicles',
'{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(
"/{product-catalog-id}/vehicles",
function (response) {
if (response && !response.error) {
/* handle the result */
}
}
);
/* make the API call */
new GraphRequest(
AccessToken.getCurrentAccessToken(),
"/{product-catalog-id}/vehicles",
null,
HttpMethod.GET,
new GraphRequest.Callback() {
public void onCompleted(GraphResponse response) {
/* handle the result */
}
}
).executeAsync();
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
initWithGraphPath:@"/{product-catalog-id}/vehicles"
parameters:params
HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
id result,
NSError *error) {
// Handle the result
}];
Parameter | Description |
---|---|
bulk_pagination boolean | Used for iterating over the edge in large chunks |
filter A JSON-encoded rule | JSON-encoded WCA rule expression representing the filter to be applied for the edge |
Reading from this edge will return a JSON formatted result:
{ "
data
": [], "paging
": {}, "summary
": {} }
data
paging
summary
Aggregated information about the edge, such as counts. Specify the fields to fetch in the summary param (like summary=total_count
).
Field | Description |
---|---|
total_count unsigned int32 | Total number of vehicles returned by the query |
Error | Description |
---|---|
100 | Invalid parameter |
vehicles
edge from the following paths: Parameter | Description |
---|---|
address JSON object | address Required |
applinks Object | applinks |
availability enum {AVAILABLE, NOT_AVAILABLE, PENDING} | availability |
body_style enum {CONVERTIBLE, COUPE, CROSSOVER, ESTATE, GRANDTOURER, HATCHBACK, MINIBUS, MINIVAN, MPV, PICKUP, ROADSTER, SALOON, SEDAN, SMALL_CAR, SPORTSCAR, SUPERCAR, SUPERMINI, SUV, TRUCK, VAN, WAGON, OTHER, NONE} | body_style Required |
condition enum {EXCELLENT, VERY_GOOD, GOOD, FAIR, POOR, OTHER, NONE} | condition |
currency ISO 4217 Currency Code | currency Required |
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 Required |
drivetrain enum {TWO_WD, FOUR_WD, AWD, FWD, RWD, OTHER, NONE} | drivetrain |
exterior_color string | exterior_color Required |
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 Required |
interior_color string | interior_color |
make string | make Required |
mileage JSON object | mileage Required |
model string | model Required |
price int64 | price Required |
state_of_vehicle enum {NEW, USED, CPO} | state_of_vehicle Required |
title string | title Required |
transmission enum {AUTOMATIC, MANUAL, OTHER, NONE} | transmission |
trim string | trim |
url URI | url Required |
vehicle_id string | vehicle_id Required |
vehicle_type enum {BOAT, CAR_TRUCK, COMMERCIAL, MOTORCYCLE, OTHER, POWERSPORT, RV_CAMPER, TRAILER} | vehicle_type |
vin string | vin Required |
year int64 | year Required |
id
in the return type.id
: numeric string, Error | Description |
---|---|
100 | Invalid parameter |