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));{
"id": 52,
"name": "Logs view",
"timeSelection": {
"quickSelection": {
"seconds": 3600,
"caption": "Last Hour"
},
"customSelection": {
"fromTime": "2024-01-25T11:31:43.152Z",
"toTime": "2024-01-25T11:35:43.152Z"
}
},
"searchQuery": {
"query": "<string>"
},
"filters": {
"filters": [
{
"name": "applicationName",
"selectedValues": {
"demo": true,
"cs-rest-test1": true
}
}
]
},
"folderId": "3dc02998-0b50-4ea8-b68a-4779d716fa1f",
"isCompactMode": true
}Creates a new view
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));{
"id": 52,
"name": "Logs view",
"timeSelection": {
"quickSelection": {
"seconds": 3600,
"caption": "Last Hour"
},
"customSelection": {
"fromTime": "2024-01-25T11:31:43.152Z",
"toTime": "2024-01-25T11:35:43.152Z"
}
},
"searchQuery": {
"query": "<string>"
},
"filters": {
"filters": [
{
"name": "applicationName",
"selectedValues": {
"demo": true,
"cs-rest-test1": true
}
}
]
},
"folderId": "3dc02998-0b50-4ea8-b68a-4779d716fa1f",
"isCompactMode": true
}API key authentication
View folder.
View folder.
View name
1"Logs view"
Show child attributes
Show child attributes
1Show child attributes
Unique identifier for folders
36"3dc02998-0b50-4ea8-b68a-4779d716fa1f"
View
Response for views.
id
52
View name
1"Logs view"
Show child attributes
Show child attributes
1Show child attributes
Unique identifier for folders
36"3dc02998-0b50-4ea8-b68a-4779d716fa1f"
Was this page helpful?