---
title: Get an event
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: Docs > API Reference > Events
---

# Get an event{% #get-an-event %}
Copy pageCopied
{% tab title="v2" %}

| Datadog site      | API endpoint                                               |
| ----------------- | ---------------------------------------------------------- |
| ap1.datadoghq.com | GET https://api.ap1.datadoghq.com/api/v2/events/{event_id} |
| ap2.datadoghq.com | GET https://api.ap2.datadoghq.com/api/v2/events/{event_id} |
| app.datadoghq.eu  | GET https://api.datadoghq.eu/api/v2/events/{event_id}      |
| app.ddog-gov.com  | GET https://api.ddog-gov.com/api/v2/events/{event_id}      |
| us2.ddog-gov.com  | GET https://api.us2.ddog-gov.com/api/v2/events/{event_id}  |
| app.datadoghq.com | GET https://api.datadoghq.com/api/v2/events/{event_id}     |
| us3.datadoghq.com | GET https://api.us3.datadoghq.com/api/v2/events/{event_id} |
| us5.datadoghq.com | GET https://api.us5.datadoghq.com/api/v2/events/{event_id} |

### Overview

Get the details of an event by `event_id`. This endpoint requires the `events_read` permission.

OAuth apps require the `events_read` authorization [scope](https://docs.datadoghq.com/api/latest/scopes.md#events) to access this endpoint.



### Arguments

#### Path Parameters

| Name                       | Type   | Description           |
| -------------------------- | ------ | --------------------- |
| event_id [*required*] | string | The UID of the event. |

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
Get an event response.

| Parent field       | Field              | Type          | Description                                                                                                      |
| ------------------ | ------------------ | ------------- | ---------------------------------------------------------------------------------------------------------------- |
|                    | data               | object        | An event object.                                                                                                 |
| data               | attributes         | object        | Event attributes.                                                                                                |
| attributes         | attributes         |  <oneOf> | JSON object for category-specific attributes.                                                                    |
| attributes         | Option 1           | object        | Change event attributes.                                                                                         |
| Option 1           | aggregation_key    | string        | Aggregation key of the event.                                                                                    |
| Option 1           | author             | object        | The entity that made the change.                                                                                 |
| author             | name               | string        | The name of the user or system that made the change.                                                             |
| author             | type               | enum          | The type of the author. Allowed enum values: `user,system,api,automation`                                        |
| Option 1           | change_metadata    | object        | JSON object of change metadata.                                                                                  |
| Option 1           | changed_resource   | object        | A uniquely identified resource.                                                                                  |
| changed_resource   | name               | string        | The name of the changed resource.                                                                                |
| changed_resource   | type               | enum          | The type of the changed resource. Allowed enum values: `feature_flag,configuration`                              |
| Option 1           | evt                | object        | JSON object of event system attributes.                                                                          |
| evt                | category           | enum          | Event category identifying the type of event. Allowed enum values: `change,alert`                                |
| evt                | id                 | string        | Event identifier. This field is deprecated and will be removed in a future version. Use the `uid` field instead. |
| evt                | integration_id     | enum          | Integration ID sourced from integration manifests. Allowed enum values: `custom-events`                          |
| evt                | source_id          | int64         | The source type ID of the event.                                                                                 |
| evt                | uid                | string        | A unique identifier for the event. You can use this identifier to query or reference the event.                  |
| Option 1           | impacted_resources | [object]      | A list of resources impacted by this change.                                                                     |
| impacted_resources | name               | string        | The name of the impacted resource.                                                                               |
| impacted_resources | type               | enum          | The type of the impacted resource. Allowed enum values: `service`                                                |
| Option 1           | new_value          | object        | The new state of the changed resource.                                                                           |
| Option 1           | prev_value         | object        | The previous state of the changed resource.                                                                      |
| Option 1           | service            | string        | Service that triggered the event.                                                                                |
| Option 1           | timestamp          | int64         | POSIX timestamp of the event.                                                                                    |
| Option 1           | title              | string        | The title of the event.                                                                                          |
| attributes         | Option 2           | object        | Alert event attributes.                                                                                          |
| Option 2           | aggregation_key    | string        | Aggregation key of the event.                                                                                    |
| Option 2           | custom             | object        | JSON object of custom attributes.                                                                                |
| Option 2           | evt                | object        | JSON object of event system attributes.                                                                          |
| evt                | category           | enum          | Event category identifying the type of event. Allowed enum values: `change,alert`                                |
| evt                | id                 | string        | Event identifier. This field is deprecated and will be removed in a future version. Use the `uid` field instead. |
| evt                | integration_id     | enum          | Integration ID sourced from integration manifests. Allowed enum values: `custom-events`                          |
| evt                | source_id          | int64         | The source type ID of the event.                                                                                 |
| evt                | uid                | string        | A unique identifier for the event. You can use this identifier to query or reference the event.                  |
| Option 2           | links              | [object]      | The links related to the event.                                                                                  |
| links              | category           | enum          | The category of the link. Allowed enum values: `runbook,documentation,dashboard`                                 |
| links              | title              | string        | The display text of the link.                                                                                    |
| links              | url                | string        | The URL of the link.                                                                                             |
| Option 2           | priority           | enum          | The priority of the alert. Allowed enum values: `1,2,3,4,5`                                                      |
| Option 2           | service            | string        | Service that triggered the event.                                                                                |
| Option 2           | status             | enum          | The status of the alert. Allowed enum values: `warn,error,ok`                                                    |
| Option 2           | timestamp          | int64         | POSIX timestamp of the event.                                                                                    |
| Option 2           | title              | string        | The title of the event.                                                                                          |
| attributes         | message            | string        | Free-form text associated with the event.                                                                        |
| attributes         | tags               | [string]      | A list of tags associated with the event.                                                                        |
| attributes         | timestamp          | string        | Timestamp when the event occurred.                                                                               |
| data               | id                 | string        | The event's ID.                                                                                                  |
| data               | type               | string        | Entity type.                                                                                                     |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "attributes": {
        "aggregation_key": "aggregation-key",
        "author": {
          "name": "example@datadog.com",
          "type": "user"
        },
        "change_metadata": {
          "dd": {
            "team": "datadog_team",
            "user_email": "datadog@datadog.com",
            "user_id": "datadog_user_id",
            "user_name": "datadog_username"
          }
        },
        "changed_resource": {
          "name": "string",
          "type": "feature_flag"
        },
        "evt": {
          "category": "change",
          "id": "string",
          "integration_id": "custom-events",
          "source_id": "integer",
          "uid": "string"
        },
        "impacted_resources": [
          {
            "name": "service-name",
            "type": "service"
          }
        ],
        "new_value": {
          "enabled": true,
          "percentage": "50%",
          "rule": {
            "datacenter": "devcycle.us1.prod"
          }
        },
        "prev_value": {
          "enabled": true,
          "percentage": "10%",
          "rule": {
            "datacenter": "devcycle.us1.prod"
          }
        },
        "service": "service-name",
        "timestamp": 175019386627,
        "title": "The event title"
      },
      "message": "The event message",
      "tags": [
        "env:api_client_test"
      ],
      "timestamp": "2017-01-15T01:30:15.010000Z"
    },
    "id": "",
    "type": "event"
  }
}
```

{% /tab %}

{% /tab %}

{% tab title="400" %}
Bad Request
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="401" %}
Unauthorized
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="403" %}
Forbidden
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="404" %}
Not Found
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="429" %}
Too many requests
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

### Code Example

##### 
                  \# Path parameters export event_id="CHANGE_ME" \# Curl command curl -X GET "https://api.datadoghq.com/api/v2/events/${event_id}" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" 
                
##### 

```python
"""
Get an event returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.events_api import EventsApi

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = EventsApi(api_client)
    response = api_instance.get_event(
        event_id="AZeF-nTCAABzkAgGXzYPtgAA",
    )

    print(response)
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=python) and then save the example to `example.py` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"
##### 

```ruby
# Get an event returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::EventsAPI.new
p api_instance.get_event("AZeF-nTCAABzkAgGXzYPtgAA")
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=ruby) and then save the example to `example.rb` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"
##### 

```go
// Get an event returns "OK" response

package main

import (
	"context"
	"encoding/json"
	"fmt"
	"os"

	"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
	"github.com/DataDog/datadog-api-client-go/v2/api/datadogV2"
)

func main() {
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewEventsApi(apiClient)
	resp, r, err := api.GetEvent(ctx, "AZeF-nTCAABzkAgGXzYPtgAA")

	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `EventsApi.GetEvent`: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `EventsApi.GetEvent`:\n%s\n", responseContent)
}
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=go) and then save the example to `main.go` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" go run "main.go"
##### 

```java
// Get an event returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.EventsApi;
import com.datadog.api.client.v2.model.V2EventResponse;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    EventsApi apiInstance = new EventsApi(defaultClient);

    try {
      V2EventResponse result = apiInstance.getEvent("AZeF-nTCAABzkAgGXzYPtgAA");
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling EventsApi#getEvent");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=java) and then save the example to `Example.java` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
##### 

```rust
// Get an event returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_events::EventsAPI;

#[tokio::main]
async fn main() {
    let configuration = datadog::Configuration::new();
    let api = EventsAPI::with_config(configuration);
    let resp = api.get_event("AZeF-nTCAABzkAgGXzYPtgAA".to_string()).await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=rust) and then save the example to `src/main.rs` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
##### 

```typescript
/**
 * Get an event returns "OK" response
 */

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
const apiInstance = new v2.EventsApi(configuration);

const params: v2.EventsApiGetEventRequest = {
  eventId: "AZeF-nTCAABzkAgGXzYPtgAA",
};

apiInstance
  .getEvent(params)
  .then((data: v2.V2EventResponse) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  })
  .catch((error: any) => console.error(error));
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=typescript) and then save the example to `example.ts` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"
{% /tab %}

{% tab title="v1" %}

| Datadog site      | API endpoint                                               |
| ----------------- | ---------------------------------------------------------- |
| ap1.datadoghq.com | GET https://api.ap1.datadoghq.com/api/v1/events/{event_id} |
| ap2.datadoghq.com | GET https://api.ap2.datadoghq.com/api/v1/events/{event_id} |
| app.datadoghq.eu  | GET https://api.datadoghq.eu/api/v1/events/{event_id}      |
| app.ddog-gov.com  | GET https://api.ddog-gov.com/api/v1/events/{event_id}      |
| us2.ddog-gov.com  | GET https://api.us2.ddog-gov.com/api/v1/events/{event_id}  |
| app.datadoghq.com | GET https://api.datadoghq.com/api/v1/events/{event_id}     |
| us3.datadoghq.com | GET https://api.us3.datadoghq.com/api/v1/events/{event_id} |
| us5.datadoghq.com | GET https://api.us5.datadoghq.com/api/v1/events/{event_id} |

### Overview



This endpoint allows you to query for event details.

**Note**: If the event you're querying contains markdown formatting of any kind, you may see characters such as `%`,`\`,`n` in your output.
This endpoint requires the `events_read` permission.
OAuth apps require the `events_read` authorization [scope](https://docs.datadoghq.com/api/latest/scopes.md#events) to access this endpoint.



### Arguments

#### Path Parameters

| Name                       | Type    | Description          |
| -------------------------- | ------- | -------------------- |
| event_id [*required*] | integer | The ID of the event. |

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
Object containing an event response.

| Parent field | Field            | Type     | Description                                                                                                                                                                                                                                                                    |
| ------------ | ---------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|              | event            | object   | Object representing an event.                                                                                                                                                                                                                                                  |
| event        | alert_type       | enum     | If an alert event is enabled, set its type. For example, `error`, `warning`, `info`, `success`, `user_update`, `recommendation`, and `snapshot`. Allowed enum values: `error,warning,info,success,user_update,recommendation,snapshot`                                         |
| event        | date_happened    | int64    | POSIX timestamp of the event. Must be sent as an integer (that is no quotes). Limited to events up to 18 hours in the past and two hours in the future.                                                                                                                        |
| event        | device_name      | string   | A device name.                                                                                                                                                                                                                                                                 |
| event        | host             | string   | Host name to associate with the event. Any tags associated with the host are also applied to this event.                                                                                                                                                                       |
| event        | id               | int64    | Integer ID of the event.                                                                                                                                                                                                                                                       |
| event        | id_str           | string   | Handling IDs as large 64-bit numbers can cause loss of accuracy issues with some programming languages. Instead, use the string representation of the Event ID to avoid losing accuracy.                                                                                       |
| event        | payload          | string   | Payload of the event.                                                                                                                                                                                                                                                          |
| event        | priority         | enum     | The priority of the event. For example, `normal` or `low`. Allowed enum values: `normal,low`                                                                                                                                                                                   |
| event        | source_type_name | string   | The type of event being posted. Option examples include nagios, hudson, jenkins, my_apps, chef, puppet, git, bitbucket, etc. The list of standard source attribute values [available here](https://docs.datadoghq.com/integrations/faq/list-of-api-source-attribute-value.md). |
| event        | tags             | [string] | A list of tags to apply to the event.                                                                                                                                                                                                                                          |
| event        | text             | string   | The body of the event. Limited to 4000 characters. The text supports markdown. To use markdown in the event text, start the text block with `%%% \n` and end the text block with `\n %%%`. Use `msg_text` with the Datadog Ruby library.                                       |
| event        | title            | string   | The event title.                                                                                                                                                                                                                                                               |
| event        | url              | string   | URL of the event.                                                                                                                                                                                                                                                              |
|              | status           | string   | A status.                                                                                                                                                                                                                                                                      |

{% /tab %}

{% tab title="Example" %}

```json
{
  "event": {
    "alert_type": "info",
    "date_happened": "integer",
    "device_name": "string",
    "host": "string",
    "id": "integer",
    "id_str": "string",
    "payload": "{}",
    "priority": "normal",
    "source_type_name": "string",
    "tags": [
      "environment:test"
    ],
    "text": "Oh boy!",
    "title": "Did you hear the news today?",
    "url": "string"
  },
  "status": "string"
}
```

{% /tab %}

{% /tab %}

{% tab title="403" %}
Authentication Error
{% tab title="Model" %}
Error response object.

| Field                    | Type     | Description                          |
| ------------------------ | -------- | ------------------------------------ |
| errors [*required*] | [string] | Array of errors returned by the API. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="404" %}
Item Not Found
{% tab title="Model" %}
Error response object.

| Field                    | Type     | Description                          |
| ------------------------ | -------- | ------------------------------------ |
| errors [*required*] | [string] | Array of errors returned by the API. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="429" %}
Too many requests
{% tab title="Model" %}
Error response object.

| Field                    | Type     | Description                          |
| ------------------------ | -------- | ------------------------------------ |
| errors [*required*] | [string] | Array of errors returned by the API. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

### Code Example

##### 
                  \# Path parameters export event_id="CHANGE_ME" \# Curl command curl -X GET "https://api.datadoghq.com/api/v1/events/${event_id}" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" 
                
##### 

```python
"""
Get an event returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v1.api.events_api import EventsApi

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = EventsApi(api_client)
    response = api_instance.get_event(
        event_id=9223372036854775807,
    )

    print(response)
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=python) and then save the example to `example.py` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"
##### 

```ruby
# Get an event returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V1::EventsAPI.new
p api_instance.get_event(9223372036854775807)
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=ruby) and then save the example to `example.rb` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"
##### 

```ruby
require 'rubygems'
require 'dogapi'

api_key = '<DATADOG_API_KEY>'
app_key = '<DATADOG_APPLICATION_KEY>'

dog = Dogapi::Client.new(api_key, app_key)

event_id = '1375909614428331251'
dog.get_event(event_id)
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=ruby-legacy) and then save the example to `example.rb` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"
##### 

```go
// Get an event returns "OK" response

package main

import (
	"context"
	"encoding/json"
	"fmt"
	"os"

	"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
	"github.com/DataDog/datadog-api-client-go/v2/api/datadogV1"
)

func main() {
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV1.NewEventsApi(apiClient)
	resp, r, err := api.GetEvent(ctx, 9223372036854775807)

	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `EventsApi.GetEvent`: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `EventsApi.GetEvent`:\n%s\n", responseContent)
}
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=go) and then save the example to `main.go` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" go run "main.go"
##### 

```java
// Get an event returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v1.api.EventsApi;
import com.datadog.api.client.v1.model.EventResponse;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    EventsApi apiInstance = new EventsApi(defaultClient);

    try {
      EventResponse result = apiInstance.getEvent(9223372036854775807L);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling EventsApi#getEvent");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=java) and then save the example to `Example.java` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
##### 

```python
from datadog import initialize, api

options = {
    'api_key': '<DATADOG_API_KEY>',
    'app_key': '<DATADOG_APPLICATION_KEY>'
}

initialize(**options)

api.Event.get(2603387619536318140)
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=python-legacy) and then save the example to `example.py` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python "example.py"
##### 

```rust
// Get an event returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV1::api_events::EventsAPI;

#[tokio::main]
async fn main() {
    let configuration = datadog::Configuration::new();
    let api = EventsAPI::with_config(configuration);
    let resp = api.get_event(9223372036854775807).await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=rust) and then save the example to `src/main.rs` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
##### 

```typescript
/**
 * Get an event returns "OK" response
 */

import { client, v1 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
const apiInstance = new v1.EventsApi(configuration);

const params: v1.EventsApiGetEventRequest = {
  eventId: 9223372036854775807,
};

apiInstance
  .getEvent(params)
  .then((data: v1.EventResponse) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  })
  .catch((error: any) => console.error(error));
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=typescript) and then save the example to `example.ts` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"
{% /tab %}
