const fetch = require('node-fetch');
let url = 'https://api.coralogix.com/mgmt/openapi/v1/views';
let options = {
method: 'POST',
headers: {Authorization: 'Bearer <API_KEY>', 'content-type': 'application/json'},
body: '{"name":"Logs view","searchQuery":{"query":"string"},"timeSelection":{"quickSelection":{"caption":"Last Hour","seconds":3600},"customSelection":{"fromTime":"2024-01-25T11:31:43.152Z","toTime":"2024-01-25T11:35:43.152Z"}},"filters":{"filters":[{"name":"applicationName","selectedValues":{"demo":true,"cs-rest-test1":true}}]},"folderId":"3dc02998-0b50-4ea8-b68a-4779d716fa1f"}'
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error('error:' + err));