Marketing API Version

Hotel Hotel Rooms

Reading

Rooms in this hotel

Example

Graph API Explorer
GET /v2.11/{hotel-id}/hotel_rooms 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-id}/hotel_rooms',
    '{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-id}/hotel_rooms",
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{hotel-id}/hotel_rooms",
    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-id}/hotel_rooms"
                                      parameters:params
                                      HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];

Permissions

Developers usually request these permissions for this endpoint:

Marketing Apps
  • ads_management
Page management Apps
No data
Other Apps
No data

Parameters

This endpoint doesn't have any parameters.

Fields

Reading from this edge will return a JSON formatted result:

{ "data": [], "paging": {} }

data

A list of HotelRoom nodes.

paging

For more details about pagination, see the Graph API guide.

Validation Rules

ErrorDescription
100Invalid parameter

Creating

Example

You can make a POST request to hotel_rooms edge from the following paths:
When posting to this edge, a HotelRoom will be created.

Permissions

Developers usually request these permissions for this endpoint:

Marketing Apps
  • ads_management
Page management Apps
No data
Other Apps
No data

Parameters

NameDescription
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

Required
currency
ISO 4217 Currency Code

Currency for the hotel room

Required
description
string

Description of the hotel

Required
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

Required
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
room_id
string

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

Required
sale_price
float

Sale price of the hotel room

url
URL

URL of the hotel

Required

Return Type

This endpoint supports read-after-write and will read the node represented by id in the return type.
Struct {
id: numeric string,
}

Validation Rules

ErrorDescription
804Specified object already exists

Updating

You can't perform this operation on this endpoint.

Deleting

You can't perform this operation on this endpoint.