Get Amenities

Example on how to Get Amenities for a Villa

Post Request data

Name Type Description
villa_id Integer Id of the Villas you want to retrieve info on.

This sample code is written in PHP:


      $url = 'https://api.wthvillas.com/api/v1/amenities';
      $data = array('villa_id' => "123");
      $data_string = $data;

      $curl = curl_init();
      curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
      curl_setopt($curl, CURLOPT_TIMEOUT, 30);
      curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        'Authorization: Bearer YourTokenGoesHere'
      );
      curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "POST");
      curl_setopt($curl, CURLOPT_URL, $url);
      curl_setopt($curl, CURLOPT_POST,count($data));
      curl_setopt($curl, CURLOPT_POSTFIELDS, $data_string);

      $response = curl_exec($curl);

      curl_close($curl);
      $returnData = json_decode($response, true);
      print_r($returnData);
  

Response example data

Not all villas have the same amenities. This is a return from one specific Villa.


      {
        "response": "success",
        "featured_amenities": [
            "Air Conditioning",
            "Beachfront",
            "Waterfront"
        ],
        "amenities": [
            "Air Conditioning",
            "Audio: iPod Dock(s)",
            "Bathrooms: Bathrobes",
            "Bathrooms: Hair Dryers",
            "Bathrooms: Jacuzzi",
            "Beach Club & Resort Membership: Round Hill (outside the gate)",
            "Chef",
            "Child Friendly: Connecting Bedroom(s)",
            "Child Friendly: Kids Club Membership",
            "Child Friendly: Playground Nearby",
            "Child Friendly: Playground on Site",
            "Children Welcome",
            "Communications: Complimentary Calls to the US, UK and Canada",
            "Communications: Computer or Laptop",
            "Communications: Wireless Internet Access",
            "Fitness Equipment: Complimentary use of the new Round Hill Gym",
            "Fitness Equipment: Full Gym Nearby (walk, drive or take golf cart)",
            "Fully Staffed Villa",
            "Golf Available",
            "Golf and Tennis: Golf on Site or Nearby",
            "Golf and Tennis: Tennis Nearby",
            "Handicap Access",
            "Internet",
            "Other: Available for Weddings",
            "Other: Handicap Accessible",
            "Other: Ping Pong",
            "Other: Pool Table",
            "Other: Spa on Site or Nearby",
            "Pool",
            "Pool and Sea Area: Heated Pool"
        ]
    }