Overview
Forecast Metrics
Summary
Returns metrics data for Forecasts-related modules
Request Arguments
Name |
Type |
Description |
Required |
module
|
string
|
The name of the Forecast-related module to gather metrics from
|
True
|
filter
|
array
|
A base module filter definition that will apply to all metrics passed in
|
False
|
user_id
|
string
|
The ID of the Forecasts user to gather metrics for
|
True
|
type
|
string
|
The type of the Forecast user to gather metrics for ("Rollup" for managers, "Direct" for individual salespeople)
|
True
|
time_period
|
string
|
The ID of the time period to gather metrics for. If not provided, will default to the current time period
|
False
|
metrics
|
array
|
An array of metrics definitions to gather metrics for. Each metric definition is an object consisting of:
-
name (string): A unique name used to identify the metric
-
sum_fields (array): The fields of the module to sum up in the metric. All fields in the array
will be summed together. Must consist only of valid numeric DB fields
-
filter (array): Any additional module filtering specific to the metric. This filter will be applied
in addition to the one passed in through the base filter argument
|
True
|
Response Arguments
Name |
Type |
Description |
metrics
|
array
|
The list of metric results. Each metric result is an object consisting of:
count: the metric unique name
sum: the sum of the metric's sum_fields
count: the count of records included in the metric
|
Request Example
{
"module":"Opportunities",
"filter":[
{
"name": {
"$starts":"example"
}
}
],
"user_id":"67aa9afe-ba92-11ec-b8e3-acde48001122",
"type":"Direct",
"time_period":"0dfae418-ba93-11ec-9b49-acde48001122",
"metrics":[
{
"name":"example_metric",
"sum_fields":["amount"],
"filter":[
{
"description": {
"$equals":"example"
}
}
]
},
{
"name":"example_metric_2",
"sum_fields":["best_case"],
"filter":[
{
"description": {
"$equals":"example_2"
}
}
]
}
]
}
Response Example
{
"metrics":[
{
"name":"example_metric",
"sum":1234.00,
"count":3
}
{
"name":"example_metric_2",
"sum":5634.00,
"count":5
}
]
}
Change Log
Version |
Change |
v11_17
|
Added /Forecasts/metrics POST endpoint.
|