const url = 'https://api.testandaccept.com/api/rest/user-stories/apply-sow-generation';
const options = {
method: 'POST',
headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
body: JSON.stringify({
projectId: '5a8591dd-4039-49df-9202-96385ba3eff8',
sowId: 'fe04f5bb-ebd6-4987-816c-4f641b7fc60a',
sowTitle: 'string',
sowDescription: 'string',
storyIds: ['497f6eca-6276-4993-bfeb-53cbbbba6f08'],
taskProposals: [
{
title: 'string',
description: '',
type: 'requirement',
priority: 'low',
acceptanceCriteria: ['string'],
linkedStepIds: ['497f6eca-6276-4993-bfeb-53cbbbba6f08']
}
],
stepMappings: [{stepId: '50e29fb7-490e-4a88-b2f4-2fde4d70423d', taskIndex: 0}]
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));