分析イベント API
Splunk AppDynamics の分析では、分析データをさまざまな種類のソース(エージェントでインストゥルメント化された Java アプリケーション、.NET アプリケーション、ブラウザアプリケーションなど)から収集するために組み込みサポートを提供します。分析イベント API は、カスタムのデータソースとイベントタイプで組み込みの分析データソースを補完します。
About the Analytics Events API
In Analytics, an event encapsulates a unit of analytics data. In APM, for example, each event corresponds to a method or service invocation, whether it be an entry point service or downstream service.
With the Analytics API, you define the structure of your own custom event in the data store, capture the event records as they occur in your custom source, and send them to the Events Service, the data store for Analytics. Once your data is in the Events Store, users can query your data through the Controller UI or the Analytics Events API.
Analytics Events API uses a shared key to authenticate clients to the Events Service. As a Controller or Analytics Administrator, you can generate API keys from the Controller UI. See Manage API Keys.
Addressing the Events Service Data Store
Unlike most Splunk AppDynamics REST APIs, which are presented at the Controller, you access the Analytics Events API by addressing the Events Service instance in the Splunk AppDynamics platform.
You address the Events Service at one of the following URLs:
You can get the Analytics Domain URLs from the SaaS Domains and IP Ranges page.
For an on-premises Events Service, address the Events Service instance host (or more likely, the virtual IP presented by a load balancer for the Events Service cluster). Use the primary default listening port for the Events Service, 9080.
Calls to the Analytics Events API need to specify the <global_account_name> or the <eum_account_name>for the Controller account being address, and the <api_key> generated by the administrator for this client. The API expects the values as headers, property-value pairs that are separated by a colon. As cURL arguments, for example, the values would be passed with curl through the `-H` or `--header option` as follows:
-H"X-Events-API-AccountName:<global_account_name> OR <eum_account_name>" -H"X-Events-API-Key:<api_key>"
You can get the global account name to use from the License page in the Controller UI. The API keys are described in Manage API Keys.
The content type, also as a cURL argument, is:
-H"Content-type: application/vnd.appd.events+json;v=2"
Splunk AppDynamics strongly recommends the use of SSL/HTTPS to access the API. Otherwise, the API key is sent in plain text.
Data Format
The Analytics Events API takes events as JSON-formatted name-value pair data.
Before sending data that conforms to a custom events schema, you need to define the data structure for the custom schema. The Events Service matches incoming events data to the appropriate schema.
Supported Data Types
- Boolean
- Date – Supported time formats include:
- ISO 8601 format:
yyyy-MM-dd'T'HH:mm:ss.SSSZZ. - UNIX epoch date format: A 13-digit number representing the number of seconds/milliseconds since UNIX epoch time (Jan 1, 1970). For example, (GMT): Mon, 17 Apr 2017 23:46:22 GMT would be 1492472782000.
- ISO 8601 format:
- Float
- Integer
- String
Naming Restrictions
Custom event names and field names must conform to the following:
- Contain only a-z, A-Z, _ (underscore), 0-9.
- Names can not start with a number.
Timestamp Fields
Two implicit timestamp fields are automatically added to custom schemas:
eventTimestamppickupTimestamp
The eventTimestamp field represents the time an event occurred. An API client can specify a value for the timestamp field when it creates an event. If it does not, the Analytics Events API uses the same value for eventTimestamp as it uses for another implicit field, pickupTimestamp.The pickupTimestamp field, which is always populated by the Events Service, represents the time the event was received by the Events Service.
When configuring a milestone in Business Journeys, you need to supply a date in the eventTimestamp field in order for the event to register. In order to use Custom Events to define Business Journey, the custom events should send the eventTimestamp field. If not, the Business Journeys will not work.
Splunk AppDynamics uses
You can express all timestamp fields using ISO 8601 or UNIX epoch time (64-bit milliseconds) format.
Example API Call Flow
The following steps take you through an on-premises API call workflow for using the Analytics Events API. The steps show cURL examples for creating a schema, publishing an event to that schema, and then querying the event.
<events_service_endpoint>:9080) to your SaaS URL.
-
Define the schema by associating field names with data types. For example, the following defines a Purchase event type:
JSONcurl -X POST "<events_service_endpoint>:9080/events/schema/myProducts" -H"X-Events-API-AccountName:customer1_1234-567a-bccc-123" -H"X-Events-API-Key:a123b456-c789-1d23-e456-nnn" -H"Content-type: application/vnd.appd.events+json;v=2" -d '{"schema" : { "id": "string", "productBrand": "string", "userRating": "integer", "price": "float", "productName": "string", "description": "string" } }' -
Publish an event based on the schema you created:
JSONcurl -X POST "<events_service_endpoint>:9080/events/publish/myProducts" -H"X-Events-API-AccountName:customer1_1234-567a-bccc-123" -H"X-Events-API-Key:a123b456-c789-1d23-e456-nnn" -H"Content-type: application/vnd.appd.events+json;v=2" -d '[{"id": "5653b879ab33a","productBrand": "ACME","userRating": 3,"price": 2006.41,"productName": "Watch","description": "new watch"},{"id": "5653b879700","productBrand": "Widget","userRating": 1,"price": 3800.13,"productName": "Watch","description": "2015 watch"}]' -
Query the event data:
CODEcurl -X POST "http://<events_service_endpoint>:9080/events/query" -H"X-Events-API-AccountName:customer1_7xxx-467a-bccc-xxx" -H"X-Events-API-Key:a123b456-c789-1d23-e456-nnn" -H"Content-type: application/vnd.appd.events+text;v=2" -d 'SELECT * FROM myProducts'
If including fields with ADQL keywords, enclose the keywords in single quotes. These keywords include, for example, between, in, select, and others.
For a single query request, use this content type:
-H"Content-type: application/vnd.appd.events+text;v=2"
In a multi-query request, the queries are passed as JSON body text. In this case, use the following content type header:
-H"Content-type: application/vnd.appd.events+json;v=2"
カスタムイベントの取り込み制限
コントローラによるカスタムイベントの取り込みには、次の制限があります。
- フィールド:イベントタイプごとに最大 255
- 文字列属性:最大長 4 KB
- バッチ総数:コールあたり 10,000 イベント
- バッチ合計サイズ:コールあたり最大 5 MB
- アカウントの最大カスタムイベントスキーマ数:20
カスタムイベント制限の追加
イベントサービスでは、デフォルトで最大 1,500 個のカスタムフィールドを作成できます。カスタムフィールドの容量が 80%(1,200 フィールド)に達すると、次のインデックスロールオーバー時に最大フィールド制限が 500 フィールド増加します。
たとえば、1,400 カスタムフィールドに到達すると、最大フィールド制限が 1,500 フィールドから 2,000 フィールドに増加します。その後 1,800 カスタムフィールドに到達すると、最大制限数が 2,500 フィールドに増加します。
作成できるカスタムフィールドの上限は 3,000 個です。最大フィールド数に到達したり、最大フィールド数を超えたりすると、遅延や停止が発生する可能性があります。
イベントのパブリッシュ
Publish Events API コールは、イベントの配列を取得し、イベントサービスストレージに格納します。データは既存のスキーマに準拠している必要があります。1 つの要求を複数のイベントタイプにパブリッシュすることはできません。
イベントデータがイベントスキーマと一致しない場合、イベントサービスは両者が一致するためのベストエフォート型の試みを行い、それでも失敗した場合は「400 Bad Request」を返します。
形式
- SaaS
-
JSON
POST https://analytics.api.example.com/events/publish/{schemaName} - オンプレミス
-
JSON
POST http://<events_service_endpoint>:9080/events/publish/{schemaName}
クエリパラメータ
N/A
パスパラメータ
| Name | 説明 |
|---|---|
|
accountId |
アカウント ID |
| schemaName |
イベントスキーマ名 |
ヘッダー
| Name | 説明 |
|---|---|
X-Events-API-AccountName |
[License] ページに表示されるグローバルアカウント名または EUM アカウント名。 |
X-Events-API-Key |
分析 API キー。「API キーの管理」を参照してください。 |
Content-Type |
要求本文の Content-Type。デフォルトは、リソース表現(v=2)のバージョンでもある application/vnd.appd.events+json;v=2 です。 |
SaaS による Publish の例
- リクエスト
-
JSON
POST https://analytics.api.example.com/events/publish/{schemaName} X-Events-API-AccountName:<global_account_name> OR <eum_account_name> X-Events-API-Key:<api_key> Content-Type: application/vnd.appd.events+json;v=2 Accept: application/vnd.appd.events+json;v=2 [ { "id": "5653b879ab33a", "productBrand": "ACME", "userRating": 3, "price": 2006.41, "productName": "Watch", "description": "new watch" }, { "id": "5653b879700", "productBrand": "Widget", "userRating": 1, "price": 3800.13, "productName": "Watch", "description": "2015 watch" } ] - レスポンス
-
CODE
HTTP/1.1 202 ACCEPTED
エラー コード
| エラーコード | 説明 |
|---|---|
| 400 | 指定した要求は無効でした。 |
| 401 | 認証ヘッダーで指定した認証情報は無効でした。 |
| 404 | このアカウントのイベントタイプが見つかりませんでした。 |
| 406 | Accept ヘッダーは application/vnd.appd.events+json;v=2 ではありませんでした。 |
| 413 | 要求本文のサイズが最大許容値を超えています。 |
| 415 | Content-Type ヘッダーは application/vnd.appd.events+json;v=2 ではありませんでした。 |
| 429 | 要求が多すぎます。account または event が制限に達した場合に返されます。 |
イベントスキーマを作成する
独自のイベントスキーマを作成するには、この API を使用します。このスキーマで、フィールドとタイプごとにイベントタイプの全体的な構造を定義します。
この API は、アップロードするイベントが、最初のクラスイベントタイプ(ログやトランザクションなど)の既存のスキーマと一致しない場合にのみ使用する必要があります。既存のスキーマに準拠したイベントは、そのスキーマに自動的に一致します。このトピックより前に記載されている、サポートされるデータ型および命名制限を確認してください。
形式
- SaaS
-
JSON
POST https://analytics.api.example.com/events/schema/{schemaName} - オンプレミス
-
JSON
POST http://<events_service_endpoint>:9080/events/schema/{schemaName}
パスパラメータ
| Name | 説明 |
|---|---|
accountId |
アカウント ID |
schemaName |
イベントスキーマ名 |
クエリパラメータ
N/A
ヘッダー
| Name | 説明 |
|---|---|
X-Events-API-AccountName |
[Controller UI License] ページに表示されるグローバルアカウント名。 |
X-Events-API-Key |
分析 API キー。「API キーの管理」を参照してください。 |
Accept |
応答本文の Content-Type。サポートされる値は、application/vnd.appd.events+json;v=2 です。 |
Content-type |
要求本文の Content-Type。デフォルトは、リソース表現(v=2)のバージョンでもある application/vnd.appd.events+json;v=2 です。 |
SaaS による Create の例
- リクエスト
-
JSON
POST http://analytics.api.example.com/events/schema/{schemaName} HTTP/1.1 X-Events-API-AccountName:<global_account_name> X-Events-API-Key:<api_key> Content-Type: application/vnd.appd.events+json;v=2 Accept: application/vnd.appd.events+json;v=2 { "schema" : { "account": "integer", "amount": "float", "product": "string" } } - レスポンス
-
CODE
HTTP/1.1 201 CREATED
イベントスキーマを取得する
既存のイベントスキーマを取得するには、この API を使用します。
形式
- SaaS
-
JSON
GET http://analytics.api.example.com/events/schema/{schemaName} - オンプレミス
-
JSON
GET http://<events_service_endpoint>:9080/events/schema/{schemaName}
パスパラメータ
| Name | 説明 |
|---|---|
accountId |
アカウント ID |
schemaName |
イベントスキーマ名 |
クエリパラメータ
N/A
ヘッダー
| Name | 説明 |
|---|---|
X-Events-API-AccountName |
[Controller UI License] ページに表示されるグローバルアカウント名。 |
X-Events-API-Key |
分析 API キー。「API キーの管理」を参照してください。 |
Accept |
応答本文の Content-Type。サポートされる値は、application/vnd.appd.events+json;v=2 です。 |
SaaS による Retrieve の例
- リクエスト
-
JSON
GET http://analytics.api.example.com/events/schema/{schemaName} HTTP/1.1 X-Events-API-AccountName:<global_account_name> OR <eum_account_name> X-Events-API-Key:<api_key> Accept: application/vnd.appd.events+json;v=2 - レスポンス
-
JSON
HTTP/1.1 200 OK { "schema" : { "account": "integer", "amount": "float", "product": "string" } }
イベントスキーマを更新する
フィールドごとに既存のイベントスキーマを更新するには、この API を使用します。要求本文で、イベントスキーマに適用される更新内容を定義します。
次の例に示すように、各フィールドの更新アクションを要求本文の名前付きセクションとして指定します。アクションは次のフィールドで表されます。
- 追加フィールド
- 名前変更フィールド
追加フィールドを定義する場合は、イベントスキーマを作成する場合と同じように、新しいフィールドのデータ形式を指定する必要があります。
このコールへの応答は、変更された完全なイベントスキーマである必要があります。
形式
- SaaS
-
JSON
PATCH http://analytics.api.example.com/events/schema/{schemaName} X-Events-API-AccountName:<global_account_name> OR <eum_account_name> X-Events-API-Key:<api_key> - オンプレミス
-
JSON
PATCH http://<events_service_endpoint>:9080/events/schema/{schemaName}
パスパラメータ
| Name | 説明 |
|---|---|
accountId |
アカウント ID |
schemaName |
イベントスキーマ名 |
クエリパラメータ
N/A
ヘッダー
| Name | 説明 |
|---|---|
X-Events-API-AccountName |
[Controller UI License] ページに表示されるグローバルアカウント名。 |
X-Events-API-Key |
分析 API キー。「API キーの管理」を参照してください。 |
Accept |
応答本文の Content-Type。サポートされる値は、application/vnd.appd.events+json;v=2 です。 |
Content-type |
要求本文の Content-Type。デフォルトは、リソース表現(v=2)のバージョンでもある application/vnd.appd.events+json;v=2 です。 |
SaaS による Update の例
- リクエスト
-
JSON
PATCH http://analytics.api.example.com/events/schema/{schemaName} HTTP/1.1 X-Events-API-AccountName:<global_account_name> OR <eum_account_name> X-Events-API-Key:<api_key> Content-type: application/vnd.appd.events+json;v=2 Accept: application/vnd.appd.events+json;v=2 [ { "add": { "newfield": "integer" }, "rename": { "oldname": "newname", "oldname2": "newname2" } } ] - レスポンス
-
CODE
HTTP/1.1 200 OK
イベントスキーマを削除する
既存のイベントスキーマを削除するには、この API を使用します。
形式
- SaaS
-
JSON
DELETE http://<events_service_endpoint>:9080/events/schema/{schemaName} X-Events-API-AccountName:<global_account_name> OR <eum_account_name> X-Events-API-Key:<api_key> - オンプレミス
-
JSON
DELETE http://<events_service_endpoint>:9080/events/schema/{schemaName}
パスパラメータ
| Name | 説明 |
|---|---|
accountId |
アカウント ID |
eventType |
イベントスキーマ名 |
クエリパラメータ
N/A
ヘッダー
| Name | 説明 |
|---|---|
X-Events-API-AccountName |
コントローラ UI の [License] ページに表示されるグローバルアカウント名。 |
X-Events-API-Key |
分析 API キー。「API キーの管理」を参照してください。 |
Accept |
応答本文の Content-Type。サポートされている値は次のとおりです。 application/vnd.appd.events+json;v=2 |
SaaS による Delete 要求の例
DELETE http://analytics.api.example.com/events/schema/{schemaName} HTTP/1.1
X-Events-API-AccountName:<global_account_name> OR <eum_account_name>
X-Events-API-Key:<api_key>
Accept: application/vnd.appd.events+json;v=2
Querying Events
When querying analytics events data, the following applies:
-
Every Events Service API has a limit of 200 searches per minute by each account on each event type.
- The Multi-Query Events API is limited to twenty queries per HTTP request.
-
The Analytics Query API can return a maximum of 10,000 results. If you would like to retrieve and paginate over the data, you can use the scroll mode. Scroll mode is limited to 1,000 results per batch.
警告: Scroll mode cannot be used in Query Events (Multiple Queries). -
ADQL sets the rate limits on the following header fields to control large request volumes that may impact system stability:
X-Events-API-AccountName: 450 requests per minute.X-Events-API-Key: 145 requests per minute.
- Limits work differently for aggregation and non-aggregation queries. Because we use the limits specified in the ADQL query as the bucket count limit, it is not possible to also use it as the overall result count limit. Therefore, the URL parametric limit is used for the overall limit. In the case of non-aggregation queries, there is no bucket limit, so the limit specified in the ADQL query is taken as the row count limit and the URL parametric limit becomes the second place to look for it if the ADQL query does not specify a limit.
- Aggregation queries: the total returned row count is limited by the limit in the URL query parameter, and is not directly related to the limits specified in the ADQL query statement itself. The limits in the ADQL query apply only to bucket counts in aggregations.
- Non-aggregation queries: If
LIMITis not specified in theSELECTstatement, the value specified in the URL query parameter is used. If the limit query parameter is also absent, the default is 100.
Query Events (Single Query)
This API can be used either as a simple text-formatted query or as a JSON-formatted query. The JSON-formatted query can accommodate multiple queries per call and is described in Query Events (Multiple Queries).
An event type might search against multiple event types. Therefore, the event type is not provided in the URL path or as a query parameter, but as part of the ADQL query provided in the request body itself. Your ADQL queries must adhere to the syntax described in the ADQL Reference.
This section describes the single query form for querying events.
Format
- SaaS
-
CODE
POST http://analytics.api.example.com/events/query?limit=20 - On-premises
-
CODE
POST http://<events_service_endpoint>:9080/events/query X-Events-API-AccountName:<global_account_name> OR <eum_account_name> X-Events-API-Key:<api_key> Content-type: application/vnd.appd.events+text;v=2
Query Params
| Name | Description |
|---|---|
start |
Filter results based on the minimum event timestamp, specified in ISO 8601 time (https://en.wikipedia.org/wiki/ISO_8601) or Unix time (http://en.wikipedia.org/wiki/Unix_time). If not specified, then the default is no minimum timestamp filtering. Note that data returned will always be limited by the data retention. Specify the time in combined UTC date and time format or epoch milliseconds. Start time is inclusive of limiting timestamps. |
end |
Filter results based on the maximum event timestamp, specified in ISO 8601 time (https://en.wikipedia.org/wiki/ISO_8601) or Unix time (http://en.wikipedia.org/wiki/Unix_time). If not specified, then the default is no maximum timestamp filtering.
注: Data returned will always be limited by the data retention.
Specify the time in combined UTC date and time format or epoch milliseconds. End time is inclusive of limiting timestamps. |
limit |
Limits the number of results returned. The default value is 100. The upper limit on the results that can be fetched is 1,000. |
mode |
The default mode is none. You can use the scroll mode to fetch bulk data and paginate over 10,000 ADQL results. Unless a limit is specified in the query, the API enables the Events Service to fetch beyond the maximum limit. The default mode supports aggregation but the scroll mode does not support aggregation or math operations. Order by queries is supported in scroll mode. Scroll queries returns results in batches. Every request response contains results along with a |
Headers
| Name | Description |
|---|---|
X-Events-API-AccountName |
The global account name or the EUM account name, as shown in the Controller UI License page. |
X-Events-API-Key |
The Analytics API key. See Manage API Keys. |
Accept |
The Content-Type of the response body. The supported value is application/vnd.appd.events+json;v=2 . |
Content-type |
The Content-Type of the request body. The default is application/vnd.appd.events+json;v=2 which also versions the resource representation (v=2). |
Example SaaS Query
- Request
-
CODE
POST http://analytics.api.example.com/events/query?start=1422823420000&end=1423687476000&limit=20000 HTTP/1.1 X-Events-API-AccountName:<global_account_name> OR <eum_account_name> X-Events-API-Key:<api_key> Content-Type: application/vnd.appd.events+text;v=2 Accept: application/vnd.appd.events+json;v=2 SELECT * FROM county WHERE size>=30 AND population>20000 - Response
-
JSON
HTTP/1.1 200 OK { "total": 10000, "fields": [ { "label": "eventTimestamp", "field": "eventTimestamp", "type": "date", "aggregation": null }, { "label": "size", "field": "size", "type": "integer", "aggregation": null }, { "label": "population", "field": "population", "type": "integer", "aggregation": null }, { "label": "pickupTimestamp", "field": "pickupTimestamp", "type": "date", "aggregation": null } ], "results": [ [ "2015-01-03T23:55:39.801-08:00", 35, 47500, "2015-02-11T19:52:28.805Z" ], ... ] }
- First Request
-
JSON
curl -s -X POST "<events_service_endpoint>:<events_service_port>/events/query?start=1422823420000&end=1423687476000" \ -H"X-Events-API-Key:<api_key>" \ -H"X-Events-API-AccountName:<global_account_name> OR <eum_account_name>" \ -H"Content-Type:application/vnd.appd.events+text;v=2" \ -H"Accept:application/vnd.appd.events+json;v=2" \ -d"[{ \"query\": \"SELECT eventTimestamp, pagename FROM browser_records ORDER BY eventTimestamp DESC\", \"mode\": \"scroll\" }]" - First Response
-
JSON
[{"label":"0","fields":[{"label":"agentid".........,[],[],[],[],[]]],"moreData":true,"scrollid":"MCwxMDAwMDAsMTAwMCxEbkYxWlhKNVZHaGxia1psZEdOb0JBQUFBQUFERW1pbUZqZ3RVakpNUkRKVFVVSkxVbkU1ZEROVlpqRkNhVUVBQUFBQUExQkF6QlpJY1hCM1dqVTNWbEp6UTBOaUxUZHlRbkJJZVZoM0FBQUFBQU11Q1dJV1N6VlpUbFZvV1Y5Uk15MUhSbXRSVTFScWRVWkNkd0FBQUFBQzF4TTZGbGRXYW1FMU5HNUVVazk1WVdaUWVXWlRlSEZLZFZFPQ==","schema":"browserrecord"}] - Subsequent Requests
-
警告: The follow-up requests also rely on the scrollid value returned in the first response and subsequent responses.JSON
curl -s -X POST "<events_service_endpoint>:<events_service_port>/events/query?start=1422823420000&end=1423687476000" \ -H"X-Events-API-Key:<api_key>" \ -H"X-Events-API-AccountName:<global_account_name> OR <eum_account_name>" \ -H"Content-Type:application/vnd.appd.events+text;v=2" \ -H"Accept:application/vnd.appd.events+json;v=2" \ -d"[{ \"query\": \"SELECT eventTimestamp, pagename FROM browser_records ORDER BY eventTimestamp DESC\", \"mode\": \"scroll\", \"scrollid\":\"MCwxMDAwMDAsMTAwMCxEbkYxWlhKNVZHaGxia1psZEdOb0JBQUFBQUFERW1pbUZqZ3RVakpNUkRKVFVVSkxVbkU1ZEROVlpqRkNhVUVBQUFBQUExQkF6QlpJY1hCM1dqVTNWbEp6UTBOaUxUZHlRbkJJZVZoM0FBQUFBQU11Q1dJV1N6VlpUbFZvV1Y5Uk15MUhSbXRSVTFScWRVWkNkd0FBQUFBQzF4TTZGbGRXYW1FMU5HNUVVazk1WVdaUWVXWlRlSEZLZFZFPQ==\" }]"
Query Events (Multiple Queries)
Use this API to execute multiple queries against a particular account and event type in parallel. A query event that specifies multiple queries does so by including multiple ADQL queries in the body of the request. Your ADQL queries must adhere to the syntax described in the ADQL Reference.
Using queries in this form takes advantage of certain backend optimizations in query performance. Query filter criteria, such as time range and limit, can be overridden by each inner query.
Format
- SaaS
-
CODE
POST http://analytics.api.example.com/events/query?limit=20 - On-premises
-
CODE
POST http://<events_service_endpoint>:9080/events/query X-Events-API-AccountName:<global_account_name> OR <eum_account_name> X-Events-API-Key:<api_key>
Path Params
None
Query Params
| Name | Description |
|---|---|
start |
Filter results based on the minimum event timestamp, specified in ISO 8601 time or Unix time. If not specified, then the default is no minimum timestamp filtering. Specify the time in combined UTC date and time format or epoch milliseconds. Start time is inclusive of limiting timestamps. |
end |
Filter results based on the maximum event timestamp, specified in ISO 8601 time or Unix time. If not specified, then the default is no maximum timestamp filtering. Specify the time in combined UTC date and time format or epoch milliseconds. End time is inclusive of limiting timestamps. |
limit |
Limits the number of results returned. The default value is 100. The upper limit on the results that can be fetched is 10,000. |
Headers
| None | Description |
|---|---|
X-Events-API-AccountName |
The global account name or the EUM account name, as shown in the Controller UI License page. |
X-Events-API-Key |
The Analytics API key. See Manage API Keys. |
Accept |
The Content-Type of the response body. The supported value is application/vnd.appd.events+json;v=2 . |
Content-type |
The Content-Type of the request body. The default is application/vnd.appd.events+json;v=2 which also versions the resource representation (v=2). |
Payload
| Field | Description |
|---|---|
| label | (Optional) Friendly name to identify the query. |
| query | ADQL query to execute. |
| start | (Optional) Overrides the start parameter value provided as a query parameter. |
| end | (Optional) Overrides the end parameter value provided as a query parameter. |
| limit | (Optional) Overrides the limit provided as a query parameter. |
Example SaaS Multiple Query
- Request
-
JSON
POST http://analytics.api.example.com/events/query?limit=100 HTTP/1.1 X-Events-API-AccountName:<global_account_name> OR <eum_account_name> X-Events-API-Key:<api_key> Content-Type: application/vnd.appd.events+json;v=2 Accept: application/vnd.appd.events+json;v=2 [ { "label": "high_population", "query": "SELECT * FROM county WHERE population>50000", "limit": 10, "start": "2017-02-23T0:0:0Z", "end": "2017-03-1T0:0:0Z" }, { "label": "small_area", "query": "SELECT * FROM county WHERE size<25", "start": "2017-02-23T0:0:0Z", "end": "2017-03-1T0:0:0Z" }, { "label": "high_population_density", "query": "SELECT * FROM county WHERE population>50000 AND size<25", "limit": 100, "start": "2017-02-23T0:0:0Z", "end": "2017-03-1T0:0:0Z" } ] - Response
-
JSON
HTTP/1.1 200 OK [ { "label": "high_population", "total": 30, "fields": [ ... ], "results": [ ... ] }, { "label": "small_area", "total": 50, "fields": [ ... ], "results": [ ... ] }, { "label": "high_population_density", "total": 10, "fields": [ ... ], "results": [ ... ] } ]