You could try their API - well documented
Events[
^]
Assuming your event data is in JSON format and looks like
{
"aggregation_key": "string",
"alert_type": "info",
"date_happened": "integer",
"device_name": [],
"host": "string",
"priority": "normal",
"related_event_id": "integer",
"source_type_name": "string",
"tags": [
"environment:test"
],
"text": "Oh boy!",
"title": "Did you hear the news today?"
}
You could use RestSharp
RestSharp[
^] , or simpler code like
var httpWebRequest = (HttpWebRequest)WebRequest.Create("https://api.datadoghq.com/api/v1/events");
httpWebRequest.ContentType = "application/json";
httpWebRequest.Method = "POST";
httpWebRequest.Headers["DD-API-KEY"] = "the-value";
httpWebRequest.Headers["DD-APPLICATION-KEY] = "the-value"; // or httpWebRequest.Headers.Add("DD-APPLICATION-KEY", "the-application-key-value")
// HTTPS
ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };
using (var streamWriter = new StreamWriter(httpWebRequest.GetRequestStream()))
{
string json = "{...your event data here...}";
streamWriter.Write(json);
}
var httpResponse = (HttpWebResponse)httpWebRequest.GetResponse();
using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
{
var result = streamReader.ReadToEnd();
}