Introduction
The MegaBill filter API allows users to query and retrieve metadata for building filters on a huge dataset. This API provides endpoints to fetch MegaBill keys, values, virtual tags, and specific metadata for individual keys. This API is used to understand the different building blocks of Finout’s MegaFilter, and the information needed to build Virtual Tags and views.
The Finout API is fully secured using your secret key and client token, which can be managed from your Finout account. Your Finout account allows for five concurrent requests per API key.
Configure API Access
For instructions on configuring an API key, please refer to the main documentation on this topic here.
API endpoints
Method | Endpoint | Feature |
GET | /keys | Retrieve all MegaBill keys and their corresponding values. |
GET | /values/{cost_center}/{key} | Retrieve all values associated with a specific key. |
MegaBill keys
Retrieve all MegaBill keys. A successful response allows you to see all your MegaBill keys and understand how to construct (for example) a Virtual Tag condition based on the key and values and operators (see the Virtual Tags API for here).
Syntax
/megabill/query-language/keys
Parameters
None
Returns (example data)
{
"request": {},
"request_id": "12345",
"error": null,
"keys": [
{
"costCenter": "Kubernetes",
"key": "deployment",
"displayName": "deployment"
},
{
"costCenter": "AWS",
"key": "f_usage_type",
"displayName": "Usage Type"
},
{
"costCenter": "databricks",
"key": "run_name",
"displayName": "run_name"
},
{
"costCenter": "Azure",
"key": "accountownerid",
"displayName": "Account Owner Id"
},
{
"costCenter": "GCP",
"key": "department",
"displayName": "department"
}
]
}
Response
Field | Type | Description | Examples |
request | object | The request object. | {} |
requestId | string | The ID of the request in the Finout system. | "12345" |
message | null | A message indicating any errors (if applicable). | null |
statusCode | number | The status code if there is an error. |
|
keys | array | An array of key metadata objects. |
|
Each object in the key_metadata array has the following fields:
Field | Type | Description | Examples |
costCenter | string | The cost center associated with the key (display name). | "databricks" |
key | string | The unique identifier in Finout. | “a3ViZXJuZXRlczpsYWJlbF9zcGFya19zcGFya19leGVjX2lk” |
displayName | string | The external name identifier in Finout, is only used in Finout’s app. | “job-id” |
Example of a response
{
"request": {},
"request_id": "12345",
"error": null,
"keys": [
{
"costCenter": "Kubernetes",
"key": "deployment",
"displayName": "deployment"
},
{
"costCenter": "AWS",
"key": "f_usage_type",
"displayName": "Usage Type"
},
{
"costCenter": "databricks",
"key": "run_name",
"displayName": "run_name"
},
{
"costCenter": "Azure",
"key": "accountownerid",
"displayName": "Account Owner Id"
},
{
"costCenter": "GCP",
"key": "department",
"displayName": "department"
}
]
}
Get values by key ID
Retrieve all values associated with a specific key. A successful response allows you to construct a virtual tag condition based on the key values and operators.
Syntax
/megabill/query-language/values/{cost_center}/{key}
Path parameters
Parameter | Type | Description |
cost_center | string | The id of the cost center. |
key | string | The id of the key. |
Returns
Field | Type | Description | Example |
request_id | string | A unique identifier for the request. | "12345" |
error | null | An error (if one occurs) during the request. | null |
values | string[] | An array of key values. | [“value1”] |
Key metadata object
Field | Type | Description | Examples |
costCenter | string | The cost center is associated with the key. | "databricks" |
key | string | The unique identifier in Finout. | “a3ViZXJuZXRlczpsYWJlbF9zcGFya19zcGFya19leGVjX2lk” |
displayName | string | The external name identifier in Finout. | “job-id” |
Request
Example of a response
{
"values": [
"deployment1",
"deployment2t",
"deployment3"
],
"request": {
"costCenter": "Kubernetes",
"key": "deployment"
},
"requestId": "a89192a7-bcc8-40cb-8bdf-7eb50ea572c7",
"accountId": "e6ad4c08-9ecd-4592-be61-7a13ad456259"
}
Still need help? Please feel free to reach out to our team at [email protected].