Skip to content

Instantly share code, notes, and snippets.

@a-eid
Last active March 7, 2020 06:32
Show Gist options
  • Save a-eid/960745fcd831cd58d91d6c4920964c1b to your computer and use it in GitHub Desktop.
Save a-eid/960745fcd831cd58d91d6c4920964c1b to your computer and use it in GitHub Desktop.
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