cURL
curl --request GET \
--url https://us.api.flexprice.io/v1/analytics/views \
--header 'x-api-key: <api-key>'from flexprice import Flexprice
with Flexprice(
api_key_auth="<YOUR_API_KEY_HERE>",
) as f_client:
res = f_client.analytics.list_analytics_views()
# Handle response
print(res)import { Flexprice } from "@flexprice/sdk";
const flexprice = new Flexprice({
apiKeyAuth: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await flexprice.analytics.listAnalyticsViews();
console.log(result);
}
run();package main
import(
"context"
flexprice "github.com/flexprice/go-sdk/v2"
"log"
)
func main() {
ctx := context.Background()
s := flexprice.New(
flexprice.WithSecurity("<YOUR_API_KEY_HERE>"),
)
res, err := s.Analytics.ListAnalyticsViews(ctx, nil)
if err != nil {
log.Fatal(err)
}
if res.ListViewsResponse != nil {
// handle response
}
}{
"items": [
{
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"definition": {
"metrics": [
"usage_quantity"
],
"shape": "timeseries",
"compare": "previous_period",
"currency": "<string>",
"dimensions": [
"<string>"
],
"display": "chart",
"family": "usage",
"filters": [
{
"field": "<string>",
"op": "eq",
"optional": true,
"value": [
"<string>"
]
}
],
"limit": 123,
"sort": [
{
"dir": "asc",
"field": "<string>"
}
],
"time": {
"grain": "hour",
"range": "<string>"
},
"variables": [
{
"type": "date_range",
"default": [
"<string>"
],
"name": "<string>",
"required": true
}
]
},
"id": "<string>",
"name": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"version": 123
}
]
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}Analytics
List analytics views
Lists saved views, optionally filtered by family.
GET
/
analytics
/
views
cURL
curl --request GET \
--url https://us.api.flexprice.io/v1/analytics/views \
--header 'x-api-key: <api-key>'from flexprice import Flexprice
with Flexprice(
api_key_auth="<YOUR_API_KEY_HERE>",
) as f_client:
res = f_client.analytics.list_analytics_views()
# Handle response
print(res)import { Flexprice } from "@flexprice/sdk";
const flexprice = new Flexprice({
apiKeyAuth: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await flexprice.analytics.listAnalyticsViews();
console.log(result);
}
run();package main
import(
"context"
flexprice "github.com/flexprice/go-sdk/v2"
"log"
)
func main() {
ctx := context.Background()
s := flexprice.New(
flexprice.WithSecurity("<YOUR_API_KEY_HERE>"),
)
res, err := s.Analytics.ListAnalyticsViews(ctx, nil)
if err != nil {
log.Fatal(err)
}
if res.ListViewsResponse != nil {
// handle response
}
}{
"items": [
{
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"definition": {
"metrics": [
"usage_quantity"
],
"shape": "timeseries",
"compare": "previous_period",
"currency": "<string>",
"dimensions": [
"<string>"
],
"display": "chart",
"family": "usage",
"filters": [
{
"field": "<string>",
"op": "eq",
"optional": true,
"value": [
"<string>"
]
}
],
"limit": 123,
"sort": [
{
"dir": "asc",
"field": "<string>"
}
],
"time": {
"grain": "hour",
"range": "<string>"
},
"variables": [
{
"type": "date_range",
"default": [
"<string>"
],
"name": "<string>",
"required": true
}
]
},
"id": "<string>",
"name": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"version": 123
}
]
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}
