Setează pozele
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
}Poze
Setează pozele
Lista completă a pozelor, în ordine (prima e coperta): URL-uri de descărcat sau chei de upload presemnat. O poză care lipsește din listă se șterge. Răspunsul vine imediat (202); pozele se procesează în fundal, iar media.processing arată când s-a terminat.
PUT
/
listings
/
{code}
/
photos
Setează pozele
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
}Autorizări
Authorization: Bearer
Parametri cale
Codul public al anunțului (8 caractere, ca în adresa lui de pe Housera).
Corp
application/json
Fotografiile.
Maximum array length:
100Show child attributes
Show child attributes
Răspuns
Acceptat: se procesează în fundal.
Câte poze au intrat la procesare. Rezultatul vine în evenimentele media.*.