Skip to content

Instantly share code, notes, and snippets.

@a-eid

a-eid/updateMinNights.js

Last active Mar 7, 2020
Embed
What would you like to do?
fetch("https://www.airbnb.com/api/v2/calendar_rules/id?key=key&_intents=mys_update_calendar_rules&_format=use_miso_default", {
method: "PUT",
headers: {
accept: "application/json",
"accept-language": "en-US,en;q=0.9",
"content-type": "application/json",
'X-Airbnb-OAuth-Token': token
},
referrer: "https://www.airbnb.com/manage-your-space/41040547/availability/trip-length",
referrerPolicy: "no-referrer-when-downgrade",
body: JSON.stringify({
seasonal_min_nights: [{ end_date, min_nights, start_date, start_day_of_week: -1 }],
day_of_week_min_nights: [
{ day_of_week: 0, min_nights: null },
{ day_of_week: 1, min_nights: null },
{ day_of_week: 2, min_nights: null },
{ day_of_week: 3, min_nights: null },
{ day_of_week: 4, min_nights: null },
{ day_of_week: 5, min_nights: null },
{ day_of_week: 6, min_nights: null },
],
}),
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.