const url = 'https://api.channelautomation.com/api/field-sales/conversations';
const options = {
method: 'POST',
headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
body: JSON.stringify({
title: 'string',
filename: 'string',
mime_type: 'string',
size_bytes: 0,
source: 'web_recorder',
contact_id: 'f245e2a3-e141-4d41-912c-b1c1f5bd5598',
appointment_id: '21634f0d-2156-4d4b-a142-2e7c783a9212',
client_recording_id: '4987f4f6-e33c-42e3-bbee-1db4c1c1d9ab',
consent_confirmed: true,
consent_method: 'string',
started_at: '2019-08-24T14:15:22Z',
ended_at: '2019-08-24T14:15:22Z',
duration_seconds: 0
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));