cURL
curl --request POST \
--url https://api.tirdad.ai/v1/analytics/views/{id}/query \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"variables": {}
}
'from tirdad_sdk import Tirdad
with Tirdad(
api_key_auth="<YOUR_API_KEY_HERE>",
) as f_client:
res = f_client.analytics.query_analytics_view(id="<id>")
# Handle response
print(res)import { Tirdad } from "@tirdad/sdk";
const tirdad = new Tirdad({
apiKeyAuth: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await tirdad.analytics.queryAnalyticsView("<id>", {});
console.log(result);
}
run();package main
import(
"context"
tirdad "github.com/tirdad-billing/go-sdk/v2"
"github.com/tirdad-billing/go-sdk/v2/models/types"
"log"
)
func main() {
ctx := context.Background()
s := tirdad.New(
tirdad.WithSecurity("<YOUR_API_KEY_HERE>"),
)
res, err := s.Analytics.QueryAnalyticsView(ctx, "<id>", types.ViewQueryRequest{})
if err != nil {
log.Fatal(err)
}
if res.AnalyticsQueryResult != nil {
// handle response
}
}{
"columns": [
{
"currency": "<string>",
"name": "<string>",
"role": "dimension",
"type": "string"
}
],
"meta": {
"from": "<string>",
"prev_from": "<string>",
"prev_to": "<string>",
"query_source": "<string>",
"to": "<string>"
},
"rows": [
[
"<string>"
]
]
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}Analytics
Query an analytics view
Resolves the view’s definition against the supplied variables and executes it.
POST
/
analytics
/
views
/
{id}
/
query
cURL
curl --request POST \
--url https://api.tirdad.ai/v1/analytics/views/{id}/query \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"variables": {}
}
'from tirdad_sdk import Tirdad
with Tirdad(
api_key_auth="<YOUR_API_KEY_HERE>",
) as f_client:
res = f_client.analytics.query_analytics_view(id="<id>")
# Handle response
print(res)import { Tirdad } from "@tirdad/sdk";
const tirdad = new Tirdad({
apiKeyAuth: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await tirdad.analytics.queryAnalyticsView("<id>", {});
console.log(result);
}
run();package main
import(
"context"
tirdad "github.com/tirdad-billing/go-sdk/v2"
"github.com/tirdad-billing/go-sdk/v2/models/types"
"log"
)
func main() {
ctx := context.Background()
s := tirdad.New(
tirdad.WithSecurity("<YOUR_API_KEY_HERE>"),
)
res, err := s.Analytics.QueryAnalyticsView(ctx, "<id>", types.ViewQueryRequest{})
if err != nil {
log.Fatal(err)
}
if res.AnalyticsQueryResult != nil {
// handle response
}
}{
"columns": [
{
"currency": "<string>",
"name": "<string>",
"role": "dimension",
"type": "string"
}
],
"meta": {
"from": "<string>",
"prev_from": "<string>",
"prev_to": "<string>",
"query_source": "<string>",
"to": "<string>"
},
"rows": [
[
"<string>"
]
]
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}