feat: Add APIs to create custom views on the dashboard (#2498)

This commit is contained in:
Pranav Raj S
2021-06-29 19:29:57 +05:30
committed by GitHub
parent fa37f8e185
commit 30832d8a34
27 changed files with 654 additions and 9 deletions

View File

@@ -0,0 +1,19 @@
tags:
- Custom Filter
operationId: create-a-custom-filter
summary: Create a custom filter
description: Create a custom filter in the account
parameters:
- $ref: '#/parameters/account_id'
- name: data
in: body
required: true
schema:
$ref: '#/definitions/custom_filter_create_update_payload'
responses:
200:
description: Success
schema:
$ref: '#/definitions/custom_filter'
401:
description: Unauthorized

View File

@@ -0,0 +1,12 @@
tags:
- Custom Filter
operationId: delete-a-custom-filter
summary: Delete a custom filter
description: Delete a custom filter from the account
responses:
200:
description: Success
401:
description: Unauthorized
404:
description: The custom filter does not exist in the account

View File

@@ -0,0 +1,15 @@
tags:
- Custom Filter
operationId: list-all-filters
summary: List all custom filters
description: List all custom filters in a category of a user
responses:
200:
description: Success
schema:
type: array
description: 'Array of custom filters'
items:
$ref: '#/definitions/custom_filter'
401:
description: Unauthorized

View File

@@ -0,0 +1,14 @@
tags:
- Custom Filter
operationId: get-details-of-a-single-custom-filter
summary: Get a custom filter details
description: Get the details of a custom filter in the account
responses:
200:
description: Success
schema:
$ref: '#/definitions/custom_filter'
401:
description: Unauthorized
404:
description: The given team ID does not exist in the account

View File

@@ -0,0 +1,18 @@
tags:
- Custom Filter
operationId: update-a-custom-filter
summary: Update a custom filter
description: Update a custom filter's attributes
parameters:
- name: data
in: body
required: true
schema:
$ref: '#/definitions/custom_filter_create_update_payload'
responses:
200:
description: Success
schema:
$ref: '#/definitions/custom_filter'
401:
description: Unauthorized

View File

@@ -92,7 +92,7 @@ public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}/conversat
- $ref: '#/parameters/public_contact_identifier'
post:
$ref: ./public/inboxes/conversations/create.yml
get:
get:
$ref: ./public/inboxes/conversations/index.yml
public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}/conversations/{conversation_id}/messages:
@@ -102,7 +102,7 @@ public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}/conversat
- $ref: '#/parameters/conversation_id'
post:
$ref: ./public/inboxes/messages/create.yml
get:
get:
$ref: ./public/inboxes/messages/index.yml
public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}/conversations/{conversation_id}/messages/{message_id}:
parameters:
@@ -264,3 +264,31 @@ public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}/conversat
$ref: ./teams/update.yml
delete:
$ref: ./teams/delete.yml
### Custom Filters
# Teams
/api/v1/accounts/{account_id}/custom_filters:
parameters:
- $ref: '#/parameters/account_id'
- in: query
name: filter_type
schema:
type: string
enum: ['conversation', 'contact', 'report']
required: false
description: The type of custom filter
get:
$ref: ./custom_filters/index.yml
post:
$ref: ./custom_filters/create.yml
/api/v1/accounts/{account_id}/custom_filters/{custom_filter_id}:
parameters:
- $ref: '#/parameters/account_id'
- $ref: '#/parameters/custom_filter_id'
get:
$ref: './custom_filters/show.yml'
patch:
$ref: ./custom_filters/update.yml
delete:
$ref: ./custom_filters/delete.yml