forked from RocketChat/Rocket.Chat-Open-API
-
Notifications
You must be signed in to change notification settings - Fork 0
/
marketplace-apps.yaml
527 lines (521 loc) · 22.1 KB
/
marketplace-apps.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
openapi: 3.0.0
info:
version: 1.0.0
title: Marketplace Apps
# description: |-
# The following marketplace apps endpoints are available:
# * **WhatsApp**: Send a template [WhatsApp](https://docs.rocket.chat/extend-rocket.chat-capabilities/rocket.chat-marketplace/rocket.chat-public-apps-guides/omnichannel-apps/whatsapp) message.
# * **Rasa**: Close a [Rasa](https://docs.rocket.chat/extend-rocket.chat-capabilities/rocket.chat-marketplace/rocket.chat-public-apps-guides/omnichannel-apps/rasa-app) app chat or perform handover.
servers:
- url: https://apiexplorer.support.rocket.chat
paths:
'/api/apps/public/{app-id}/incoming':
parameters:
- schema:
type: string
name: app-id
in: path
required: true
description: The app id. Navigate to App Info > Details > APIs > POST incoming to get the complete URL for this endpoint.
post:
summary: Close Chat or Perform Handover
tags:
- Rasa App
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
msg:
type: string
examples:
Close chat:
value:
msg: ' Close chat request handled successfully'
Perform handover:
value:
msg: ' Perform Handover request handled successfully'
'401':
$ref: '#/components/responses/authorizationError'
operationId: post-api-apps-public-app-id-incoming
description: |-
Close a chat session or perform handover. The appropriate endpoint URL including the `appId` for closing chat or perfoming handover in your workspace is displayed under **App Info > Details > APIs > POST incoming** section of the Rasa app.
### Changelog
| Version | Description |
| ---------------- | ------------|
|5.0.0 | Added |
parameters:
- $ref: '#/components/parameters/Auth-Token'
- $ref: '#/components/parameters/UserId'
requestBody:
content:
application/json:
schema:
type: object
required:
- action
- sessionId
properties:
action:
type: string
description: 'The action can either be `handover` or `close-chat`. '
sessionId:
type: string
description: The ID of the Rasa session.
actionData:
type: object
properties:
targetDepartment:
type: string
description: The targeted department.
examples:
Example:
value:
action: close-chat
sessionId: 2Sfq8wXw4fYPMf6r4
'/api/apps/public/{appId}/templateMessage':
post:
tags:
- WhatsApp
summary: Send a WhatsApp Template Message
description: |-
Use this endpoint to send WhatsApp template messages directly to specified contacts from your workspace.
1. Navigate to **Administration > Apps > Marketplace**.
2. Locate your preferred <a href="https://docs.rocket.chat/docs/whatsapp-apps" target="_blank">WhatsApp App</a>.
3. Go to *App Info > Details > APIs* and find the `POST templateMessage` section.
4. Copy the `POST templateMessage` endpoint URL for your WhatsApp app from the provided curl example. This URL includes the required `appId`. Send a template message request using this URL as the endpoint.
Before sending template messages from Rocket.Chat through any <a href="https://docs.rocket.chat/docs/whatsapp-apps" target="_blank">WhatsApp App</a>, ensure that you have set up the templates in respective WhatsApp provider account. Refer to the official guide for details on <a href="https://developer.rocket.chat/docs/whatsapp-business-template-messages#set-up-template-messages-on-whatsapp" target="_blank">configuring template messages for each WhatsApp app</a>.
operationId: post-api-apps-public-app_id-templateMessage
parameters:
- name: appId
in: path
required: true
schema:
type: string
requestBody:
description: 'We strongly recommend including the + prefix for all phone numbers in the payload. While you can submit numbers without the leading + sign, we have encountered cases where WhatsApp will return an invalid response despite the number being in use.'
content:
application/json:
schema:
type: object
properties:
phoneNumbers:
type: array
description: 'Recipient WhatsApp IDs where you want to send the template message. You can validate a WhatsApp id from <a href="https://developers.facebook.com/docs/whatsapp/on-premises/reference/contacts" target="_blank">here</a>.'
items:
type: string
connectedWhatsAppNo:
type: string
description: The WhatsApp Number from which you want to send this template message. The WhatsApp number connected to your workspace via the app.
targetAgent:
type: string
description: Username of the agent you want to transfer the chat to when the WhatsApp user replies.
targetDepartment:
type: string
description: Department name or ID where you want to transfer the chat to when the WhatsApp user replies.
template:
type: object
description: |-
Provide the details of the template message you want to send. The structure of the template object may differ depending on the template defined within your WhatsApp provider account. For further clarification, refer to the official guide on <a href="https://developer.rocket.chat/docs/whatsapp-business-template-messages#api-endpoint" target="_blank">sending template messages via API in Rocket.Chat</a>. The example template object provided here is based on the configuration outlined in the official guide for the <a href="https://developer.rocket.chat/docs/whatsapp-business-template-messages#whatsapp-cloud" target="_blank">WhatsApp Cloud App</a>.
If your template message includes parameters, make sure to replace all of them with the appropriate information before sending. Failure to do so may lead to an error.
properties:
namespace:
type: string
name:
type: string
language:
type: object
properties:
code:
type: string
policy:
type: string
components:
type: array
items:
type: object
properties:
type:
type: string
parameters:
type: array
items:
type: object
properties:
type:
type: string
text:
type: string
required:
- phoneNumbers
- connectedWhatsAppNo
- template
example:
phoneNumbers:
- '2368106035555'
connectedWhatsAppNo: '104920685899299'
template:
name: ship
language:
code: en
policy: deterministic
components:
- type: body
parameters:
- type: text
text: '20'
responses:
'200':
$ref: '#/components/responses/trueSuccess'
'401':
$ref: '#/components/responses/authorizationError'
'403':
$ref: '#/components/responses/forbiddenError'
'400':
description: Bad Request
content:
application/json:
schema:
type: object
properties:
success:
type: boolean
error:
type: string
examples:
Too many phone numbers:
value:
success: false
error: Too many phone numbers! Please make sure that phoneNumbers are <= 250
Agent Not Found:
value:
success: false
error: No Agent found with username abc98
Department Not Found:
value:
success: false
error: No Department found with id/Name SalesDepartment
Invalid WhatsApp Contact:
value:
success: false
error: Connected WhatsApp Number (connectedWhatsAppNo) i.e. 565412001234 is not a valid WhatsApp contact. Contact Status is invalid
Invalid Connected WhatsApp Number:
value:
success: false
error: 'Error! Connected WhatsApp Number (connectedWhatsAppNo) i.e. 565412001234 has not been registered yet on Rocket.Chat. Please goto #omnichannel-whatsapp-setup channel and connect this WhatsApp number first there before sending this request again.'
/api/apps:
post:
summary: Install Private Apps
description: |-
Install a <a href="https://docs.rocket.chat/docs/rocketchat-marketplace#private-apps" target="_blank">private app</a> via URL. <a href="https://docs.rocket.chat/docs/permissions" target="_blank">Permission</a> required: `manage-apps`
### Changelog
| Version | Description |
| ---------------- | ------------|
|3.1.0 | Added |
operationId: post-api-apps
parameters:
- $ref: '#/components/parameters/Auth-Token'
- $ref: '#/components/parameters/UserId'
requestBody:
content:
application/json:
schema:
type: object
properties:
url:
type: string
description: The app URL where the zip file is located.
required:
- url
examples:
Example:
value:
url: 'https://github.com/RocketChat/Apps.RocketChat.Tester/blob/master/dist/appsrocketchattester_0.0.5.zip?raw=true'
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
app:
type: object
properties:
id:
type: string
version:
type: string
requiredApiVersion:
type: string
iconFile:
type: string
author:
type: object
properties:
name:
type: string
homepage:
type: string
support:
type: string
name:
type: string
nameSlug:
type: string
classFile:
type: string
description:
type: string
implements:
type: array
items:
type: object
iconFileContent:
type: string
status:
type: string
implemented:
type: object
properties:
IPreMessageSentPrevent:
type: boolean
IPreMessageSentExtend:
type: boolean
IPreMessageSentModify:
type: boolean
IPostMessageSent:
type: boolean
IPreMessageDeletePrevent:
type: boolean
IPostMessageDeleted:
type: boolean
IPreMessageUpdatedPrevent:
type: boolean
IPreMessageUpdatedExtend:
type: boolean
IPreMessageUpdatedModify:
type: boolean
IPostMessageUpdated:
type: boolean
IPostMessageReacted:
type: boolean
IPostMessageFollowed:
type: boolean
IPostMessagePinned:
type: boolean
IPostMessageStarred:
type: boolean
IPostMessageReported:
type: boolean
IPreRoomCreatePrevent:
type: boolean
IPreRoomCreateExtend:
type: boolean
IPreRoomCreateModify:
type: boolean
IPostRoomCreate:
type: boolean
IPreRoomDeletePrevent:
type: boolean
IPostRoomDeleted:
type: boolean
IPreRoomUserJoined:
type: boolean
IPostRoomUserJoined:
type: boolean
IPreRoomUserLeave:
type: boolean
IPostRoomUserLeave:
type: boolean
IPostExternalComponentOpened:
type: boolean
IPostExternalComponentClosed:
type: boolean
IUIKitInteractionHandler:
type: boolean
IUIKitLivechatInteractionHandler:
type: boolean
IPostLivechatRoomStarted:
type: boolean
IPostLivechatRoomClosed:
type: boolean
ILivechatRoomClosedHandler:
type: boolean
IPostLivechatAgentAssigned:
type: boolean
IPostLivechatAgentUnassigned:
type: boolean
IPostLivechatRoomTransferred:
type: boolean
IPostLivechatGuestSaved:
type: boolean
IPostLivechatRoomSaved:
type: boolean
IPreFileUpload:
type: boolean
IPreEmailSent:
type: boolean
IPostUserCreated:
type: boolean
IPostUserUpdated:
type: boolean
IPostUserDeleted:
type: boolean
IPostUserLoggedIn:
type: boolean
IPostUserLoggedOut:
type: boolean
IPostUserStatusChanged:
type: boolean
licenseValidation:
type: object
properties:
errors:
type: object
warnings:
type: object
success:
type: boolean
examples:
Success:
value:
app:
id: bc4dd4a1-bf9b-408e-83a4-aba7eba0bf02
version: 0.0.5
requiredApiVersion: ^1.33.0
iconFile: icon.png
author:
name: Rocket.Chat
homepage: 'https://github.com/RocketChat'
support: a
name: Apps.RocketChat.Tester
nameSlug: appsrocketchattester
classFile: AppsRocketChatTesterApp.js
description: An app that provides endpoints to test Apps integration to Rocket.Chat
implements: []
iconFileContent: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAlgAAAGQBAMAAACAGwOrAAAAG1BMVEUAAAD///9fX19/f38/Pz+fn5/f398fHx+/v7F+DAse5zMkkE4D1Jf6exKnYRje4LriXRQ0JzTVP2t7hLNtFWODfxNqiaa6VE8tGjFCxXyc1HHsTisiQ0rijg4mTvyAAAElFTkSuQmCC'
status: auto_enabled
implemented:
IPreMessageSentPrevent: false
IPreMessageSentExtend: false
IPreMessageSentModify: false
IPostMessageSent: false
IPreMessageDeletePrevent: false
IPostMessageDeleted: false
IPreMessageUpdatedPrevent: false
IPreMessageUpdatedExtend: false
IPreMessageUpdatedModify: false
IPostMessageUpdated: false
IPostMessageReacted: false
IPostMessageFollowed: false
IPostMessagePinned: false
IPostMessageStarred: false
IPostMessageReported: false
IPreRoomCreatePrevent: false
IPreRoomCreateExtend: false
IPreRoomCreateModify: false
IPostRoomCreate: false
IPreRoomDeletePrevent: false
IPostRoomDeleted: false
IPreRoomUserJoined: false
IPostRoomUserJoined: false
IPreRoomUserLeave: false
IPostRoomUserLeave: false
IPostExternalComponentOpened: false
IPostExternalComponentClosed: false
IUIKitInteractionHandler: false
IUIKitLivechatInteractionHandler: false
IPostLivechatRoomStarted: false
IPostLivechatRoomClosed: false
ILivechatRoomClosedHandler: false
IPostLivechatAgentAssigned: false
IPostLivechatAgentUnassigned: false
IPostLivechatRoomTransferred: false
IPostLivechatGuestSaved: false
IPostLivechatRoomSaved: false
IPreFileUpload: false
IPreEmailSent: false
IPostUserCreated: false
IPostUserUpdated: false
IPostUserDeleted: false
IPostUserLoggedIn: false
IPostUserLoggedOut: false
IPostUserStatusChanged: false
licenseValidation:
errors: {}
warnings: {}
success: true
'401':
$ref: '#/components/responses/authorizationError'
components:
schemas: {}
parameters:
Auth-Token:
name: X-Auth-Token
in: header
description: The `authToken` of the authenticated user.
required: true
schema:
type: string
example: RScctEHSmLGZGywfIhWyRpyofhKOiMoUIpimhvheU3f
UserId:
name: X-User-Id
in: header
description: The `userId` of the authenticated user.
required: true
schema:
type: string
example: rbAXPnMktTFbNpwtJ
responses:
trueSuccess:
description: OK
content:
application/json:
schema:
type: object
properties:
success:
type: boolean
examples:
Success:
value:
success: true
authorizationError:
description: Unauthorized
content:
application/json:
schema:
type: object
properties:
status:
type: string
message:
type: string
examples:
Authorization Error:
value:
status: error
message: You must be logged in to do this.
forbiddenError:
description: Forbidden
content:
application/json:
schema:
type: object
properties:
success:
type: boolean
error:
type: string
examples:
Permission Error:
value:
success: false
error: 'User does not have the permissions required for this action [error-unauthorized]'
tags:
- name: Rasa App
- name: WhatsApp