Schimbă programul unui anunț
curl --request PATCH \
--url https://staging.housera.ro/api/v1/listings/{code}/viewing-schedule \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"hours": {},
"available_from": "2023-12-25",
"runner": "jsmith@example.com",
"occupant": {
"notify": true,
"phone": "<string>"
},
"confirm_pending": true,
"blocked_dates": [
{
"from": "2023-12-25",
"to": "2023-12-25"
}
]
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://staging.housera.ro/api/v1/listings/{code}/viewing-schedule",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'hours' => [
],
'available_from' => '2023-12-25',
'runner' => 'jsmith@example.com',
'occupant' => [
'notify' => true,
'phone' => '<string>'
],
'confirm_pending' => true,
'blocked_dates' => [
[
'from' => '2023-12-25',
'to' => '2023-12-25'
]
]
]),
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: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
hours: {},
available_from: '2023-12-25',
runner: 'jsmith@example.com',
occupant: {notify: true, phone: '<string>'},
confirm_pending: true,
blocked_dates: [{from: '2023-12-25', to: '2023-12-25'}]
})
};
fetch('https://staging.housera.ro/api/v1/listings/{code}/viewing-schedule', 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}/viewing-schedule"
payload = {
"hours": {},
"available_from": "2023-12-25",
"runner": "jsmith@example.com",
"occupant": {
"notify": True,
"phone": "<string>"
},
"confirm_pending": True,
"blocked_dates": [
{
"from": "2023-12-25",
"to": "2023-12-25"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"data": {
"code": "<string>",
"mode": "<string>",
"timezone": "<string>",
"hours": {},
"duration_min": 123,
"notice_min": "<string>",
"available_from": "<string>",
"confirmation": "<string>",
"runner": {
"name": "<string>",
"email": "<string>"
},
"blocked_dates": [
{
"from": "<string>",
"to": "<string>"
}
],
"occupant": {
"notify": true,
"phone": "<string>"
},
"effective": {
"hours": {},
"duration_min": 123,
"buffer_min": 123,
"notice_min": 123,
"horizon_days": 123,
"confirmation": "<string>",
"blocked_dates": [
{
"from": "<string>",
"to": "<string>"
}
]
},
"base_saved": true,
"pending_requests": 123,
"confirmed_pending": {
"confirmed": 123,
"still_waiting": 123
}
}
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "<string>",
"detail": "<string>",
"existing": {
"code": "<string>",
"external_ref": "<string>"
}
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "<string>",
"detail": "<string>",
"existing": {
"code": "<string>",
"external_ref": "<string>"
}
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "<string>",
"detail": "<string>",
"existing": {
"code": "<string>",
"external_ref": "<string>"
}
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "<string>",
"detail": "<string>",
"existing": {
"code": "<string>",
"external_ref": "<string>"
}
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "<string>",
"detail": "<string>",
"existing": {
"code": "<string>",
"external_ref": "<string>"
}
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "<string>",
"detail": "<string>",
"existing": {
"code": "<string>",
"external_ref": "<string>"
}
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"errors": [
{
"pointer": "<string>",
"code": "<string>",
"detail": "<string>"
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "<string>",
"detail": "<string>",
"existing": {
"code": "<string>",
"external_ref": "<string>"
}
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "<string>",
"detail": "<string>",
"existing": {
"code": "<string>",
"external_ref": "<string>"
}
}Vizionări
Schimbă programul unui anunț
Se schimbă doar câmpurile trimise. Doar mode schimbă modul și păstrează regulile și orele proprii, ca în portal. null la duration_min sau confirmation înseamnă „ca de obicei”. runner e emailul unui coleg activ din firmă, iar null lasă vizionările titularului.
PATCH
/
listings
/
{code}
/
viewing-schedule
Schimbă programul unui anunț
curl --request PATCH \
--url https://staging.housera.ro/api/v1/listings/{code}/viewing-schedule \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"hours": {},
"available_from": "2023-12-25",
"runner": "jsmith@example.com",
"occupant": {
"notify": true,
"phone": "<string>"
},
"confirm_pending": true,
"blocked_dates": [
{
"from": "2023-12-25",
"to": "2023-12-25"
}
]
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://staging.housera.ro/api/v1/listings/{code}/viewing-schedule",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'hours' => [
],
'available_from' => '2023-12-25',
'runner' => 'jsmith@example.com',
'occupant' => [
'notify' => true,
'phone' => '<string>'
],
'confirm_pending' => true,
'blocked_dates' => [
[
'from' => '2023-12-25',
'to' => '2023-12-25'
]
]
]),
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: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
hours: {},
available_from: '2023-12-25',
runner: 'jsmith@example.com',
occupant: {notify: true, phone: '<string>'},
confirm_pending: true,
blocked_dates: [{from: '2023-12-25', to: '2023-12-25'}]
})
};
fetch('https://staging.housera.ro/api/v1/listings/{code}/viewing-schedule', 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}/viewing-schedule"
payload = {
"hours": {},
"available_from": "2023-12-25",
"runner": "jsmith@example.com",
"occupant": {
"notify": True,
"phone": "<string>"
},
"confirm_pending": True,
"blocked_dates": [
{
"from": "2023-12-25",
"to": "2023-12-25"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"data": {
"code": "<string>",
"mode": "<string>",
"timezone": "<string>",
"hours": {},
"duration_min": 123,
"notice_min": "<string>",
"available_from": "<string>",
"confirmation": "<string>",
"runner": {
"name": "<string>",
"email": "<string>"
},
"blocked_dates": [
{
"from": "<string>",
"to": "<string>"
}
],
"occupant": {
"notify": true,
"phone": "<string>"
},
"effective": {
"hours": {},
"duration_min": 123,
"buffer_min": 123,
"notice_min": 123,
"horizon_days": 123,
"confirmation": "<string>",
"blocked_dates": [
{
"from": "<string>",
"to": "<string>"
}
]
},
"base_saved": true,
"pending_requests": 123,
"confirmed_pending": {
"confirmed": 123,
"still_waiting": 123
}
}
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "<string>",
"detail": "<string>",
"existing": {
"code": "<string>",
"external_ref": "<string>"
}
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "<string>",
"detail": "<string>",
"existing": {
"code": "<string>",
"external_ref": "<string>"
}
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "<string>",
"detail": "<string>",
"existing": {
"code": "<string>",
"external_ref": "<string>"
}
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "<string>",
"detail": "<string>",
"existing": {
"code": "<string>",
"external_ref": "<string>"
}
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "<string>",
"detail": "<string>",
"existing": {
"code": "<string>",
"external_ref": "<string>"
}
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "<string>",
"detail": "<string>",
"existing": {
"code": "<string>",
"external_ref": "<string>"
}
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"errors": [
{
"pointer": "<string>",
"code": "<string>",
"detail": "<string>"
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "<string>",
"detail": "<string>",
"existing": {
"code": "<string>",
"external_ref": "<string>"
}
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "<string>",
"detail": "<string>",
"existing": {
"code": "<string>",
"external_ref": "<string>"
}
}Parametri cale
Parametri interogare
Limba răspunsului, ro sau en. Schimbă mesajele erorilor (title, detail), etichetele și, când anunțul are o traducere aprobată în limba cerută, titlul și descrierea lui. Codurile sunt aceleași în orice limbă. Are întâietate față de Accept-Language și de limba contului.
Opțiuni disponibile:
ro, en Corp
application/json