4
4
version : " 1.0.0"
5
5
title : " Swagger Web Connector TOCK"
6
6
servers :
7
- - url : " https://demo-bot.tock.ai/io/[namespace]/demo/web "
7
+ - url : " https://demo-bot.tock.ai/"
8
8
paths :
9
- /web :
9
+ /{id} :
10
10
post :
11
11
summary : " Send query to the bot"
12
12
description : " "
13
+ requestBody :
14
+ description : " Query to be sent with user ID"
15
+ required : true
16
+ content :
17
+ application/json :
18
+ schema :
19
+ $ref : ' #/components/schemas/Query'
13
20
parameters :
14
- - in : " query "
15
- name : " body "
16
- description : " Query to be sent with user ID "
21
+ - name : id
22
+ in : path
23
+ description : Connector path
17
24
required : true
18
25
schema :
19
- $ref : " #/components/schemas/Query "
26
+ type : string
20
27
responses :
21
28
200 :
22
29
description : " OK"
23
30
content :
24
31
application/json :
25
32
schema :
26
- oneOf :
27
- - $ref : " #/components/schemas/Text_Response"
28
- - $ref : " #/components/schemas/Card"
29
- - $ref : " #/components/schemas/Carousel"
33
+ $ref : " #/components/schemas/Response"
30
34
example :
31
35
responses :
32
36
- text : ' Welcome to the Chatbot :)'
@@ -40,6 +44,29 @@ paths:
40
44
500 :
41
45
description : " Internal Server Error"
42
46
47
+ /{id}/sse :
48
+ get :
49
+ summary : " Stream bot responses for the given user"
50
+ parameters :
51
+ - name : id
52
+ in : path
53
+ description : Connector path
54
+ required : true
55
+ schema :
56
+ type : string
57
+ - name : userId
58
+ in : query
59
+ description : userId to stream
60
+ required : true
61
+ schema :
62
+ type : string
63
+ responses :
64
+ 200 :
65
+ description : " OK"
66
+ content :
67
+ application/json :
68
+ schema :
69
+ $ref : " #/components/schemas/Response"
43
70
44
71
components :
45
72
schemas :
@@ -53,35 +80,88 @@ components:
53
80
type : " string"
54
81
example : " ID_00001"
55
82
56
- Text_Response :
83
+ Response :
57
84
type : " object"
58
85
properties :
59
86
responses :
60
87
type : " array"
61
88
items :
62
- $ref : " #/components/schemas/Text "
89
+ $ref : " #/components/schemas/Message "
63
90
64
- Text :
91
+ Message :
65
92
type : " object"
66
- required : ["text "]
93
+ required : ["version "]
67
94
properties :
68
95
text :
69
96
type : " string"
70
97
example : " Welcome to the Chatbot :)"
71
98
buttons :
72
- type : " array"
73
- items :
74
- $ref : " #/components/schemas/Button"
99
+ $ref : ' #/components/schemas/Buttons'
100
+ card :
101
+ $ref : " #/components/schemas/Card"
102
+ carousel :
103
+ $ref : ' #/components/schemas/Carousel'
104
+ widget :
105
+ $ref : " #/components/schemas/Widget"
106
+ version :
107
+ type : " string"
108
+ example : " 1"
75
109
76
- Button :
110
+ Buttons :
111
+ type : " array"
112
+ items :
113
+ oneOf :
114
+ - $ref : " #/components/schemas/PostBack"
115
+ - $ref : " #/components/schemas/QuickReply"
116
+ - $ref : " #/components/schemas/UrlButton"
117
+ discriminator :
118
+ propertyName : type
119
+ mapping :
120
+ postback : ' #/components/schemas/PostBack'
121
+ quick_reply : ' #/components/schemas/QuickReply'
122
+ web_url : ' #/components/schemas/UrlButton'
123
+
124
+ PostBack :
77
125
type : " object"
126
+ required : ["title", "type"]
78
127
properties :
79
128
title :
80
129
type : " string"
81
130
example : " Help me on Topic 1"
82
131
payload :
83
132
type : " string"
84
133
example : " helpTopic1?_previous_intent=greetings"
134
+ type :
135
+ type : " string"
136
+ example : " postback"
137
+
138
+ QuickReply :
139
+ type : " object"
140
+ required : ["title", "type"]
141
+ properties :
142
+ title :
143
+ type : " string"
144
+ example : " Choice Topic 1"
145
+ payload :
146
+ type : " string"
147
+ example : " choiceTopic1?_previous_intent=greetings"
148
+ type :
149
+ type : " string"
150
+ example : " quick_reply"
151
+
152
+ UrlButton :
153
+ type : " object"
154
+ required : ["title", "url", "type"]
155
+ properties :
156
+ title :
157
+ type : " string"
158
+ example : " Help me on Topic 1"
159
+ url :
160
+ type : " string"
161
+ example : " http://www.sncf.com"
162
+ type :
163
+ type : " string"
164
+ example : " web_url"
85
165
86
166
Carousel :
87
167
type : " object"
@@ -101,28 +181,32 @@ components:
101
181
type : " string"
102
182
example : " subTitle"
103
183
file :
104
- type : " object"
105
- properties :
106
- url :
107
- type : " string"
108
- example : " http://url1.fr/image1.jpg"
109
- name :
110
- type : " string"
111
- example : " name"
112
- type :
113
- type : " string"
114
- example : " image"
115
- actions :
116
- type : array
117
- items :
118
- $ref : " #/components/schemas/Actions"
184
+ $ref : ' #/components/schemas/File'
185
+ buttons :
186
+ $ref : " #/components/schemas/Buttons"
119
187
120
- Actions :
188
+ File :
121
189
type : " object"
190
+ required : ["url", "name", "type"]
122
191
properties :
123
- title :
192
+ url :
193
+ type : " string"
194
+ example : " http://url1.fr/image1.jpg"
195
+ name :
196
+ type : " string"
197
+ example : " name"
198
+ type :
199
+ type : " string"
200
+ example : " image"
201
+
202
+ Widget :
203
+ type : " object"
204
+ required : ["data", "type"]
205
+ properties :
206
+ data :
207
+ type : " object"
208
+ type :
124
209
type : " string"
125
- example : " Action1"
126
210
127
211
externalDocs :
128
212
description : " TOCK Documentation"
0 commit comments