GET Report
Overview
This GET
request is used to retrieve reports for a specified project. Below are the details for the request:
GET Report | |
---|---|
Method | GET |
URL or Endpoint | /api/v2/projects/projectId /reports |
Headers | Authorization |
Parameters | query, projectId |
Body | Not Applicable |
The following table describes the URL parameter for projectId
:
projectId URL Parameter | |
---|---|
URL Parameter Name | projectId |
Mandatory | Yes |
Type | string |
Description | Unique identifier for the project. |
Request
Query Parameter Description
The query parameter is passed as an object in the request.
Example of a default query
{"startDate":"2024-08-19T00:00:00",
"endDate":"2024-08-20T00:00:00",
"dimensions":["date"],
"metrics":
[
{"field":"completes"},
{"field":"embeds"},
{"field":"play_per_viewer"},
{"field":"unique_viewers"},
{"field":"ad_clicks"},
{"field":"25_completes"},
{"field":"ad_completes"},
{"field":"time_watched"},
{"field":"complete_rate"},
{"field":"plays"}
],
"filters":
[{"field":"video",
"operator":"equal",
"value":"{videoId}"}]
}
To create a query specifying the desired fields, use the value of the key as the value for the field key in your query. For example, "field":"embeds"
.
To find the complete list of key values, visit the Custom Report Fields API
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": "2024-08-20T11:23:57.809Z",
"endDate": "2024-08-20T11:23:57.809Z"
},
"startDate": "2024-08-20T11:23:57.809Z",
"endDate": "2024-08-20T11:23:57.809Z",
"currentPage": 0,
"totalPages": 0,
"pageSize": 0,
"totalCount": 0,
"items": [
null
]
},
"resultInfo": "string",
"statusCode": 0
}
Information about the fields that appear when you receive the response are displayed in the table below.
Field Name | Type | Description |
---|---|---|
success | boolean | Indicates whether the request was successful. |
errors | array[string] | A list of errors that occurred during the request. |
messages | array[string] | A list of messages returned by the backend. |
result | object | An object containing the report data and metadata. |
rowsMetadata | object | Metadata related to the rows in the result. |
metrics | array[Object] | An array of metrics included in the report, each with an ID, display name, and key. |
filters | array[Object] | An array of filters applied to the report data. |
dimensions | array[Object] | An array of dimensions included in the report, each with an ID, display name, and key. |
startDate | string(Date) | The starting date of the report data. |
endDate | string(Date) | The ending date of the report data. |
startDate | string(Date) | The start date for the current result set. |
endDate | string(Date) | The end date for the current result set. |
currentPage | integer($int32) | The current page number of the result set. |
totalPages | integer($int32) | The total number of pages available in the result set. |
pageSize | integer($int32) | The number of items per page in the result set. |
totalCount | integer($int32) | The total number of items in the result set. |
items | array[Object] | An array containing the items returned in the result. |
resultInfo | string | Additional information about the result. |
statusCode | integer($int32) | The HTTP status code of the response. |
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:
- 400: Bad Request
- 401: Unauthorized
- 403: Forbidden
- 404: Result Not Found
- 500: Internal Server Error
- 503: Backend Fetch Failed