GET /api/v1/insight/calculated-insights/(ci-name)
Use this API to query your Calculated Insights. Users can slice, dice, and filter by
selecting different dimensions, measures, and filters.
Syntax
- HTTP method
- GET
- Availability
- Data Cloud v1.0, Salesforce v51.0
- Formats
- REST
- URI
- /api/v1/insight/calculated-insight/(ci-name)
Request Parameters
| Field Name | Field Type | Description |
|---|---|---|
| ci_name | string | Required. The Calculated Insight name. |
| dimensions | string | Comma-separated list of dimensions to be projected. By default, this parameter includes all of the available dimensions. Example: GenderId__c |
| measures | string | Comma-separated list of measures to be projected. By default, this parameter includes all of the available measures. Example: TotalSales__c |
| limit | int | The number of items to return. By default, the maximum number, 4999 items are returned. Example: 1000 |
| offset | int | Number of rows to skip before starting to return. Example: 100 |
| filters | string | This parameter is added to a select query to select results of only a specific type. Example: [GenderId__c=Male,FirstName__c=Angel] |
| orderby | string | Comma-separated values to sort the result-set in ascending or descending order. Example: GenderId__c ASC, Occupation__c DESC |
| timeGranularity | string | This parameter enables you to roll up the measures to various time ranges. Possible
values: HOUR, DAY, MONTH, QUARTER, YEAR This field is available in API version 53.0 and later. |
Examples
- Request
-
1https://{TSE}.360a.salesforce.com/api/v1/insights/calculated-insights/{ci-name} - Response
-
1{ 2 "data": [ 3 { 4 "Id__c": "05d01a06-0c61-3990-808d-2aa602dd3e7f", 5 "FirstName__c": "Don", 6 "Avg_Spend__c": 1335.15 7 }, 8 { 9 "Id__c": "11bcc846-1a80-3293-8cc4-3449835d8d4c", 10 "FirstName__c": "Wensei", 11 "Avg_Spend__c": 942.67 12 }, 13 { 14 "Id__c": "18213566-df86-34a8-97aa-2cb75b70ae3b", 15 "FirstName__c": "Ryan", 16 "Avg_Spend__c": 2886.50 17 } 18 ], 19 done: true 20}
HTTP Responses
| Response | Reason |
|---|---|
| 200 OK | Callback successfully verified |
| 400 Bad Request | Invalid request |
| 403 Forbidden | Failed to pass authorization. |
| 404 Not Found | Incorrect callback ID, verification key, or both. |
| 422 Unprocessable Entity | Attribute name used in fields or filter parameter doesn’t exist. |
| 500 Server Error | Internal error |