const options = {
method: 'PATCH',
headers: {
'x-api-key': '<api-key>',
'x-api-secret': '<api-key>',
'x-connector-id': '<api-key>',
'x-owner-id': '<api-key>',
'x-session-token': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
direction: 'inbound',
status: 'planned',
startedAt: '2023-11-07T05:31:56Z',
answeredAt: '2023-11-07T05:31:56Z',
endedAt: '2023-11-07T05:31:56Z',
duration: 1,
recordingUrl: '<string>',
users: [
{
id: '<string>',
object: 'resourceRef',
model: '<string>',
fields: '<unknown>',
rawResource: '<unknown>',
remote: {id: '<string>'},
createdAt: '<string>',
updatedAt: '<string>'
}
],
contacts: [
{
id: '<string>',
object: 'resourceRef',
model: '<string>',
fields: '<unknown>',
rawResource: '<unknown>',
remote: {id: '<string>'},
createdAt: '<string>',
updatedAt: '<string>'
}
],
externalNumber: '<string>',
internalNumber: '<string>',
transcript: {
id: '<string>',
object: 'resourceRef',
model: '<string>',
fields: '<unknown>',
rawResource: '<unknown>',
remote: {id: '<string>'},
createdAt: '<string>',
updatedAt: '<string>'
}
})
};
fetch('https://api.runmorph.dev/v1/resources/telephonyCall/{resourceId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));