Skip to content

Depot Aggregations Documentation ​

Depot Aggregations service for handling data aggregation and statistics

  • Version: 1.0.0

Endpoints ​

Statistics ​

POST /statistics/aggregation ​

Summary: Gets aggregations by sector/site/company id with date range and optional review source filter. Operation ID: postStatisticsAggregation

Parameters:

NameInTypeRequiredDescription
No parameters to pass.

Request Body (application/json):

NameTypeRequiredExampleDescription
company_uuidstringNostring-
site_uuidstringNostring-
sector_uuidstringNostring-
date_fromstringYesstring-
date_tostringYesstring-
review_sourcestringNostring-
rescale_scoresbooleanNotrue-
score_rangeobjectNo-
json
{
  "company_uuid": "string",
  "site_uuid": "string",
  "sector_uuid": "string",
  "date_from": "string",
  "date_to": "string",
  "review_source": "string",
  "rescale_scores": true,
  "score_range": {
    "min": 0,
    "max": 0
  }
}

Responses:

200 OK Aggregated statistics were calculated successfully.

json
{}

Response Parameters

PropertyTypeDescriptionEnum
value---

400 Bad Request The aggregation request is invalid.

json
{
  "message": "string"
}

401 Unauthorized The request is missing a valid depot client identifier.

json
{
  "message": "string"
}

500 Internal Server Error The service failed to calculate aggregations.

json
{
  "message": "string"
}

Example usage

curl
curl --location --request POST 'https://api.example.com/statistics/aggregation' \
--header 'Content-Type: application/json' \
--data-raw '{
  "company_uuid": "string",
  "site_uuid": "string",
  "sector_uuid": "string",
  "date_from": "string",
  "date_to": "string",
  "review_source": "string",
  "rescale_scores": true,
  "score_range": {
    "min": 0,
    "max": 0
  }
}'
c#
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://api.example.com/statistics/aggregation");
var json = """
{
  "company_uuid": "string",
  "site_uuid": "string",
  "sector_uuid": "string",
  "date_from": "string",
  "date_to": "string",
  "review_source": "string",
  "rescale_scores": true,
  "score_range": {
    "min": 0,
    "max": 0
  }
}
""";
request.Content = new StringContent(json, Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
var responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseBody);
ts
const response = await fetch("https://api.example.com/statistics/aggregation", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "company_uuid": "string",
    "site_uuid": "string",
    "sector_uuid": "string",
    "date_from": "string",
    "date_to": "string",
    "review_source": "string",
    "rescale_scores": true,
    "score_range": {
      "min": 0,
      "max": 0
    }
  }),
});
const data = await response.json();
console.log(data);