feat: APIs to filter reports (#2889)

Fixes #2823
This commit is contained in:
Tejaswini Chile
2021-08-27 22:46:32 +05:30
committed by GitHub
parent f94abaef5f
commit 65f3e83afd
19 changed files with 542 additions and 61 deletions

View File

@@ -2757,6 +2757,129 @@
}
}
}
},
"/api/v1/accounts/{id}/reports": {
"parameters": [
{
"$ref": "#/parameters/account_id"
},
{
"$ref": "#/parameters/report_metric"
},
{
"$ref": "#/parameters/report_type"
},
{
"in": "query",
"name": "id",
"schema": {
"type": "string"
},
"description": "The Id of specific object in case of agent/inbox/label"
},
{
"in": "query",
"name": "since",
"schema": {
"type": "string"
},
"description": "The timestamp from where report should start."
},
{
"in": "query",
"name": "until",
"schema": {
"type": "string"
},
"description": "The timestamp from where report should stop."
}
],
"get": {
"tags": [
"Reports"
],
"operationId": "list-all-conversation-statistics",
"summary": "Get Account reports",
"description": "Get Account reports for a specific type, metric and date range",
"responses": {
"200": {
"description": "Success",
"schema": {
"type": "array",
"description": "Array of date based conversation statistics",
"items": {
"$ref": "#/definitions/report"
}
}
},
"404": {
"description": "reports not found"
},
"403": {
"description": "Access denied"
}
}
}
},
"/api/v1/accounts/{id}/reports/summary": {
"parameters": [
{
"$ref": "#/parameters/account_id"
},
{
"$ref": "#/parameters/report_type"
},
{
"in": "query",
"name": "id",
"schema": {
"type": "string"
},
"description": "The Id of specific object in case of agent/inbox/label"
},
{
"in": "query",
"name": "since",
"schema": {
"type": "string"
},
"description": "The timestamp from where report should start."
},
{
"in": "query",
"name": "until",
"schema": {
"type": "string"
},
"description": "The timestamp from where report should stop."
}
],
"get": {
"tags": [
"Reports"
],
"operationId": "list-all-conversation-statistics-summary",
"summary": "Get Account reports summary",
"description": "Get Account reports summary for a specific type and date range",
"responses": {
"200": {
"description": "Success",
"schema": {
"type": "array",
"description": "Array of date based conversation statistics",
"items": {
"$ref": "#/definitions/report"
}
}
},
"404": {
"description": "reports not found"
},
"403": {
"description": "Access denied"
}
}
}
}
},
"definitions": {
@@ -3844,6 +3967,25 @@
}
}
]
},
"report": {
"type": "array",
"description": "array of conversation count based on date",
"items": {
"allOf": [
{
"type": "object",
"properties": {
"value": {
"type": "number"
},
"timestamp": {
"type": "string"
}
}
}
]
}
}
},
"parameters": {
@@ -3952,6 +4094,38 @@
"required": true,
"description": "The numeric ID of the custom filter"
},
"report_type": {
"in": "query",
"name": "report_type",
"schema": {
"type": "string",
"enum": [
"account",
"agent",
"inbox",
"label"
]
},
"required": true,
"description": "Type of report"
},
"report_metric": {
"in": "query",
"name": "metric",
"schema": {
"type": "string",
"enum": [
"conversations_count",
"incoming_messages_count",
"outgoing_messages_count",
"avg_first_response_time",
"avg_resolution_time",
"resolutions_count"
]
},
"required": true,
"description": "The type of metric"
},
"public_inbox_identifier": {
"in": "path",
"name": "inbox_identifier",
@@ -3994,7 +4168,8 @@
"Integrations",
"Profile",
"Teams",
"Custom Filter"
"Custom Filter",
"Reports"
]
},
{