Skip to main content

GET Report Based on Query Model

Overview


The following table contains important information about the GET method in regards to getting a report based on a query model.

GET Report Based on Query Model
MethodPOST
URL or Endpoint/api/projects/projectId/reports/query
HeadersAuthorization
ParametersProjectId
BodyCheck request body below.

The description of the URL parameter is as follows:

projectId URL Parameter
URL Parameter nameprojectId
MandatoryYes
Typestring
DescriptionThe unique Id of your project.

Request Body

{
"startDate": "2022-05-16T16:12:32.816Z",
"endDate": "2022-05-16T16:12:32.816Z",
"takeAll": true,
"dimensions": [
"string"
],
"metrics": [
{
"field": "string"
}
],
"filters": [
{
"field": "string",
"operator": "string",
"value": "string"
}
],
"page": 0,
"take": 0
}
Field NameTypeDescription
startDatestring(Date)The start date of the report.
endDatestring(Date)The end date of the report.
takeAllbooleanIndicates whether it will take all reports.
metricsarray[Object]An array of objects that represents the metrics of a row's metadata.
fieldstringThe field of the metric object.
filtersarray[Object]An array of filter objects.
fieldstringThe field of the filter object.
operatorstringThe operator of the filter object.
valuestringThe value of the filter object.
pageinteger($int32)The number of the page to take for the report.
takeinteger($int32)The amount of items to take per page.

Information about the fields that appear when you post the request body are displayed in the table below.

Response

{
"success": true,
"errors": ["string"],
"messages": ["string"],
"result": {
"rowsMetadata": {
"metrics": [
{
"id": 0,
"display": "string",
"key": "string"
}
],
"filters": [
{
"display": "string"
}
],
"dimensions": [
{
"id": 0,
"display": "string",
"key": "string"
}
],
"startDate": "2022-04-20T10:14:54.030Z",
"endDate": "2022-04-20T10:14:54.030Z"
},
"startDate": "2022-04-20T10:14:54.030Z",
"endDate": "2022-04-20T10:14:54.030Z",
"currentPage": 0,
"totalPages": 0,
"pageSize": 0,
"totalCount": 0,
"items": [[null]]
},
"resultInfo": "string",
"statusCode": 0
}
Field NameTypeDescription
successboolIf the response is successful it will return true. Otherwise will return false.
errorsarray[]Indicates if there was an error.
messagesarray[]Returns the response message from back-end.
resultarray[Object]Returns the response object.
rowsMetadataObjectAn object representing the metadata of a report row.
metricsarray[Object]An array of objects that represents the metrics of a row's metadata.
idinteger($int32)The Id of the metric.
displaystringThe display name of the metric.
keystringThe key of the metric
filtersarray[Object]An array of filter objects.
displaystringThe display name of the filter.
dimensionsarray[Object]An array of dimension objects.
idinteger($int32)The Id of the dimension.
displaystringThe display name of the dimension.
keystringThe key of the dimension.
startDatestring(Date)The start date of the metadata row.
endDatestring(Date)The end date of the metadata row.
startDatestring(Date)The start date of the report.
endDatestring(Date)The end date of the report.
currentPageinteger($int32)The current page of the report.
totalPagesinteger($int32)The total number of pages for the report.
pageSizeinteger($int32)The amount of items per page.
totalCountinteger($int32)The total number of items of the report.
itemsarrayAn array that represents the items of the report.
resultInfostringReturns extra information about the result.
statusCodeinteger($int32)Returns the HTTP Status Code.

Information about the fields that appear when you receive the response are displayed in the table below.

If the action is successful, the service sends back an HTTP 200 or 201 response.

Errors

For information about the errors that are common to all actions, see Common Errors:

  • HTTP Status Code 400: Bad Request

  • HTTP Status Code 401: Unauthorized

  • HTTP Status Code 403: Forbidden

  • HTTP Status Code 404: Result Not Found

  • HTTP Status Code 500: Internal Server Error

  • HTTP Status Code 503: Backend Fetch Failed