const url = 'https://api.sureshake.com/v2/entities/<id>/periods';
const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
templateId: '196100ac-4eec-4fb6-a7f7-86c8b584771d',
autoCreatePeriods: true,
periodsInAdvance: 0,
reminderDays: 0
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));