Skip to content

How to fetch data from EMS

How to fetch data from EMS2.0

Summary

EMS2.0 provides REST API to fetch data, including alerts/events, incidents, etc.

Authentication

EMS2.0 use API key for authentication, you need to create an API key first.

Get the API Key

  1. Login into EMS2.0 with admin role.
  2. Go to Settings -> API Keys -> Create API Key.
  3. Input the Name and Description, then click Create.
  4. Copy the API Key and save it for later use.

Or contact EMS admin to create API key for you.

Use the API Key

The API key need be included in the request header X-API-KEY.
Example:

X-API-KEY: your_api_key_here
Or use basic auth with username as x-api-key and password as your actual API key.

Base URL

The base URL for EMS2.0 API is:

Prod: https://csgems.prod.webex.com/v2

Stage: https://csgems.stage.webex.com/v2

API Doc

https://api.keephq.dev/redoc#tag/

REST API Examples

Fetch Alerts

Fetch alerts with CEL query, for example, fetch the latest 10 firing alerts from source splunk.

curl --location 'https://csgems.stage.webex.com/v2/alerts/query' \
--header 'X-API-KEY: {your_api_key}' \
--header 'Content-Type: application/json' \
--data '{  "cel": "source=='\''splunk'\'' && status=='\''firing'\''",  "limit": 10}'