const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
text: '<string>',
ticket_id: 123,
mentioned_agent_ids: [123],
files: [123],
widgets: [{id: '<string>', type: 'link', label: '<string>', params: {url: '<string>'}}],
email_cc: ['<string>'],
email_bcc: ['<string>'],
canned_response_usage_ids: [123],
canned_response_actions: [{status_id: 123, type: 'set_status'}]
})
};
fetch('https://back.leap.onclarity.com/api/message/send', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));