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 | |
---|---|
Method | POST |
URL or Endpoint | /api/projects/projectId /reports/query |
Headers | Authorization |
Parameters | ProjectId |
Body | Check request body below. |
The description of the URL parameter is as follows:
projectId URL Parameter | |
---|---|
URL Parameter name | projectId |
Mandatory | Yes |
Type | string |
Description | The 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 Name | Type | Description |
---|---|---|
startDate | string(Date) | The start date of the report. |
endDate | string(Date) | The end date of the report. |
takeAll | boolean | Indicates whether it will take all reports. |
metrics | array[Object] | An array of objects that represents the metrics of a row's metadata. |
field | string | The field of the metric object. |
filters | array[Object] | An array of filter objects. |
field | string | The field of the filter object. |
operator | string | The operator of the filter object. |
value | string | The value of the filter object. |
page | integer($int32) | The number of the page to take for the report. |
take | integer($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 Name | Type | Description |
---|---|---|
success | bool | If the response is successful it will return true. Otherwise will return false. |
errors | array[] | Indicates if there was an error. |
messages | array[] | Returns the response message from back-end. |
result | array[Object] | Returns the response object. |
rowsMetadata | Object | An object representing the metadata of a report row. |
metrics | array[Object] | An array of objects that represents the metrics of a row's metadata. |
id | integer($int32) | The Id of the metric. |
display | string | The display name of the metric. |
key | string | The key of the metric |
filters | array[Object] | An array of filter objects. |
display | string | The display name of the filter. |
dimensions | array[Object] | An array of dimension objects. |
id | integer($int32) | The Id of the dimension. |
display | string | The display name of the dimension. |
key | string | The key of the dimension. |
startDate | string(Date) | The start date of the metadata row. |
endDate | string(Date) | The end date of the metadata row. |
startDate | string(Date) | The start date of the report. |
endDate | string(Date) | The end date of the report. |
currentPage | integer($int32) | The current page of the report. |
totalPages | integer($int32) | The total number of pages for the report. |
pageSize | integer($int32) | The amount of items per page. |
totalCount | integer($int32) | The total number of items of the report. |
items | array | An array that represents the items of the report. |
resultInfo | string | Returns extra information about the result. |
statusCode | integer($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