Skip to content

Commit

Permalink
Better: Add routes and parameter to control text input on EM threads.…
Browse files Browse the repository at this point in the history
… RD-30178 (#261)

* Better: Add routes and parameter to control text input on EM threads. RD-30178

* Apply suggestions from code review

Co-authored-by: Driss Tahraoui-Maldague <driss.tahraouimaldague@gmail.com>

* gen postman

* Fix update_categories description

* gen_postman

---------

Co-authored-by: Driss Tahraoui-Maldague <driss.tahraouimaldague@gmail.com>
  • Loading branch information
brenauj and DrissTM authored Nov 26, 2024
1 parent cfbeb7a commit 1e093c7
Show file tree
Hide file tree
Showing 2 changed files with 147 additions and 3 deletions.
84 changes: 82 additions & 2 deletions specs/engage-digital_openapi3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1667,8 +1667,8 @@ paths:
'/content_threads/{threadId}/update_categories':
put:
description: >-
This method updates the categories of a thread. If token’s user does not
have “read” on thread’s source a 404 HTTP response will be returned.
This method updates the categories of a thread. If token’s user does not have
“read” permission on the thread’s channel a 404 HTTP response will be returned.
If the thread is already being categorized, a 409 HTTP response will be
Expand Down Expand Up @@ -1702,6 +1702,68 @@ paths:
summary: Categorizing a thread
tags:
- Threads
'/content_threads/{threadId}/disable_text_input':
put:
description: >-
This method disables the text input on a messaging thread. If token’s user does not have
“read” permission on the thread’s channel or if the thread is not a messaging thread,
a 404 HTTP response will be returned.
If the text input is already disabled on the thread or the token’s user does not
have the “reply” permission on the thread’s channel, a 403 HTTP response will be
returned.
Authorization​: no.
operationId: disableThreadTextInput
parameters:
- in: path
name: threadId
required: true
schema:
type: string
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/MessagingThread'
description: Success
summary: Disabling text input on a thread
tags:
- Threads
'/content_threads/{threadId}/enable_text_input':
put:
description: >-
This method enables the text input on a messaging thread. If the token’s user does not
have the “read” permission on the thread’s channel or if the thread is not a messaging thread,
a 404 HTTP response will be returned.
If the text input is already enabled on the thread or the token’s user does not
have the “reply” permission on the thread’s channel, a 403 HTTP response will be
returned.
Authorization​: no.
operationId: enableThreadTextInput
parameters:
- in: path
name: threadId
required: true
schema:
type: string
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/MessagingThread'
description: Success
summary: Enabling text input on a thread
tags:
- Threads
/contents:
get:
description: >-
Expand Down Expand Up @@ -1923,6 +1985,18 @@ paths:
required: false
schema:
type: string
- description: >-
Engage Messaging only.
Allows to enable or disable customer's text input on content's thread.
To disable text input, send true.
To enable text input, send false.
To keep as is, omit.
explode: true
in: query
name: 'disable_text_input_on_thread'
required: false
schema:
type: boolean
responses:
'200':
content:
Expand Down Expand Up @@ -9621,6 +9695,12 @@ components:
type: string
required:
- id
MessagingThread:
allOf:
- $ref: '#/components/schemas/Thread'
- properties:
disable_text_input:
type: boolean
TimeSheet:
properties:
active:
Expand Down
66 changes: 65 additions & 1 deletion specs/engage-digital_postman2.json
Original file line number Diff line number Diff line change
Expand Up @@ -894,6 +894,12 @@
"value": "\u003cstring\u003e",
"description": "Mandatory for a WhatsApp source. A discussion can only be initiated using a specific template created on the business manager and approved by WhatsApp. You can find all available template_languages for a given template_name on /1.0/content_sources/source_id.",
"disabled": true
},
{
"key": "disable_text_input_on_thread",
"value": "\u003cboolean\u003e",
"description": "Engage Messaging only. Allows to enable or disable customer's text input on content's thread. To disable text input, send true. To enable text input, send false. To keep as is, omit.",
"disabled": true
}
]
},
Expand Down Expand Up @@ -2718,6 +2724,64 @@
"description": "Thread closure/opening is only available for the following sources:\n* Emails\n* Answers\n* Ideas\n* Facebook Messenger\n* Google+\n* Lithium\n* Mobile Messaging\n\nStarts a job to close a thread. It returns the thread but as the job is asynchronous, the state of the “close” attribute in the returned object do not is the one when the job started.\n\nIf token’s user does not have “read” on thread’s source a 404 HTTP response will be returned. Returns a 403 if the thread cannot be closed or if the user does not have the permission to close a thread.\n\nAuthorization​: no."
}
},
{
"name": "Disabling text input on a thread",
"request": {
"url": {
"raw": "{{ENGAGE_DIGITAL_SERVER_URL}}/1.0/content_threads/:threadId/disable_text_input",
"host": [
"{{ENGAGE_DIGITAL_SERVER_URL}}"
],
"path": [
"1.0",
"content_threads",
":threadId",
"disable_text_input"
]
},
"method": "PUT",
"header": [
{
"key": "Authorization",
"value": "Bearer {{ENGAGE_DIGITAL_ACCESS_TOKEN}}"
},
{
"key": "Accept",
"value": "application/json"
}
],
"description": "This method disables the text input on a messaging thread. If token’s user does not have “read” permission on the thread’s channel or if the thread is not a messaging thread, a 404 HTTP response will be returned.\n\nIf the text input is already disabled on the thread or the token’s user does not have the “reply” permission on the thread’s channel, a 403 HTTP response will be returned.\n\nAuthorization​: no."
}
},
{
"name": "Enabling text input on a thread",
"request": {
"url": {
"raw": "{{ENGAGE_DIGITAL_SERVER_URL}}/1.0/content_threads/:threadId/enable_text_input",
"host": [
"{{ENGAGE_DIGITAL_SERVER_URL}}"
],
"path": [
"1.0",
"content_threads",
":threadId",
"enable_text_input"
]
},
"method": "PUT",
"header": [
{
"key": "Authorization",
"value": "Bearer {{ENGAGE_DIGITAL_ACCESS_TOKEN}}"
},
{
"key": "Accept",
"value": "application/json"
}
],
"description": "This method enables the text input on a messaging thread. If the token’s user does not have the “read” permission on the thread’s channel or if the thread is not a messaging thread, a 404 HTTP response will be returned.\n\nIf the text input is already enabled on the thread or the token’s user does not have the “reply” permission on the thread’s channel, a 403 HTTP response will be returned.\n\nAuthorization​: no."
}
},
{
"name": "Archiving a thread",
"request": {
Expand Down Expand Up @@ -2810,7 +2874,7 @@
"value": "application/json"
}
],
"description": "This method updates the categories of a thread. If token’s user does not have “read” on thread’s source a 404 HTTP response will be returned.\n\nIf the thread is already being categorized, a 409 HTTP response will be returned.\n\nAuthorization​: no."
"description": "This method updates the categories of a thread. If token’s user does not have “read” permission on the thread’s channel a 404 HTTP response will be returned.\n\nIf the thread is already being categorized, a 409 HTTP response will be returned.\n\nAuthorization​: no."
}
}
]
Expand Down

0 comments on commit 1e093c7

Please sign in to comment.