Marketing API Version

Hotel

Reading

Represents a hotel in a catalog.

Example

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

address
string

Address

applinks

Applinks

brand
string

Brand

description
string

Description

guest_ratings
string

GuestRatings

hotel_id
string

HotelId

images
list<string>

Images

lowest_base_price
string

LowestBasePrice

loyalty_program
string

LoyaltyProgram

margin_level
unsigned int32

MarginLevel

name
string

Name

phone
string

Phone

star_rating
float

StarRating

url
string

Url

Edges

EdgeDescription

hotel_rooms

HotelRooms

Validation Rules

ErrorDescription
100Invalid parameter
294Managing advertisements requires an access token with the extended permission for ads_management

Creating

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

Parameters

NameDescription
address
Object

The address of the hotel

Required
city
string
Required
city_id
string
country
string
Required
latitude
float
Required
longitude
float
Required
neighborhoods
list<string>
postal_code
string
Required
region
string
Required
street_address
string
Required
applinks
Object

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

android
ios
ipad
iphone
windows_phone
brand
string

Hotel brand

description
string

Description of the hotel

Required
guest_ratings
list<Object>

Guest ratings for this hotel.

score
float
Required
rating_system
string
Required
number_of_raters
int64
Required
hotel_id
string

A unique identifier for this hotel provided by advertiser. (i.e. from the id field in the feed

Required
images
list<Object>

Links to hotel 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.

Required
image_url
URL
Required
tags
list<string>
name
string

Name of the hotel

Required
phone
phone number string

Hotel's phone number

star_rating
float

The star rating of the hotel

url
URL

Link to the external site where you can book a hotel room

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,
}
You may perform a POST request to the following edge from this node:

Validation Rules

ErrorDescription
100Invalid parameter

Updating

You can update a Hotel by making a POST request to /{hotel_id}.

Parameters

NameDescription
address
Object

The address of the hotel

city
string
Required
city_id
string
country
string
Required
latitude
float
Required
longitude
float
Required
neighborhoods
list<string>
postal_code
string
Required
region
string
Required
street_address
string
Required
applinks
Object

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

android
ios
ipad
iphone
windows_phone
brand
string

Hotel brand

description
string

Description of the hotel

guest_ratings
list<Object>

Guest ratings for this hotel.

score
float
Required
rating_system
string
Required
number_of_raters
int64
Required
images
list<Object>

Links to hotel 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>
name
string

Name of the hotel

phone
phone number string

Hotel's phone number

star_rating
float

The star rating of the hotel

url
URL

Link to the external site where you can book a hotel room

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 Hotel by making a DELETE request to /{hotel_id}.

Parameters

This endpoint doesn't have any parameters.

Return Type

Struct {
success: bool,
}

Validation Rules

ErrorDescription
100Invalid parameter