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

@@ -269,7 +269,7 @@ public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}/conversat
delete:
$ref: ./teams/delete.yml
### Custom Filters
### Custom Filters goes here
# Teams
/api/v1/accounts/{account_id}/custom_filters:
@@ -296,3 +296,52 @@ public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}/conversat
$ref: ./custom_filters/update.yml
delete:
$ref: ./custom_filters/delete.yml
### Reports
# List
/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:
$ref: './reports/index.yml'
# Summary
/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:
$ref: './reports/summary.yml'

View File

@@ -0,0 +1,17 @@
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

View File

@@ -0,0 +1,17 @@
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