Get an event

Gets the data for a single event

HTTP request

GET /v1/apps/{appId}/events/{eventType}/{eventId}

Security

Type Description
API key

Pass the API key via an X-Api-Key custom header or an api_key query parameter. [More info about authorization]

Basic Auth

Use the API key as either username or password with normal HTTP basic auth [More info about authorization]

Azure AAD Auth

Pass the AAD auth token in the 'Authorization' header. [More info about authorization]

URL parameters

Name Value Description
appId string

ID of the application. This is Application ID from the API Access settings blade in the Azure portal.

eventType string

The type of events to query; either a standard event type (traces, customEvents, pageViews, requests, dependencies, exceptions, availabilityResults) or $all to query across all event types.

eventId string

ID of event.

Query parameters

Name Value Description
timespan string (interval)

Optional. The timespan over which to retrieve events. This is an ISO8601 time period value. This timespan is applied in addition to any that are specified in the Odata expression.

Responses

Status Code Description
200 Successful response
400 Bad Request. The request was invalid; can be caused by a bad API request body, or errors in the Analytics query in the request
401 Unauthorized. No authentication was provided; authenticate and re-issue the API call
402 Payment required (the app is not in a required pricing tier)
403 Forbidden. Authentication was provided, but the caller did not have the necessary permissions
404 Invalid appId or eventId
429 Too many requests
500 Internal Server Error. The service experienced an unexpected error while processing the request
502 Bad Gateway. A downstream service dependency experienced an internal service error while processing the request
503 Service unavailable
504 Gateway Timeout. A downstream service dependency timed out while processing the request

Examples


Gets a specific event by type and id.

Parameters:

{
  "appId": "DEMO_APP",
  "eventType": "traces",
  "eventId": "dc76df01-0141-11e8-9894-e3e7c1eeabad"
}

Response:

{
  "body": {
    "@odata.context": "https://api.applicationinsights.io/v1/apps/DEMO_APP/events/traces/$metadata#traces",
    "value": [
      {
        "id": "dc76df01-0141-11e8-9894-e3e7c1eeabad",
        "type": "trace",
        "count": 1,
        "timestamp": "2018-01-24T20:04:32.243Z",
        "customDimensions": null,
        "customMeasurements": null,
        "operation": {
          "name": "GET /FabrikamProd/Employees/Create",
          "id": "HPFy1bNlyQ0=",
          "parentId": "|HPFy1bNlyQ0=.c642e1f1_",
          "syntheticSource": "Application Insights Availability Monitoring"
        },
        "session": {
          "id": "97915c9e-2ba3-4258-82f5-84233de21127"
        },
        "user": {
          "id": "emea-ru-msa-edge_97915c9e-2ba3-4258-82f5-84233de21127",
          "accountId": null,
          "authenticatedId": null
        },
        "cloud": {
          "roleName": null,
          "roleInstance": "AIConnect2"
        },
        "ai": {
          "iKey": "5a2e4e0c-e136-4a15-9824-90ba859b0a89",
          "appName": "fabrikamprod",
          "appId": "cf58dcfd-0683-487c-bc84-048789bca8e5",
          "sdkVersion": "sd:2.4.1-442"
        },
        "trace": {
          "message": "New Request Received",
          "severityLevel": 0
        },
        "application": {
          "version": null
        },
        "client": {
          "model": null,
          "os": null,
          "type": "PC",
          "browser": null,
          "ip": "51.140.105.0",
          "city": "London",
          "stateOrProvince": "England",
          "countryOrRegion": "United Kingdom"
        }
      }
    ]
  }
}