Graph API Version

Hotel Room

Reading

A hotel room object

Example

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

The unique ID of the hotel room generated by Facebook

applinks

App links for native platforms, e.g. Android, IOS and Windows Phone.

base_price
string

Base price per night for this hotel room.

currency
string

The currency used to pay

description
string

Description of the hotel room

images
list<string>

Links to hotel room images. Please note that carousel format utilizes a square 1:1 aspect ratio images (recommended size - 600x600px) while single hotel ad uses 1.91:1 aspect ratio image(recommended size - 1200x630px). Please provide at least one image.

margin_level
string

Margin level for this room

name
string

Name of the hotel room

room_id
string

Room's ID for the hotel room. From the room_id field in the feed

sale_price
string

Sale price per night for this hotel room. Make sure the sale_price of a hotel room is lower than its base_price.

url
string

URL of the hotel room

Edges

EdgeDescription

Vector of prices per date and length of stay

Validation Rules

ErrorDescription
278Reading advertisements requires an access token with the extended permission ads_read
275Cannot determine the target object for this request. Currently supported objects include ad account, business account and associated objects.

Creating

You can't perform this operation on this endpoint.

Updating

You can update a HotelRoom by making a POST request to /{hotel_room_id}.

Parameters

ParameterDescription
applinks
Object

App links for native platforms, e.g. Android, IOS and Windows Phone.

android

ios

ipad

iphone

windows_phone

base_price
float

From price of the hotel room

currency
ISO 4217 Currency Code

The currency used to pay

description
string

Description of the hotel

images
list<Object>

Links to hotel room images. Please note that carousel format utilizes a square 1:1 aspect ratio images (recommended size - 600x600px) while single hotel ad uses 1.91:1 aspect ratio image(recommended size - 1200x630px). Please provide at least one image.

image_url
URL

Required
tags
list<string>

margin_level
int64

Margin level for this room

name
string

Name of the hotel

pricing_variables
list<Object>

Vector of prices per date and length of stay

checkin_date
string

Required
fees
float

Required
nights
int64

Required
price
float

Required
rate_plan
enum {loyalty_members}

tax
float

Required
sale_price
float

sale_price_tax
float

sale_price
float

Sale price of the hotel room

url
URL

URL of the hotel

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 delete a HotelRoom by making a DELETE request to /{hotel_room_id}.

Parameters

This endpoint doesn't have any parameters.

Return Type

Struct {
success: bool,
}

Validation Rules

ErrorDescription
100Invalid parameter