doc: Swagger for custom attribute APIs (#4382)

This commit is contained in:
Muhsin Keloth
2022-04-07 19:01:31 +05:30
committed by GitHub
parent d4a046a21e
commit dfb56f6bb8
11 changed files with 453 additions and 3 deletions

View File

@@ -0,0 +1,20 @@
tags:
- Custom Attributes
operationId: add-new-custom-attribute-to-account
summary: Add a new custom attribute
description: Add a new custom attribute to account
security:
- userApiKey: []
parameters:
- name: data
in: body
required: true
schema:
$ref: '#/definitions/custom_attribute_create_update_payload'
responses:
200:
description: Success
schema:
$ref: '#/definitions/custom_attribute'
403:
description: Access denied

View File

@@ -0,0 +1,20 @@
tags:
- Custom Attributes
operationId: delete-custom-attribute-from-account
summary: Remove a custom attribute from account
description: Remove a custom attribute from account
security:
- userApiKey: []
parameters:
- in: path
name: id
type: integer
required: true
description: The ID of the custom attribute to be deleted
responses:
200:
description: Success
404:
description: Custom attribute not found
403:
description: Access denied

View File

@@ -0,0 +1,24 @@
tags:
- Custom Attributes
operationId: get-account-custom-attribute
summary: List all custom attributes in an account
parameters:
- name: attribute_model
in: query
type: string
enum: ['0', '1']
description: conversation_attribute(0)/contact_attribute(1)
required: true
description: Get details of custom attributes in an Account
security:
- userApiKey: []
responses:
200:
description: Success
schema:
type: array
description: 'Array of all custom attributes'
items:
$ref: '#/definitions/custom_attribute'
403:
description: Access denied

View File

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

View File

@@ -0,0 +1,28 @@
tags:
- Custom Attributes
operationId: update-custom-attribute-in-account
summary: Update custom attribute in Account
description: Update a custom attribute in account
security:
- userApiKey: []
parameters:
- in: path
name: id
type: integer
required: true
description: The ID of the custom attribute to be updated.
- name: data
in: body
required: true
schema:
$ref: '#/definitions/custom_attribute_create_update_payload'
responses:
200:
description: Success
schema:
description: 'The updated custom attribute'
$ref: '#/definitions/custom_attribute'
404:
description: Agent not found
403:
description: Access denied

View File

@@ -170,6 +170,24 @@
delete:
$ref: ./application/canned_responses/delete.yml
# Custom Attributes
/api/v1/accounts/{account_id}/custom_attribute_definitions:
parameters:
- $ref: '#/parameters/account_id'
get:
$ref: ./application/custom_attributes/index.yml
post:
$ref: ./application/custom_attributes/create.yml
/api/v1/accounts/{account_id}/custom_attribute_definitions/{id}:
parameters:
- $ref: '#/parameters/account_id'
get:
$ref: './application/custom_attributes/show.yml'
patch:
$ref: ./application/custom_attributes/update.yml
delete:
$ref: ./application/custom_attributes/delete.yml
# Contacts
/api/v1/accounts/{account_id}/contacts:
$ref: ./application/contacts/list_create.yml