Get Villa

Example on how to Get 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/villa';
      $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


      {
          "response": "success",
          "villa": {
              "id": 6076,
              "villa_name": "A Villa Name is here",
              "bedrooms": 4,
              "bathrooms": 4,
              "sleeps": 8,
              "sqft": 0,
              "num_staff": 0,
              "check_in_time": "3:00 PM",
              "check_out_time": "12:00 PM",
              "body": "Body Returns HTML",
              "tagline": null,
              "min_stay_details": null,
              "air_conditioning_details": null,
              "distance_details": null,
              "pool_details": null,
              "wedding_details": null,
              "rate_policies": null,
              "rate_notes": null,
              "bedroom_details": null,
              "bathroom_details": null,
              "beach_details": "The beach is well planned for parents...",
              "staff_details": null,
              "staff_additional_details": null,
              "location_details": "On the hill, enjoy the historic...",
              "notes_details": null,
              "tax_service_charge_details": null,
              "security_deposit_details": null,
              "updated_at": "2019-02-26 12:09:49",
              "true_availability": 1,
              "lat": 18.465158,
              "lon": -77.399551,
              "region": null,
              "destination": "Jamaica",
              "location": "Tryall"
          },
          "collection_ids": [
              {
                  "collection_id": "8"
              },
              {
                  "collection_id": "5"
              },
              {
                  "collection_id": "6"
              },
              {
                  "collection_id": "1"
              }
          ],
          "damage_waiver": "damage waiver text",
      }