Get Villas

Example on how to Get a list of Villas

This sample code is written in PHP:


      $url = 'https://api.wthvillas.com/api/v1/villas';

      $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);

      $response = curl_exec($curl);

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

Response example data


      {
      "response": "success",
      "villas": [
        {
          "id": 123,
          "villa_name": "A Villa Name is here",
          "bedrooms": 7,
          "bathrooms": 9,
          "sleeps": 14,
          "sqft": 12000,
          "num_staff": 5,
          "check_in_time": "3:00 PM",
          "check_out_time": "11:00 AM",
          "body": "Body Returns HTML",
          "tagline": null,
          "min_stay_details": null,
          "air_conditioning_details": null,
          "distance_details": "Town: 3 minute walk to Discovery Bay...",
          "pool_details": "16' x 32' x 6' deep",
          "wedding_details": "Additional staff required (plus tables, chairs, etc.)...",
          "rate_policies": "Extra Guest Fee: $50 per night for each additional guest",
          "rate_notes": null,
          "bedroom_details": null,
          "bathroom_details": null,
          "beach_details": null,
          "staff_details": null,
          "staff_additional_details": null,
          "location_details": null,
          "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": "caribbean",
          "destination": "Jamaica",
          "location": "Discovery Bay",
          "published": "1"
        },
        {
          "id": 456,
          "villa_name": "Another Villas Name goes here",
          "bedrooms": 5,
          "bathrooms": 4,
          "sleeps": 12,
          "sqft": 8000,
          "num_staff": 6,
          "check_in_time": "3:00 PM",
          "check_out_time": "11:00 AM",
          "body": "Body Returns HTML",
          "tagline": null,
          "min_stay_details": null,
          "air_conditioning_details": null,
          "distance_details": "Beach: 4 minute drive to Round Hill",
          "pool_details": "17x35-foot\r\nzero entry end...",
          "wedding_details": "$15 surcharge applies. Maximum guests: 50",
          "rate_policies": "Additional rate of $50 per guest, per night...",
          "rate_notes": null,
          "bedroom_details": null,
          "bathroom_details": null,
          "beach_details": null,
          "staff_details": null,
          "staff_additional_details": null,
          "location_details": null,
          "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": "caribbean",
          "destination": "Jamaica",
          "location": "Montego Bay",
          "published": "1"
        }
      ],
      "damage_waiver": "damage waiver text"
    }