Skip to content

Commit 1e093c7

Browse files
brenaujDrissTM
andauthored
Better: Add routes and parameter to control text input on EM threads. 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 <[email protected]> * gen postman * Fix update_categories description * gen_postman --------- Co-authored-by: Driss Tahraoui-Maldague <[email protected]>
1 parent cfbeb7a commit 1e093c7

File tree

2 files changed

+147
-3
lines changed

2 files changed

+147
-3
lines changed

specs/engage-digital_openapi3.yaml

+82-2
Original file line numberDiff line numberDiff line change
@@ -1667,8 +1667,8 @@ paths:
16671667
'/content_threads/{threadId}/update_categories':
16681668
put:
16691669
description: >-
1670-
This method updates the categories of a thread. If token’s user does not
1671-
have “read” on thread’s source a 404 HTTP response will be returned.
1670+
This method updates the categories of a thread. If token’s user does not have
1671+
“read” permission on the thread’s channel a 404 HTTP response will be returned.
16721672
16731673
16741674
If the thread is already being categorized, a 409 HTTP response will be
@@ -1702,6 +1702,68 @@ paths:
17021702
summary: Categorizing a thread
17031703
tags:
17041704
- Threads
1705+
'/content_threads/{threadId}/disable_text_input':
1706+
put:
1707+
description: >-
1708+
This method disables the text input on a messaging thread. If token’s user does not have
1709+
“read” permission on the thread’s channel or if the thread is not a messaging thread,
1710+
a 404 HTTP response will be returned.
1711+
1712+
1713+
If the text input is already disabled on the thread or the token’s user does not
1714+
have the “reply” permission on the thread’s channel, a 403 HTTP response will be
1715+
returned.
1716+
1717+
1718+
Authorization​: no.
1719+
operationId: disableThreadTextInput
1720+
parameters:
1721+
- in: path
1722+
name: threadId
1723+
required: true
1724+
schema:
1725+
type: string
1726+
responses:
1727+
'200':
1728+
content:
1729+
application/json:
1730+
schema:
1731+
$ref: '#/components/schemas/MessagingThread'
1732+
description: Success
1733+
summary: Disabling text input on a thread
1734+
tags:
1735+
- Threads
1736+
'/content_threads/{threadId}/enable_text_input':
1737+
put:
1738+
description: >-
1739+
This method enables the text input on a messaging thread. If the token’s user does not
1740+
have the “read” permission on the thread’s channel or if the thread is not a messaging thread,
1741+
a 404 HTTP response will be returned.
1742+
1743+
1744+
If the text input is already enabled on the thread or the token’s user does not
1745+
have the “reply” permission on the thread’s channel, a 403 HTTP response will be
1746+
returned.
1747+
1748+
1749+
Authorization​: no.
1750+
operationId: enableThreadTextInput
1751+
parameters:
1752+
- in: path
1753+
name: threadId
1754+
required: true
1755+
schema:
1756+
type: string
1757+
responses:
1758+
'200':
1759+
content:
1760+
application/json:
1761+
schema:
1762+
$ref: '#/components/schemas/MessagingThread'
1763+
description: Success
1764+
summary: Enabling text input on a thread
1765+
tags:
1766+
- Threads
17051767
/contents:
17061768
get:
17071769
description: >-
@@ -1923,6 +1985,18 @@ paths:
19231985
required: false
19241986
schema:
19251987
type: string
1988+
- description: >-
1989+
Engage Messaging only.
1990+
Allows to enable or disable customer's text input on content's thread.
1991+
To disable text input, send true.
1992+
To enable text input, send false.
1993+
To keep as is, omit.
1994+
explode: true
1995+
in: query
1996+
name: 'disable_text_input_on_thread'
1997+
required: false
1998+
schema:
1999+
type: boolean
19262000
responses:
19272001
'200':
19282002
content:
@@ -9621,6 +9695,12 @@ components:
96219695
type: string
96229696
required:
96239697
- id
9698+
MessagingThread:
9699+
allOf:
9700+
- $ref: '#/components/schemas/Thread'
9701+
- properties:
9702+
disable_text_input:
9703+
type: boolean
96249704
TimeSheet:
96259705
properties:
96269706
active:

specs/engage-digital_postman2.json

+65-1
Original file line numberDiff line numberDiff line change
@@ -894,6 +894,12 @@
894894
"value": "\u003cstring\u003e",
895895
"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.",
896896
"disabled": true
897+
},
898+
{
899+
"key": "disable_text_input_on_thread",
900+
"value": "\u003cboolean\u003e",
901+
"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.",
902+
"disabled": true
897903
}
898904
]
899905
},
@@ -2718,6 +2724,64 @@
27182724
"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."
27192725
}
27202726
},
2727+
{
2728+
"name": "Disabling text input on a thread",
2729+
"request": {
2730+
"url": {
2731+
"raw": "{{ENGAGE_DIGITAL_SERVER_URL}}/1.0/content_threads/:threadId/disable_text_input",
2732+
"host": [
2733+
"{{ENGAGE_DIGITAL_SERVER_URL}}"
2734+
],
2735+
"path": [
2736+
"1.0",
2737+
"content_threads",
2738+
":threadId",
2739+
"disable_text_input"
2740+
]
2741+
},
2742+
"method": "PUT",
2743+
"header": [
2744+
{
2745+
"key": "Authorization",
2746+
"value": "Bearer {{ENGAGE_DIGITAL_ACCESS_TOKEN}}"
2747+
},
2748+
{
2749+
"key": "Accept",
2750+
"value": "application/json"
2751+
}
2752+
],
2753+
"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."
2754+
}
2755+
},
2756+
{
2757+
"name": "Enabling text input on a thread",
2758+
"request": {
2759+
"url": {
2760+
"raw": "{{ENGAGE_DIGITAL_SERVER_URL}}/1.0/content_threads/:threadId/enable_text_input",
2761+
"host": [
2762+
"{{ENGAGE_DIGITAL_SERVER_URL}}"
2763+
],
2764+
"path": [
2765+
"1.0",
2766+
"content_threads",
2767+
":threadId",
2768+
"enable_text_input"
2769+
]
2770+
},
2771+
"method": "PUT",
2772+
"header": [
2773+
{
2774+
"key": "Authorization",
2775+
"value": "Bearer {{ENGAGE_DIGITAL_ACCESS_TOKEN}}"
2776+
},
2777+
{
2778+
"key": "Accept",
2779+
"value": "application/json"
2780+
}
2781+
],
2782+
"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."
2783+
}
2784+
},
27212785
{
27222786
"name": "Archiving a thread",
27232787
"request": {
@@ -2810,7 +2874,7 @@
28102874
"value": "application/json"
28112875
}
28122876
],
2813-
"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."
2877+
"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."
28142878
}
28152879
}
28162880
]

0 commit comments

Comments
 (0)