Each API request must include the following:
-
The URL path and endpoint — for example:
-
https://api.moogsoft.ai/v1/integrations/metrics
-
https://api.moogsoft.ai/v1/integrations/events
-
https://api.moogsoft.ai/v1/alerts
-
https://api.moogsoft.ai/v1/collectors/datums
-
-
A content-type header such as:
"Content-type": application/json
Note: Most endpoints expect
application/json
as the content type, but there are exceptions. Verify the required content type in the documentation before you send a command. -
The API key. To generate an API key, navigate in the Moogsoft UI to Settings > Manage API Keys.
Note: Users do not have API keys by default. You must create them manually. Read Manage API Keys for important notes and details.
Authentication
Moogsoft supports basic and bearer token authentication.
Basic authentication example
curl -k "https://<my-username>:<my-api-key>@api.moogsoft.ai/v1/integrations/metrics" \
-H "Content-Type: application/json" \
-d '{ "metric": "your-metric", "data": 10, "source": "www.your-source.com", "key": "dev", "tags": { "key": "value" }, "utc_offset": "GMT-07:00"}'
Bearer token authentication example
curl -k "https://api.moogsoft.ai/v1/integrations/metrics"\
-H "Content-Type: application/json"
-H 'apiKey: <my-api-key>'
-d '{ "metric": "your-metric", "data": 10, "source": "www.your-source.com", "key": "dev", "tags": { "key": "value" }, "utc_offset": "GMT-07:00"}'