Set the photos
curl --request PUT \
--url https://staging.housera.ro/api/v1/listings/{code}/photos \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"photos": [
{
"url": "<string>",
"key": "<string>",
"floor": "<string>",
"rooms": [
"<string>"
]
}
]
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://staging.housera.ro/api/v1/listings/{code}/photos",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'photos' => [
[
'url' => '<string>',
'key' => '<string>',
'floor' => '<string>',
'rooms' => [
'<string>'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
photos: [{url: '<string>', key: '<string>', floor: '<string>', rooms: ['<string>']}]
})
};
fetch('https://staging.housera.ro/api/v1/listings/{code}/photos', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://staging.housera.ro/api/v1/listings/{code}/photos"
payload = { "photos": [
{
"url": "<string>",
"key": "<string>",
"floor": "<string>",
"rooms": ["<string>"]
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text){
"queued": 123
}Photos
Set the photos
The complete list of photos, in order (the first is the cover): URLs to download or pre-signed upload keys. A photo missing from the list is deleted. The response comes immediately (202); the photos are processed in the background, and media.processing shows when it’s done.
PUT
/
listings
/
{code}
/
photos
Set the photos
curl --request PUT \
--url https://staging.housera.ro/api/v1/listings/{code}/photos \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"photos": [
{
"url": "<string>",
"key": "<string>",
"floor": "<string>",
"rooms": [
"<string>"
]
}
]
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://staging.housera.ro/api/v1/listings/{code}/photos",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'photos' => [
[
'url' => '<string>',
'key' => '<string>',
'floor' => '<string>',
'rooms' => [
'<string>'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
photos: [{url: '<string>', key: '<string>', floor: '<string>', rooms: ['<string>']}]
})
};
fetch('https://staging.housera.ro/api/v1/listings/{code}/photos', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://staging.housera.ro/api/v1/listings/{code}/photos"
payload = { "photos": [
{
"url": "<string>",
"key": "<string>",
"floor": "<string>",
"rooms": ["<string>"]
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text){
"queued": 123
}Authorizations
Authorization: Bearer
Path Parameters
The public code of the listing (8 characters, as in its address on Housera).
Body
application/json
Photos.
Maximum array length:
100Show child attributes
Show child attributes
Response
Accepted: processing in the background.
How many images have entered processing. The result comes in events media.*.