Skip to main content
Node.js
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
}

Authorizations

Authorization
string
header
required

API key authentication

Body

application/json

View folder.

View folder.

name
string
required

View name

Minimum string length: 1
Example:

"Logs view"

timeSelection
Time selection · object
required
searchQuery
SearchQuery · object
filters
Selected filters · object
folderId
string<uuid>

Unique identifier for folders

Required string length: 36
Example:

"3dc02998-0b50-4ea8-b68a-4779d716fa1f"

Response

View

Response for views.

id
integer<int32>
required

id

Example:

52

name
string
required

View name

Minimum string length: 1
Example:

"Logs view"

timeSelection
Time selection · object
required
searchQuery
SearchQuery · object
filters
Selected filters · object
folderId
string<uuid>

Unique identifier for folders

Required string length: 36
Example:

"3dc02998-0b50-4ea8-b68a-4779d716fa1f"

isCompactMode
boolean