Graph API Version

Flight

Reading

Represents a flight in a catalog

Example

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

applinks

Applinks

currency
string

Currency

description
string

Description

destination_airport
string

DestinationAirport

destination_city
string

DestinationCity

flight_id
string

FlightId

images
list<string>

Images

oneway_currency
string

OnewayCurrency

oneway_price
string

OnewayPrice

origin_airport
string

OriginAirport

origin_city
string

OriginCity

price
string

Price

sanitized_images
list<string>

SanitizedImages

url
string

Url

Validation Rules

ErrorDescription
100Invalid parameter

Creating

You can't perform this operation on this endpoint.

Updating

You can update a Flight by making a POST request to /{flight_id}.

Parameters

ParameterDescription
currency
string

The currency of the specified price of the flight

description
string

Specified description of the flight.

destination_airport
string

The IATA code for the destination airport.

images
list<Object>

Links to flight images and their associated tags.

image_url
URL

Required
tags
list<string>

origin_airport
string

The IATA code for the origin airport.

price
int64

Specified price of the flight.

url
URI

Link to the external site where you can book the flight.

Return Type

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

Validation Rules

ErrorDescription
100Invalid parameter

Deleting

You can't perform this operation on this endpoint.