chore: API documentation updates for CSAT surveys (#7255)

- Expose conversation uuid in APIs
- swagger documentation for cast survey update via public/message/update endpoints
- swagger documentation for survey/responses/conversation_uuid endpoint

Fixes: #6328
This commit is contained in:
Sojan Jose
2023-06-05 21:14:01 +05:30
committed by GitHub
parent aae6081d73
commit 117d5301b4
12 changed files with 111 additions and 6 deletions

View File

@@ -2,7 +2,19 @@
type: object
properties:
submitted_values:
type: object
description: Replies to the Bot Message Types
oneOf:
- type: object
description: Replies to the Bot Message Types
properties:
csat_survey_response:
type: object
description: CSAT Survey Response if original message is CSAT Survey
properties:
rating:
type: integer
description: CSAT Rating
example: 5
feedback_message:
type: string
description: CSAT Comment
example: 'Great'

View File

@@ -75,3 +75,6 @@ x-tagGroups:
- Contacts API
- Conversations API
- Messages API
- name: Others
tags:
- CSAT Survey Page

View File

@@ -0,0 +1,5 @@
in: path
name: conversation_uuid
type: integer
required: true
description: The uuid of the conversation

View File

@@ -22,6 +22,9 @@ contact_sort_param:
conversation_id:
$ref: ./conversation_id.yml
conversation_uuid:
$ref: ./conversation_uuid.yml
custom_filter_id:
$ref: ./custom_filter_id.yml

View File

@@ -124,6 +124,16 @@
# ---------------- end of public api routes-----------#
# ------------ Other routes ------------#
/survey/responses/{conversation_uuid}:
parameters:
- $ref: '#/parameters/conversation_uuid'
get:
$ref: ./survey/show.yml
# ----------- end of other routes -----------#
# ------------ Application API routes ------------#

View File

@@ -0,0 +1,9 @@
tags:
- CSAT Survey Page
operationId: get-csat-survey-page
summary: Get CSAT survey page
description: You can redirect the client to this URL, instead of implementing the CSAT survey component yourself.
security: []
responses:
200:
description: Success

View File

@@ -1000,6 +1000,29 @@
}
}
},
"/survey/responses/{conversation_uuid}": {
"parameters": [
{
"$ref": "#/parameters/conversation_uuid"
}
],
"get": {
"tags": [
"CSAT Survey Page"
],
"operationId": "get-csat-survey-page",
"summary": "Get CSAT survey page",
"description": "You can redirect the client to this URL, instead of implementing the CSAT survey component yourself.",
"security": [
],
"responses": {
"200": {
"description": "Success"
}
}
}
},
"/api/v1/accounts/{account_id}/agent_bots": {
"parameters": [
{
@@ -6567,8 +6590,30 @@
"type": "object",
"properties": {
"submitted_values": {
"type": "object",
"description": "Replies to the Bot Message Types"
"oneOf": [
{
"type": "object",
"description": "Replies to the Bot Message Types",
"properties": {
"csat_survey_response": {
"type": "object",
"description": "CSAT Survey Response if original message is CSAT Survey",
"properties": {
"rating": {
"type": "integer",
"description": "CSAT Rating",
"example": 5
},
"feedback_message": {
"type": "string",
"description": "CSAT Comment",
"example": "Great"
}
}
}
}
}
]
}
}
},
@@ -6973,6 +7018,13 @@
"required": true,
"description": "The numeric ID of the conversation"
},
"conversation_uuid": {
"in": "path",
"name": "conversation_uuid",
"type": "integer",
"required": true,
"description": "The uuid of the conversation"
},
"custom_filter_id": {
"in": "path",
"name": "custom_filter_id",
@@ -7093,6 +7145,12 @@
"Conversations API",
"Messages API"
]
},
{
"name": "Others",
"tags": [
"CSAT Survey Page"
]
}
]
}