Get Photos
Example on how to Get Photos 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/photos';
$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",
"photos": [
"https://wthvillas-prod.s3-us-west-2.amazonaws.com/photos/allamanda_1_-_nl18-03_copy.jpg",
"https://wthvillas-prod.s3-us-west-2.amazonaws.com/photos/allamanda_2_-_nl18-02_copy.jpg",
"https://wthvillas-prod.s3-us-west-2.amazonaws.com/photos/allamanda_3_-_nl18-01_copy.jpg",
"https://wthvillas-prod.s3-us-west-2.amazonaws.com/photos/allamanda_4_-_nl18-31_copy.jpg",
"https://wthvillas-prod.s3-us-west-2.amazonaws.com/photos/allamanda_5_-nl18-06_copy.jpg",
"https://wthvillas-prod.s3-us-west-2.amazonaws.com/photos/allamanda_6_-nl18-05_copy.jpg",
"https://wthvillas-prod.s3-us-west-2.amazonaws.com/photos/allamanda_7_-nl18-13_copy.jpg",
"https://wthvillas-prod.s3-us-west-2.amazonaws.com/photos/allamanda_8_-nl18-09_copy.jpg",
"https://wthvillas-prod.s3-us-west-2.amazonaws.com/photos/allamanda_9_-nl18-04_copy.jpg",
"https://wthvillas-prod.s3-us-west-2.amazonaws.com/photos/allamanda_10_-nl18-15_copy.jpg",
"https://wthvillas-prod.s3-us-west-2.amazonaws.com/photos/allamanda_11_-dsc_5234-edit.jpg",
"https://wthvillas-prod.s3-us-west-2.amazonaws.com/photos/allamanda_12_-dsc_5261-edit.jpg",
"https://wthvillas-prod.s3-us-west-2.amazonaws.com/photos/allamanda_13_-nl18-07_copy.jpg",
"https://wthvillas-prod.s3-us-west-2.amazonaws.com/photos/allamanda_14_-nl18-34_copy.jpg",
"https://wthvillas-prod.s3-us-west-2.amazonaws.com/photos/allamanda_15_-nl18-23_copy.jpg",
"https://wthvillas-prod.s3-us-west-2.amazonaws.com/photos/allamanda_16_-nl18-24_copy.jpg",
"https://wthvillas-prod.s3-us-west-2.amazonaws.com/photos/allamanda_17_-nl18-25_copy.jpg",
"https://wthvillas-prod.s3-us-west-2.amazonaws.com/photos/allamanda_18_-nl18-27_copy.jpg",
"https://wthvillas-prod.s3-us-west-2.amazonaws.com/photos/allamanda_19_-nl18-26_copy.jpg",
"https://wthvillas-prod.s3-us-west-2.amazonaws.com/photos/allamanda_20_-nl18-35_copy.jpg",
"https://wthvillas-prod.s3-us-west-2.amazonaws.com/photos/allamanda_21_-nl18-28_copy.jpg",
"https://wthvillas-prod.s3-us-west-2.amazonaws.com/photos/allamanda_22_-nl18-29_copy.jpg",
"https://wthvillas-prod.s3-us-west-2.amazonaws.com/photos/allamanda_23_-dsc_0759-edit.jpg",
"https://wthvillas-prod.s3-us-west-2.amazonaws.com/photos/allamanda_24_-nl18-30_copy.jpg",
"https://wthvillas-prod.s3-us-west-2.amazonaws.com/photos/allamanda_25_-nl18-36_copy.jpg",
"https://wthvillas-prod.s3-us-west-2.amazonaws.com/photos/allamanda_26_-nl18-33_copy.jpg",
"https://wthvillas-prod.s3-us-west-2.amazonaws.com/photos/1544019561-dsc_0710-edit.jpg",
"https://wthvillas-prod.s3-us-west-2.amazonaws.com/photos/1544032956-dsc_0710-edit.jpg",
"https://wthvillas-prod.s3-us-west-2.amazonaws.com/photos/1544033407-1544032956-dsc_0710-editrrrrr.jpg"
]
}