aggregate trigger events per contract
curl --request POST \
--url https://api.example.com/api/v1/contract/{id}/trigger/event/aggregation \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"aggregation": [
{
"name": "<string>",
"field": "<string>",
"size": 5,
"aggregation": "<array>",
"sort": [
{
"field": "timestamp"
}
],
"query": "<string>"
}
],
"query": "address:0xdAC17F958D2ee523a2206206994597C13D831ec7",
"timeseries": [
{
"from": 1,
"to": 1
}
],
"trackTotalCount": 10000
}
'import requests
url = "https://api.example.com/api/v1/contract/{id}/trigger/event/aggregation"
payload = {
"aggregation": [
{
"name": "<string>",
"field": "<string>",
"size": 5,
"aggregation": "<array>",
"sort": [{ "field": "timestamp" }],
"query": "<string>"
}
],
"query": "address:0xdAC17F958D2ee523a2206206994597C13D831ec7",
"timeseries": [
{
"from": 1,
"to": 1
}
],
"trackTotalCount": 10000
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
aggregation: [
{
name: '<string>',
field: '<string>',
size: 5,
aggregation: '<array>',
sort: [{field: 'timestamp'}],
query: '<string>'
}
],
query: 'address:0xdAC17F958D2ee523a2206206994597C13D831ec7',
timeseries: [{from: 1, to: 1}],
trackTotalCount: 10000
})
};
fetch('https://api.example.com/api/v1/contract/{id}/trigger/event/aggregation', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/v1/contract/{id}/trigger/event/aggregation",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'aggregation' => [
[
'name' => '<string>',
'field' => '<string>',
'size' => 5,
'aggregation' => '<array>',
'sort' => [
[
'field' => 'timestamp'
]
],
'query' => '<string>'
]
],
'query' => 'address:0xdAC17F958D2ee523a2206206994597C13D831ec7',
'timeseries' => [
[
'from' => 1,
'to' => 1
]
],
'trackTotalCount' => 10000
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v1/contract/{id}/trigger/event/aggregation"
payload := strings.NewReader("{\n \"aggregation\": [\n {\n \"name\": \"<string>\",\n \"field\": \"<string>\",\n \"size\": 5,\n \"aggregation\": \"<array>\",\n \"sort\": [\n {\n \"field\": \"timestamp\"\n }\n ],\n \"query\": \"<string>\"\n }\n ],\n \"query\": \"address:0xdAC17F958D2ee523a2206206994597C13D831ec7\",\n \"timeseries\": [\n {\n \"from\": 1,\n \"to\": 1\n }\n ],\n \"trackTotalCount\": 10000\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/api/v1/contract/{id}/trigger/event/aggregation")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"aggregation\": [\n {\n \"name\": \"<string>\",\n \"field\": \"<string>\",\n \"size\": 5,\n \"aggregation\": \"<array>\",\n \"sort\": [\n {\n \"field\": \"timestamp\"\n }\n ],\n \"query\": \"<string>\"\n }\n ],\n \"query\": \"address:0xdAC17F958D2ee523a2206206994597C13D831ec7\",\n \"timeseries\": [\n {\n \"from\": 1,\n \"to\": 1\n }\n ],\n \"trackTotalCount\": 10000\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/contract/{id}/trigger/event/aggregation")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"aggregation\": [\n {\n \"name\": \"<string>\",\n \"field\": \"<string>\",\n \"size\": 5,\n \"aggregation\": \"<array>\",\n \"sort\": [\n {\n \"field\": \"timestamp\"\n }\n ],\n \"query\": \"<string>\"\n }\n ],\n \"query\": \"address:0xdAC17F958D2ee523a2206206994597C13D831ec7\",\n \"timeseries\": [\n {\n \"from\": 1,\n \"to\": 1\n }\n ],\n \"trackTotalCount\": 10000\n}"
response = http.request(request)
puts response.read_body{
"total": 123,
"data": {}
}Contract Route
aggregate trigger events per contract
Aggregate using fields from response dto. Using contract auth
POST
/
api
/
v1
/
contract
/
{id}
/
trigger
/
event
/
aggregation
aggregate trigger events per contract
curl --request POST \
--url https://api.example.com/api/v1/contract/{id}/trigger/event/aggregation \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"aggregation": [
{
"name": "<string>",
"field": "<string>",
"size": 5,
"aggregation": "<array>",
"sort": [
{
"field": "timestamp"
}
],
"query": "<string>"
}
],
"query": "address:0xdAC17F958D2ee523a2206206994597C13D831ec7",
"timeseries": [
{
"from": 1,
"to": 1
}
],
"trackTotalCount": 10000
}
'import requests
url = "https://api.example.com/api/v1/contract/{id}/trigger/event/aggregation"
payload = {
"aggregation": [
{
"name": "<string>",
"field": "<string>",
"size": 5,
"aggregation": "<array>",
"sort": [{ "field": "timestamp" }],
"query": "<string>"
}
],
"query": "address:0xdAC17F958D2ee523a2206206994597C13D831ec7",
"timeseries": [
{
"from": 1,
"to": 1
}
],
"trackTotalCount": 10000
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
aggregation: [
{
name: '<string>',
field: '<string>',
size: 5,
aggregation: '<array>',
sort: [{field: 'timestamp'}],
query: '<string>'
}
],
query: 'address:0xdAC17F958D2ee523a2206206994597C13D831ec7',
timeseries: [{from: 1, to: 1}],
trackTotalCount: 10000
})
};
fetch('https://api.example.com/api/v1/contract/{id}/trigger/event/aggregation', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/v1/contract/{id}/trigger/event/aggregation",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'aggregation' => [
[
'name' => '<string>',
'field' => '<string>',
'size' => 5,
'aggregation' => '<array>',
'sort' => [
[
'field' => 'timestamp'
]
],
'query' => '<string>'
]
],
'query' => 'address:0xdAC17F958D2ee523a2206206994597C13D831ec7',
'timeseries' => [
[
'from' => 1,
'to' => 1
]
],
'trackTotalCount' => 10000
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v1/contract/{id}/trigger/event/aggregation"
payload := strings.NewReader("{\n \"aggregation\": [\n {\n \"name\": \"<string>\",\n \"field\": \"<string>\",\n \"size\": 5,\n \"aggregation\": \"<array>\",\n \"sort\": [\n {\n \"field\": \"timestamp\"\n }\n ],\n \"query\": \"<string>\"\n }\n ],\n \"query\": \"address:0xdAC17F958D2ee523a2206206994597C13D831ec7\",\n \"timeseries\": [\n {\n \"from\": 1,\n \"to\": 1\n }\n ],\n \"trackTotalCount\": 10000\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/api/v1/contract/{id}/trigger/event/aggregation")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"aggregation\": [\n {\n \"name\": \"<string>\",\n \"field\": \"<string>\",\n \"size\": 5,\n \"aggregation\": \"<array>\",\n \"sort\": [\n {\n \"field\": \"timestamp\"\n }\n ],\n \"query\": \"<string>\"\n }\n ],\n \"query\": \"address:0xdAC17F958D2ee523a2206206994597C13D831ec7\",\n \"timeseries\": [\n {\n \"from\": 1,\n \"to\": 1\n }\n ],\n \"trackTotalCount\": 10000\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/contract/{id}/trigger/event/aggregation")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"aggregation\": [\n {\n \"name\": \"<string>\",\n \"field\": \"<string>\",\n \"size\": 5,\n \"aggregation\": \"<array>\",\n \"sort\": [\n {\n \"field\": \"timestamp\"\n }\n ],\n \"query\": \"<string>\"\n }\n ],\n \"query\": \"address:0xdAC17F958D2ee523a2206206994597C13D831ec7\",\n \"timeseries\": [\n {\n \"from\": 1,\n \"to\": 1\n }\n ],\n \"trackTotalCount\": 10000\n}"
response = http.request(request)
puts response.read_body{
"total": 123,
"data": {}
}Authorizations
Authentication
Path Parameters
Body
application/json
Aggregations config for search results
Minimum array length:
1Show child attributes
Show child attributes
Query string according to https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html with Default: auto_generate_synonyms_phrase_query=false, fuzzy_max_expansions=0, fuzzy_transpositions=false
Example:
"address:0xdAC17F958D2ee523a2206206994597C13D831ec7"
Timestamp ranges for search indices calculation
Minimum array length:
1Show child attributes
Show child attributes
Return total results up to 'count' value. If 0, then total tracking is disabled and return total=0
⌘I