---
title: Buscar incidencias de Error Tracking
description: El endpoint de búsqueda de incidencias te permite buscar programáticamente incidencias dentro de tu organización.
breadcrumbs: Documentación > API > Buscar incidencias de Error Tracking
---

> For the complete documentation index, see [llms.txt](https://dnd37xeb23o8n.cloudfront.net/stefon.simmons/docs-astro-web-10435/llms.txt).

# Buscar incidencias de Error Tracking

## v2 (latest)

| Datadog site      | API endpoint                                                           |
| ----------------- | ---------------------------------------------------------------------- |
| app.datadoghq.com | POST https://api.datadoghq.com/api/v2/error-tracking/issues/search     |
| us3.datadoghq.com | POST https://api.us3.datadoghq.com/api/v2/error-tracking/issues/search |
| us5.datadoghq.com | POST https://api.us5.datadoghq.com/api/v2/error-tracking/issues/search |
| app.datadoghq.eu  | POST https://api.datadoghq.eu/api/v2/error-tracking/issues/search      |
| ap1.datadoghq.com | POST https://api.ap1.datadoghq.com/api/v2/error-tracking/issues/search |
| ap2.datadoghq.com | POST https://api.ap2.datadoghq.com/api/v2/error-tracking/issues/search |
| uk1.datadoghq.com | POST https://api.uk1.datadoghq.com/api/v2/error-tracking/issues/search |
| app.ddog-gov.com  | POST https://api.ddog-gov.com/api/v2/error-tracking/issues/search      |
| us2.ddog-gov.com  | POST https://api.us2.ddog-gov.com/api/v2/error-tracking/issues/search  |

### Overview

El endpoint de búsqueda de incidencias te permite buscar programáticamente incidencias dentro de tu organización. Este endpoint devuelve una lista de incidencias que coinciden con una consulta de búsqueda dada, siguiendo la sintaxis de búsqueda de eventos. Los resultados de la búsqueda están limitados a un máximo de 100 incidencias por solicitud.

OAuth apps require the `error_tracking_read` authorization [scope](https://dnd37xeb23o8n.cloudfront.net/stefon.simmons/docs-astro-web-10435/es/api/latest/scopes.md#error-tracking) to access this endpoint.

### Arguments

#### Query Strings

| Field   | Type  | Description                                                                                                                                                                 |
| ------- | ----- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| include | array | Comma-separated list of relationship objects that should be included in the response. Possible values are `issue`, `issue.assignee`, `issue.case`, and `issue.team_owners`. |

### Request

#### Body Data (required)

Carga útil de la solicitud de incidencias de búsqueda.

{% tabs %}
{% tab label="Model" %}
| Parent field | Field                   | Type     | Description                                                                                                                          |
| ------------ | ----------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------ |
|              | data [*required*]       | object   | Carga útil de la solicitud de incidencia de búsqueda.                                                                                |
| data         | attributes [*required*] | object   | Object describing a search issue request.                                                                                            |
| attributes   | assignee_ids            | [string] | Filter issues by assignee IDs. Multiple values are combined with OR logic.                                                           |
| attributes   | from [*required*]       | int64    | Start date (inclusive) of the query in milliseconds since the Unix epoch.                                                            |
| attributes   | order_by                | enum     | The attribute to sort the search results by. Allowed enum values: `TOTAL_COUNT`, `FIRST_SEEN`, `IMPACTED_SESSIONS`, `PRIORITY`.      |
| attributes   | persona                 | enum     | Persona for the search. Either track(s) or persona(s) must be specified. Allowed enum values: `ALL`, `BROWSER`, `MOBILE`, `BACKEND`. |
| attributes   | query [*required*]      | string   | Search query following the event search syntax.                                                                                      |
| attributes   | states                  | [string] | Filter issues by state. Multiple values are combined with OR logic.                                                                  |
| attributes   | team_ids                | [string] | Filter issues by team IDs. Multiple values are combined with OR logic.                                                               |
| attributes   | to [*required*]         | int64    | End date (exclusive) of the query in milliseconds since the Unix epoch.                                                              |
| attributes   | track                   | enum     | Track of the events to query. Either track(s) or persona(s) must be specified. Allowed enum values: `trace`, `logs`, `rum`.          |
| data         | type [*required*]       | enum     | Type of the object. Allowed enum values: `search_request`.                                                                           |
{% /tab %}

{% tab label="Example" %}
```json
{
  "data": {
    "attributes": {
      "query": "service:orders-* AND @language:go",
      "from": 1671612804000,
      "to": 1671620004000,
      "track": "trace"
    },
    "type": "search_request"
  }
}
```
{% /tab %}
{% /tabs %}

### Response

{% tabs %}
{% tab label="200" %}
OK

{% tabs %}
{% tab label="Model" %}
Search issues response payload.

| Parent field  | Field                     | Type      | Description                                                                                                                                                                                                       |
| ------------- | ------------------------- | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|               | data                      | [object]  | Array of results matching the search query.                                                                                                                                                                       |
| data          | attributes [*required*]   | object    | Object containing the information of a search result.                                                                                                                                                             |
| attributes    | impacted_sessions         | int64     | Count of sessions impacted by the issue over the queried time window.                                                                                                                                             |
| attributes    | impacted_users            | int64     | Count of users impacted by the issue over the queried time window.                                                                                                                                                |
| attributes    | total_count               | int64     | Total count of errors that match the issue over the queried time window.                                                                                                                                          |
| data          | id [*required*]           | string    | Search result identifier (matches the nested issue's identifier).                                                                                                                                                 |
| data          | relationships             | object    | Relationships between the search result and other resources.                                                                                                                                                      |
| relationships | issue                     | object    | Relationship between the search result and the corresponding issue.                                                                                                                                               |
| issue         | data [*required*]         | object    | The issue the search result corresponds to.                                                                                                                                                                       |
| data          | id [*required*]           | string    | Issue identifier.                                                                                                                                                                                                 |
| data          | type [*required*]         | enum      | Type of the object. Allowed enum values: `issue`.                                                                                                                                                                 |
| data          | type [*required*]         | enum      | Type of the object. Allowed enum values: `error_tracking_search_result`.                                                                                                                                          |
|               | included                  | [<oneOf>] | Array of resources related to the search results.                                                                                                                                                                 |
| included      | <type=issue>              | object    | The issue matching the request.                                                                                                                                                                                   |
| <type=issue>  | attributes [*required*]   | object    | Object containing the information of an issue.                                                                                                                                                                    |
| attributes    | error_message             | string    | Error message associated with the issue.                                                                                                                                                                          |
| attributes    | error_type                | string    | Type of the error that matches the issue.                                                                                                                                                                         |
| attributes    | file_path                 | string    | Path of the file where the issue occurred.                                                                                                                                                                        |
| attributes    | first_seen                | int64     | Timestamp of the first seen error in milliseconds since the Unix epoch.                                                                                                                                           |
| attributes    | first_seen_version        | string    | The application version (for example, git commit hash) where the issue was first observed.                                                                                                                        |
| attributes    | function_name             | string    | Name of the function where the issue occurred.                                                                                                                                                                    |
| attributes    | is_crash                  | boolean   | Error is a crash.                                                                                                                                                                                                 |
| attributes    | languages                 | [string]  | Array of programming languages associated with the issue.                                                                                                                                                         |
| attributes    | last_seen                 | int64     | Timestamp of the last seen error in milliseconds since the Unix epoch.                                                                                                                                            |
| attributes    | last_seen_version         | string    | The application version (for example, git commit hash) where the issue was last observed.                                                                                                                         |
| attributes    | platform                  | enum      | Platform associated with the issue. Allowed enum values: `ANDROID`, `BACKEND`, `BROWSER`, `FLUTTER`, `IOS`, `REACT_NATIVE`, `ROKU`, `UNKNOWN`.                                                                    |
| attributes    | regression                | object    | Regression information for an issue that was previously resolved and then reopened.                                                                                                                               |
| regression    | regressed_at [*required*] | date-time | Timestamp when the issue was reopened (regressed).                                                                                                                                                                |
| regression    | regressed_at_version      | string    | Application version where the regression was observed.                                                                                                                                                            |
| regression    | resolved_at [*required*]  | date-time | Timestamp when the issue was resolved before the regression.                                                                                                                                                      |
| attributes    | service                   | string    | Service name.                                                                                                                                                                                                     |
| attributes    | state                     | enum      | State of the issue Allowed enum values: `OPEN`, `ACKNOWLEDGED`, `RESOLVED`, `IGNORED`, `EXCLUDED`.                                                                                                                |
| <type=issue>  | id [*required*]           | string    | Issue identifier.                                                                                                                                                                                                 |
| <type=issue>  | relationships             | object    | Relationship between the issue and an assignee, case and/or teams.                                                                                                                                                |
| relationships | assignee                  | object    | Relationship between the issue and assignee.                                                                                                                                                                      |
| assignee      | data [*required*]         | object    | The user the issue is assigned to.                                                                                                                                                                                |
| data          | id [*required*]           | string    | User identifier.                                                                                                                                                                                                  |
| data          | type [*required*]         | enum      | Type of the object Allowed enum values: `user`.                                                                                                                                                                   |
| relationships | case                      | object    | Relationship between the issue and case.                                                                                                                                                                          |
| case          | data [*required*]         | object    | The case the issue is attached to.                                                                                                                                                                                |
| data          | id [*required*]           | string    | Case identifier.                                                                                                                                                                                                  |
| data          | type [*required*]         | enum      | Type of the object. Allowed enum values: `case`.                                                                                                                                                                  |
| relationships | team_owners               | object    | Relationship between the issue and teams.                                                                                                                                                                         |
| team_owners   | data [*required*]         | [object]  | Array of teams that are owners of the issue.                                                                                                                                                                      |
| data          | id [*required*]           | string    | Team identifier.                                                                                                                                                                                                  |
| data          | type [*required*]         | enum      | Type of the object. Allowed enum values: `team`.                                                                                                                                                                  |
| <type=issue>  | type [*required*]         | enum      | Type of the object. Allowed enum values: `issue`.                                                                                                                                                                 |
| included      | <type=case>               | object    | The case attached to the issue.                                                                                                                                                                                   |
| <type=case>   | attributes [*required*]   | object    | Object containing the information of a case.                                                                                                                                                                      |
| attributes    | archived_at               | date-time | Timestamp of when the case was archived.                                                                                                                                                                          |
| attributes    | closed_at                 | date-time | Timestamp of when the case was closed.                                                                                                                                                                            |
| attributes    | created_at                | date-time | Timestamp of when the case was created.                                                                                                                                                                           |
| attributes    | creation_source           | string    | Source of the case creation.                                                                                                                                                                                      |
| attributes    | description               | string    | Description of the case.                                                                                                                                                                                          |
| attributes    | due_date                  | string    | Due date of the case.                                                                                                                                                                                             |
| attributes    | insights                  | [object]  | Insights of the case.                                                                                                                                                                                             |
| insights      | ref                       | string    | Reference of the insight.                                                                                                                                                                                         |
| insights      | resource_id               | string    | Insight identifier.                                                                                                                                                                                               |
| insights      | type                      | string    | Type of the insight.                                                                                                                                                                                              |
| attributes    | jira_issue                | object    | Jira issue of the case.                                                                                                                                                                                           |
| jira_issue    | error_message             | string    | Error message set when the Jira issue creation fails.                                                                                                                                                             |
| jira_issue    | result                    | object    | Contains the identifiers and URL for a successfully created Jira issue.                                                                                                                                           |
| result        | account_id                | string    | Jira account identifier.                                                                                                                                                                                          |
| result        | issue_id                  | string    | Jira issue identifier.                                                                                                                                                                                            |
| result        | issue_key                 | string    | Jira issue key.                                                                                                                                                                                                   |
| result        | issue_url                 | string    | Jira issue URL.                                                                                                                                                                                                   |
| result        | project_id                | string    | Jira project identifier.                                                                                                                                                                                          |
| result        | project_key               | string    | Jira project key.                                                                                                                                                                                                 |
| jira_issue    | status                    | string    | Creation status of the Jira issue.                                                                                                                                                                                |
| attributes    | key                       | string    | Key of the case.                                                                                                                                                                                                  |
| attributes    | linear_issue              | object    | Linear issue of the case.                                                                                                                                                                                         |
| linear_issue  | error_message             | string    | Error message set when the Linear issue creation fails.                                                                                                                                                           |
| linear_issue  | result                    | object    | Contains the identifiers and URL for a successfully created Linear issue.                                                                                                                                         |
| result        | account_id                | string    | Linear account identifier.                                                                                                                                                                                        |
| result        | issue_id                  | string    | Linear issue identifier.                                                                                                                                                                                          |
| result        | issue_key                 | string    | Linear issue key.                                                                                                                                                                                                 |
| result        | issue_url                 | string    | Linear issue URL.                                                                                                                                                                                                 |
| result        | team_id                   | string    | Linear team identifier.                                                                                                                                                                                           |
| linear_issue  | status                    | string    | Creation status of the Linear issue.                                                                                                                                                                              |
| attributes    | modified_at               | date-time | Timestamp of when the case was last modified.                                                                                                                                                                     |
| attributes    | priority                  | enum      | Work item priority Allowed enum values: `NOT_DEFINED`, `P1`, `P2`, `P3`, `P4`, `P5`. Default: `NOT_DEFINED`.                                                                                                      |
| attributes    | status                    | enum      | **DEPRECATED**: Deprecated way of representing the work item status, which only supports OPEN, IN_PROGRESS, and CLOSED statuses. Use `status_name` instead. Allowed enum values: `OPEN`, `IN_PROGRESS`, `CLOSED`. |
| attributes    | title                     | string    | Title of the case.                                                                                                                                                                                                |
| attributes    | type                      | string    | Type of the case.                                                                                                                                                                                                 |
| <type=case>   | id [*required*]           | string    | Case identifier.                                                                                                                                                                                                  |
| <type=case>   | relationships             | object    | Resources related to a case.                                                                                                                                                                                      |
| relationships | assignee                  | object    | Relationship to user.                                                                                                                                                                                             |
| assignee      | data [*required*]         | object    | Relationship to user object.                                                                                                                                                                                      |
| data          | id [*required*]           | string    | A unique identifier that represents the user.                                                                                                                                                                     |
| data          | type [*required*]         | enum      | User resource type. Allowed enum values: `user`. Default: `user`.                                                                                                                                                 |
| relationships | created_by                | object    | Relationship to user.                                                                                                                                                                                             |
| created_by    | data [*required*]         | object    | Relationship to user object.                                                                                                                                                                                      |
| data          | id [*required*]           | string    | A unique identifier that represents the user.                                                                                                                                                                     |
| data          | type [*required*]         | enum      | User resource type. Allowed enum values: `user`. Default: `user`.                                                                                                                                                 |
| relationships | modified_by               | object    | Relationship to user.                                                                                                                                                                                             |
| modified_by   | data [*required*]         | object    | Relationship to user object.                                                                                                                                                                                      |
| data          | id [*required*]           | string    | A unique identifier that represents the user.                                                                                                                                                                     |
| data          | type [*required*]         | enum      | User resource type. Allowed enum values: `user`. Default: `user`.                                                                                                                                                 |
| relationships | project                   | object    | Relationship to project.                                                                                                                                                                                          |
| project       | data [*required*]         | object    | Relationship to project object.                                                                                                                                                                                   |
| data          | id [*required*]           | string    | A unique identifier that represents the project.                                                                                                                                                                  |
| data          | type [*required*]         | enum      | Project resource type. Allowed enum values: `project`. Default: `project`.                                                                                                                                        |
| <type=case>   | type [*required*]         | enum      | Type of the object. Allowed enum values: `case`.                                                                                                                                                                  |
| included      | <type=user>               | object    | The user to whom the issue is assigned.                                                                                                                                                                           |
| <type=user>   | attributes [*required*]   | object    | Object containing the information of a user.                                                                                                                                                                      |
| attributes    | email                     | string    | Email of the user.                                                                                                                                                                                                |
| attributes    | handle                    | string    | Handle of the user.                                                                                                                                                                                               |
| attributes    | name                      | string    | Name of the user.                                                                                                                                                                                                 |
| <type=user>   | id [*required*]           | string    | User identifier.                                                                                                                                                                                                  |
| <type=user>   | type [*required*]         | enum      | Type of the object Allowed enum values: `user`.                                                                                                                                                                   |
| included      | <type=team>               | object    | A team that owns an issue.                                                                                                                                                                                        |
| <type=team>   | attributes [*required*]   | object    | Object containing the information of a team.                                                                                                                                                                      |
| attributes    | handle                    | string    | The team's identifier.                                                                                                                                                                                            |
| attributes    | name                      | string    | The name of the team.                                                                                                                                                                                             |
| attributes    | summary                   | string    | A brief summary of the team, derived from its description.                                                                                                                                                        |
| <type=team>   | id [*required*]           | string    | Team identifier.                                                                                                                                                                                                  |
| <type=team>   | type [*required*]         | enum      | Type of the object. Allowed enum values: `team`.                                                                                                                                                                  |
{% /tab %}

{% tab label="Example" %}
```json
{
  "data": [
    {
      "attributes": {
        "impacted_sessions": 12,
        "impacted_users": 4,
        "total_count": 82
      },
      "id": "c1726a66-1f64-11ee-b338-da7ad0900002",
      "relationships": {
        "issue": {
          "data": {
            "id": "c1726a66-1f64-11ee-b338-da7ad0900002",
            "type": "issue"
          }
        }
      },
      "type": "error_tracking_search_result"
    }
  ],
  "included": [
    {
      "attributes": {
        "error_message": "object of type 'NoneType' has no len()",
        "error_type": "builtins.TypeError",
        "file_path": "/django-email/conduit/apps/core/utils.py",
        "first_seen": 1671612804001,
        "first_seen_version": "aaf65cd0",
        "function_name": "filter_forbidden_tags",
        "is_crash": false,
        "languages": [
          "PYTHON",
          "GO"
        ],
        "last_seen": 1671620003100,
        "last_seen_version": "b6199f80",
        "platform": "BACKEND",
        "regression": {
          "regressed_at": "2024-01-03T08:00:00Z",
          "regressed_at_version": "v2.5.2",
          "resolved_at": "2024-01-01T10:00:00Z"
        },
        "service": "email-api-py",
        "state": "RESOLVED"
      },
      "id": "c1726a66-1f64-11ee-b338-da7ad0900002",
      "relationships": {
        "assignee": {
          "data": {
            "id": "87cb11a0-278c-440a-99fe-701223c80296",
            "type": "user"
          }
        },
        "case": {
          "data": {
            "id": "2841440d-e780-4fe2-96cd-6a8c1d194da5",
            "type": "case"
          }
        },
        "team_owners": {
          "data": [
            {
              "id": "221b0179-6447-4d03-91c3-3ca98bf60e8a",
              "type": "team"
            }
          ]
        }
      },
      "type": "issue"
    }
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="400" %}
Bad Request

{% tabs %}
{% tab label="Model" %}
API error response.

| Field               | Type     | Description       |
| ------------------- | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    "Bad Request"
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="401" %}
Unauthorized

{% tabs %}
{% tab label="Model" %}
API error response.

| Field               | Type     | Description       |
| ------------------- | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    "Bad Request"
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="403" %}
Forbidden

{% tabs %}
{% tab label="Model" %}
API error response.

| Field               | Type     | Description       |
| ------------------- | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    "Bad Request"
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="429" %}
Too many requests

{% tabs %}
{% tab label="Model" %}
API error response.

| Field               | Type     | Description       |
| ------------------- | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    "Bad Request"
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}
{% /tabs %}

### Code Example

{% tabs %}
{% tab label="Curl" %}
```bash
# Set your Datadog site and credentials
export DD_SITE="datadoghq.com" # Or us3.datadoghq.com, us5.datadoghq.com, datadoghq.eu, ap1.datadoghq.com, ap2.datadoghq.com, uk1.datadoghq.com, ddog-gov.com, us2.ddog-gov.com
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/error-tracking/issues/search" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "query": "service:orders-* AND @language:go",
      "from": 1671612804000,
      "to": 1671620004000,
      "track": "trace"
    },
    "type": "search_request"
  }
}
EOF
```
{% /tab %}

{% tab label="Go" %}
```go
// Search error tracking issues 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() {
	body := datadogV2.IssuesSearchRequest{
		Data: datadogV2.IssuesSearchRequestData{
			Attributes: datadogV2.IssuesSearchRequestDataAttributes{
				Query: "service:orders-* AND @language:go",
				From:  1671612804000,
				To:    1671620004000,
				Track: datadogV2.ISSUESSEARCHREQUESTDATAATTRIBUTESTRACK_TRACE.Ptr(),
			},
			Type: datadogV2.ISSUESSEARCHREQUESTDATATYPE_SEARCH_REQUEST,
		},
	}
	ctx := datadog.NewDefaultContext(context.Background())
	ctx = context.WithValue(ctx, datadog.ContextAccessToken, os.Getenv("DD_BEARER_TOKEN"))
	configuration := datadog.NewConfiguration()
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewErrorTrackingApi(apiClient)
	resp, r, err := api.SearchIssues(ctx, body, *datadogV2.NewSearchIssuesOptionalParameters())

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

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

#### Instructions

First [install the library and its dependencies](https://dnd37xeb23o8n.cloudfront.net/api/latest.md?code-lang=go) and then save the example to `main.go` and run following commands:

```bash
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"
```
{% /tab %}

{% tab label="Java" %}
```java
// Search error tracking issues returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.ErrorTrackingApi;
import com.datadog.api.client.v2.model.IssuesSearchRequest;
import com.datadog.api.client.v2.model.IssuesSearchRequestData;
import com.datadog.api.client.v2.model.IssuesSearchRequestDataAttributes;
import com.datadog.api.client.v2.model.IssuesSearchRequestDataAttributesTrack;
import com.datadog.api.client.v2.model.IssuesSearchRequestDataType;
import com.datadog.api.client.v2.model.IssuesSearchResponse;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN"));
    ErrorTrackingApi apiInstance = new ErrorTrackingApi(defaultClient);

    IssuesSearchRequest body =
        new IssuesSearchRequest()
            .data(
                new IssuesSearchRequestData()
                    .attributes(
                        new IssuesSearchRequestDataAttributes()
                            .query("service:orders-* AND @language:go")
                            .from(1671612804000L)
                            .to(1671620004000L)
                            .track(IssuesSearchRequestDataAttributesTrack.TRACE))
                    .type(IssuesSearchRequestDataType.SEARCH_REQUEST));

    try {
      IssuesSearchResponse result = apiInstance.searchIssues(body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling ErrorTrackingApi#searchIssues");
      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://dnd37xeb23o8n.cloudfront.net/api/latest.md?code-lang=java) and then save the example to `Example.java` and run following commands:

```bash
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"
```
{% /tab %}

{% tab label="Python" %}
```python
"""
Search error tracking issues returns "OK" response
"""

from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.error_tracking_api import ErrorTrackingApi
from datadog_api_client.v2.model.issues_search_request import IssuesSearchRequest
from datadog_api_client.v2.model.issues_search_request_data import IssuesSearchRequestData
from datadog_api_client.v2.model.issues_search_request_data_attributes import IssuesSearchRequestDataAttributes
from datadog_api_client.v2.model.issues_search_request_data_attributes_track import (
    IssuesSearchRequestDataAttributesTrack,
)
from datadog_api_client.v2.model.issues_search_request_data_type import IssuesSearchRequestDataType

body = IssuesSearchRequest(
    data=IssuesSearchRequestData(
        attributes=IssuesSearchRequestDataAttributes(
            query="service:orders-* AND @language:go",
            _from=1671612804000,
            to=1671620004000,
            track=IssuesSearchRequestDataAttributesTrack.TRACE,
        ),
        type=IssuesSearchRequestDataType.SEARCH_REQUEST,
    ),
)

configuration = Configuration()
configuration.access_token = environ["DD_BEARER_TOKEN"]
with ApiClient(configuration) as api_client:
    api_instance = ErrorTrackingApi(api_client)
    response = api_instance.search_issues(body=body)

    print(response)
```

#### Instructions

First [install the library and its dependencies](https://dnd37xeb23o8n.cloudfront.net/api/latest.md?code-lang=python) and then save the example to `example.py` and run following commands:

```bash
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"
```
{% /tab %}

{% tab label="Ruby" %}
```ruby
# Search error tracking issues returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
  config.access_token = ENV["DD_BEARER_TOKEN"]
end
api_instance = DatadogAPIClient::V2::ErrorTrackingAPI.new

body = DatadogAPIClient::V2::IssuesSearchRequest.new({
  data: DatadogAPIClient::V2::IssuesSearchRequestData.new({
    attributes: DatadogAPIClient::V2::IssuesSearchRequestDataAttributes.new({
      query: "service:orders-* AND @language:go",
      from: 1671612804000,
      to: 1671620004000,
      track: DatadogAPIClient::V2::IssuesSearchRequestDataAttributesTrack::TRACE,
    }),
    type: DatadogAPIClient::V2::IssuesSearchRequestDataType::SEARCH_REQUEST,
  }),
})
p api_instance.search_issues(body)
```

#### Instructions

First [install the library and its dependencies](https://dnd37xeb23o8n.cloudfront.net/api/latest.md?code-lang=ruby) and then save the example to `example.rb` and run following commands:

```bash
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"
```
{% /tab %}

{% tab label="Rust" %}
```rust
// Search error tracking issues returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_error_tracking::ErrorTrackingAPI;
use datadog_api_client::datadogV2::api_error_tracking::SearchIssuesOptionalParams;
use datadog_api_client::datadogV2::model::IssuesSearchRequest;
use datadog_api_client::datadogV2::model::IssuesSearchRequestData;
use datadog_api_client::datadogV2::model::IssuesSearchRequestDataAttributes;
use datadog_api_client::datadogV2::model::IssuesSearchRequestDataAttributesTrack;
use datadog_api_client::datadogV2::model::IssuesSearchRequestDataType;

#[tokio::main]
async fn main() {
    let body = IssuesSearchRequest::new(IssuesSearchRequestData::new(
        IssuesSearchRequestDataAttributes::new(
            1671612804000,
            "service:orders-* AND @language:go".to_string(),
            1671620004000,
        )
        .track(IssuesSearchRequestDataAttributesTrack::TRACE),
        IssuesSearchRequestDataType::SEARCH_REQUEST,
    ));
    let configuration = datadog::Configuration::new();
    let api = ErrorTrackingAPI::with_config(configuration);
    let resp = api
        .search_issues(body, SearchIssuesOptionalParams::default())
        .await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
```

#### Instructions

First [install the library and its dependencies](https://dnd37xeb23o8n.cloudfront.net/api/latest.md?code-lang=rust) and then save the example to `src/main.rs` and run following commands:

```bash
DD_SITE="datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
```
{% /tab %}

{% tab label="TypeScript" %}
```typescript
/**
 * Search error tracking issues returns "OK" response
 */

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

const configuration = client.createConfiguration({
  authMethods: {
    AuthZ: {
      accessToken: process.env.DD_BEARER_TOKEN as string,
    },
  },
});
const apiInstance = new v2.ErrorTrackingApi(configuration);

const params: v2.ErrorTrackingApiSearchIssuesRequest = {
  body: {
    data: {
      attributes: {
        query: "service:orders-* AND @language:go",
        from: 1671612804000,
        to: 1671620004000,
        track: "trace",
      },
      type: "search_request",
    },
  },
};

apiInstance
  .searchIssues(params)
  .then((data: v2.IssuesSearchResponse) => {
    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://dnd37xeb23o8n.cloudfront.net/api/latest.md?code-lang=typescript) and then save the example to `example.ts` and run following commands:

```bash
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"
```
{% /tab %}
{% /tabs %}
