-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathconversations.yaml
787 lines (787 loc) · 26.4 KB
/
conversations.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
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
openapi: 3.0.0
info:
title: Conversations API
version: 1.0.0
description:
Medallia Conversations enables communications with customers and
employees through a conversational service such as SMS,
Facebook Messenger, WhatsApp, and more. A channel adapter
connects Medallia Conversations with the end user device,
handling the device-specific communications as needed.
termsOfService: https://medallia.com/about/legal/terms/api
servers:
- url: 'https://{conversations-api-gateway-hostname}'
variables:
conversations-api-gateway-hostname:
default: conversations.sc4.medallia.com
description:
The Medallia Experience Cloud hostname used to access
Medallia Conversations' API gateway.
- url: 'https://{adapter-api-gateway-hostname}'
variables:
adapter-api-gateway-hostname:
default: adapter-gateway.example.com
description:
The endpoint used to make requests from Medallia Conversations
to the channel adapter.
paths:
/:
servers:
- url: 'https://{adapter-api-gateway-hostname}'
variables:
adapter-api-gateway-hostname:
default: adapter-gateway.example.com
description:
The endpoint used to make requests from Medallia
Conversations to the channel adapter.
post:
tags:
- Channel Adapter Services
description:
The API endpoint implemented by the Channel Adapter to accept
messages from Medallia Conversations.
parameters:
- in: query
name: access_token
description:
The access token is a shared token defined when creating
the channel adapter in Medallia Conversations. It is
free-form text, but Medallia recommends using a
cryptographically-secure token such as a UUID or other
random nonce value.
schema:
type: string
required: true
example: 7f0e8b1f-81a1-41ec-8446-347df7318594
requestBody:
content:
application/json:
schema:
oneOf:
- $ref: '#/components/schemas/OutboundMessageRequest'
- $ref: '#/components/schemas/EndOfConversationSignal'
responses:
200:
description:
A successful response includes the customer and message IDs.
content:
application/json:
schema:
$ref: '#/components/schemas/OutboundMessageResponse'
401:
description: Unauthorized.
/{customer-id}:
servers:
- url: 'https://{adapter-api-gateway-hostname}'
variables:
adapter-api-gateway-hostname:
default: adapter-gateway.example.com
description:
The endpoint used to make requests from Medallia
Conversations to the channel adapter.
get:
tags:
- Channel Adapter Services
description:
Returns a customer's profile data for use in Medallia
Conversations' reporting interfaces. All fields returned
by the adapter are optional. The adapter returns whatever
it can, and it may return an empty response.
parameters:
- in: path
name: customer-id
description:
An identifier unique to the customer, such as
phone number, email, or other channel-specific
value. For phone numbers, the ID must be in
E.164 format.
schema:
type: string
required: true
example: [email protected]
- in: query
name: access_token
description:
The access token is a shared token defined when creating
the channel adapter in Medallia Conversations. It is
free-form text, but Medallia recommends using a
cryptographically-secure token such as a UUID or other
random nonce value.
schema:
type: string
required: true
example: 7f0e8b1f-81a1-41ec-8446-347df7318594
responses:
200:
description:
The customer's profile data. If the customer id provided
is not found, an empty response should be returned.
content:
application/json:
schema:
$ref: '#/components/schemas/CustomerProfileData'
401:
description: Unauthorized.
404:
description:
A customer profile for the customer id provided was
not found.
/apis/v0/channels/{channel-guid}/messages:
servers:
- url: 'https://{conversations-api-gateway-hostname}'
variables:
conversations-api-gateway-hostname:
default: conversations.sc4.medallia.com
description:
The Medallia Experience Cloud hostname used to access
Medallia Conversations' API gateway.
post:
tags:
- Conversations Services
description:
Accepts messages from the channel adapter sent to Medallia
Conversations. The payload is polymorphic -- that is, the shape
of the request payload indicates whether the channel adapter is
forwarding an inbound message from the customer, triggering a
new conversation, or providing delivery status of the last
sent message.
parameters:
- in: path
name: channel-guid
description:
The _Channel ID_ assigned by Medallia Conversations when
the channel is created.
schema:
type: string
required: true
example: 4a6dfb90-f06f-11eb-8694-49649f7d8b3a
requestBody:
description: The request payload
required: true
content:
application/json:
schema:
type: object
properties:
object:
type: string
enum: [page]
entry:
type: array
items:
oneOf:
- $ref: '#/components/schemas/ForwardedMessage'
- $ref: '#/components/schemas/ConversationTrigger'
- $ref: '#/components/schemas/DeliveryStatusUpdate'
additionalProperties:
type: string
examples:
forwardedMessage:
summary:
A message forwarded from the end user through
the channel adapter to Medallia Conversations.
value:
object: page
entry:
id: '6482345-345345-24525-4542'
time: '2021-03-23T13:15:37-07:00'
messaging:
sender:
id: '6482345-345345-24525-4542'
recipient:
id: '6482345-345345-24525-4542'
timestamp: 20493487298672
message:
mid: 6482345-345345-24525-4542, 6987364-24545-2452452-5234
text: Hello world!
conversationTrigger:
summary:
A request to start a Conversation engagement
for an end user.
value:
object: "page"
entry:
id: '6482345-345345-24525-4542'
time: '2021-03-23T13:15:37-07:00'
messaging:
sender:
id: '6482345-345345-24525-4542'
recipient:
id: '6482345-345345-24525-4542'
timestamp: 20493487298672
message:
mid: 6482345-345345-24525-4542, 6987364-24545-2452452-5234
text: convoTest!
trigger_params:
override_session: true
consumer:
id: '8069100230017427'
email: '[email protected]'
custom:
session_id: "e123456789-eb0d-437f-bafd-78efa6c6cce4"
channel: "Orion-DEV"
survey_type: "post-purchase-survey-prod"
deliveryStatusUpdate:
summary:
An update by the channel adapter to Medallia
Conversations, indicating the delivery status
of an outbound message.
value:
object: page
entry:
id: '6482345-345345-24525-4542'
time: '2021-03-23T13:15:37-07:00'
messaging:
sender:
id: '6482345-345345-24525-4542'
recipient:
id: '6482345-345345-24525-4542'
timestamp: 20493487298672
delivery:
mids: 6482345-345345-24525-4542, 6987364-24545-2452452-5234
status: delivered
responses:
200:
description: The request was processed as expected.
401:
description:
Unauthorized. The reason is provided in the body
as a human-readable string.
content:
text/plain:
schema:
type: string
403:
description: Forbidden.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
500:
description: Internal server error.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
security:
- conversationsOauth: []
/apis/v0/channels/{channel-guid}/conversations:
servers:
- url: 'https://{conversations-api-gateway-hostname}'
variables:
conversations-api-gateway-hostname:
default: conversations.sc4.medallia.com
description:
The Medallia Experience Cloud hostname used to access
Medallia Conversations' API gateway.
get:
tags:
- Conversations Services
description:
Lists all available Conversations accessible to the
Channel Adapter.
parameters:
- in: query
name: f.labels
description:
Filters the returned values by the conversation's label.
schema:
type: string
required: false
- in: path
name: channel-guid
description:
The _Channel ID_ assigned by Medallia Conversations when
the channel is created.
schema:
type: string
required: true
example: 4a6dfb90-f06f-11eb-8694-49649f7d8b3a
responses:
200:
description:
Returns the list of available conversations.
content:
application/json:
schema:
$ref: '#/components/schemas/ConversationsList'
401:
description:
Unauthorized. The reason is provided in the body
as a human-readable string.
content:
text/plain:
schema:
type: string
403:
description: Forbidden
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
500:
description: Internal server error.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
security:
- conversationsOauth: []
components:
schemas:
ConversationsList:
type: object
required:
- _total
properties:
items:
type: array
items:
type: object
required:
- guid
- title
- description
- keyword
- labels
- created_at
- updated_at
properties:
guid:
type: string
format: uuid
title:
type: string
description:
type: string
keyword:
type: array
items:
type: string
labels:
type: array
items:
type: string
created_at:
type: string
format: date-time
description: "The date of creation in ISO-8601 UTC format (ex: yyyy-mm-ddThh:mm:ssZ)."
updated_at:
type: string
format: date-time
description: "The last modification date in ISO-8601 UTC format (ex: yyyy-mm-ddThh:mm:ssZ)."
_total:
type: integer
format: int64
CustomerProfileData:
type: object
properties:
first_name:
type: string
last_name:
type: string
profile_pic:
type: string
format: uri
description:
A publicly-accessible URL to the customer's avatar or
profile picture.
locale:
type: string
description: The ISO-639 or ISO-3166 country code.
timezone:
type: integer
format: int64
description: "Time zone offset, the number relative to GMT, (ex: -8)."
phone_number:
type: string
pattern: ^\+[1-9]\d{1,14}$
description: The customer's phone number, in E.164 format.
OutboundMessageRequest:
type: object
required:
- recipient
- message
- notification_type
properties:
recipient:
type: object
required:
- id
properties:
id:
type: string
description:
An identifier unique to the customer, such as phone number,
email, or another channel-specific value. For phone numbers,
the identifier must be in E.164 format.
message:
type: object
required:
- text
properties:
text:
type: string
description:
The text of the question being asked.
quick_replies:
type: array
description:
Optional array of objects containing the response options.
items:
type: object
properties:
content_type:
type: string
description:
The type of the payload field.
enum: [ text ]
title:
type: string
description:
Text of a response option to the question.
payload:
type: string
format: uuid
description:
Unique identifier of the quick reply option.
The adapter can send this as the user's response,
when the quick reply option is chosen.
image_url:
type: string
format: uri
attachments:
type: array
description:
An optional array containing files or a location
object attached to the message.
items:
type: object
required:
- type
- payload
properties:
type:
type: string
description: The type of the attachment.
enum: [ file, audio, image, video, location ]
payload:
properties:
url:
type: string
format: uri
description: The attachment url.
data:
type: string
format: byte
description: The attached file content.
metadata:
type: object
description:
If data was provided instead of url, this object should
include the MIME type and extension of the attachment.
required:
- mime
- extension
properties:
mime:
type: string
extension:
type: string
description: The attachment file extension.
coordinates:
type: object
required:
- lat
- long
properties:
lat:
type: number
format: float
long:
type: number
format: float
notification_type:
type: string
enum: [REGULAR, CUSTOM]
EndOfConversationSignal:
type: object
required:
- recipient
- sender_action
- reason
properties:
recipient:
type: object
properties:
id:
type: string
description:
An identifier unique to the customer, such as phone number,
email, or another channel-specific value. For phone numbers,
the identifier must be in E.164 format.
sender_action:
type: string
enum: [ conversation_ended ]
reason:
type: string
description: The reason the conversation has ended.
OutboundMessageResponse:
type: object
required:
- recipient_id
- message_id
properties:
recipient_id:
type: string
description:
The identifier for the recipient, as sent in the original
request.
message_id:
type: string
format: uuid
description:
A unique identifier for the message, assigned by the
channel adapter.
ForwardedMessage:
type: object
required:
- id
- time
- messaging
properties:
id:
type: string
description:
The PageId value configured in Medallia Conversations when
the channel is created.
time:
type: integer
format: int64
description:
Unix epoch timestamp of the last event associated with the
request. For example, when it is a multi-part message, this
is the time of the last message-part.
messaging:
type: array
items:
type: object
properties:
sender:
type: object
properties:
id:
type: string
description:
An identifier unique to the customer, such as phone
number, email, or other channel-specific value.
For phone numbers, the ID must be in E.164 format.
recipient:
type: object
properties:
id:
type: string
description:
The PageId value configured in Conversations at the
creation of the channel.
timestamp:
type: integer
format: int64
description:
Unix epoch timestamp of the last event associated with the
request. For example, when it is a multi-part message, this
is the time of the last message-part.
message:
type: object
required:
- mid
- text
properties:
mid:
type: string
description:
An identifier for the message sent. Used by the
adapter to track the messages.
text:
type: string
description:
The message text, no longer than 1,600 characters.
The channel service may split the message into
multiple parts for delivery.
ConversationTrigger:
type: object
required:
- id
- time
- messaging
properties:
id:
type: string
description:
The PageId value configured in Medallia Conversations when
the channel is created.
time:
type: integer
format: int64
description:
Unix epoch timestamp of the last event associated with the
request. For example, when it is a multi-part message, this
is the time of the last message-part.
messaging:
type: array
items:
type: object
properties:
sender:
type: object
properties:
id:
type: string
description:
An identifier unique to the customer, such as phone
number, email, or other channel-specific value.
For phone numbers, the ID must be in E.164 format.
recipient:
type: object
properties:
id:
type: string
description:
The PageId value configured in Medallia Conversations
when the channel is created.
timestamp:
type: integer
format: int64
message:
type: object
required:
- mid
- text
properties:
mid:
type: string
description:
An identifier for the message sent. Used by the
adapter to track the messages.
text:
type: string
description:
The conversation's keyword or the conversations UUID.
trigger_params:
type: object
properties:
override_session:
type: boolean
consumer:
type: object
properties:
id:
type: string
email:
type: string
format: email
custom:
description:
A dictionary with the custom parameters, mapped
to fields in Medallia Reporting via survey
parameters.
type: object
additionalProperties:
type: string
DeliveryStatusUpdate:
type: object
required:
- id
- time
- messaging
properties:
id:
type: string
description:
The PageId value configured in Medallia Conversations when
the channel is created.
time:
type: integer
format: int64
description:
Unix epoch timestamp of the last event associated with
the request. For example, when it is a multi-part message,
this is the time of the last message-part.
messaging:
type: array
items:
type: object
properties:
sender:
type: object
properties:
id:
type: string
description:
An identifier unique to the customer, such as
phone number, email, or other channel-specific
value. For phone numbers, the ID must be in
E.164 format.
recipient:
type: object
properties:
id:
type: string
description:
The PageId value configured in Medallia Conversations
when the channel is created.
timestamp:
type: integer
format: int64
delivery:
type: object
required:
- mids
- status
properties:
mids:
type: array
items:
type: string
description:
An array of message IDs. Used by the adapter to
track the messages.
status:
type: string
error:
type: object
required:
- code
- message
- name
properties:
code:
type: string
enum: [ failed, sent, delivered, undelivered ]
name:
type: string
message:
type: string
ErrorResponse:
type: object
required:
- statusCode
- error
- message
properties:
statusCode:
type: integer
description: The HTTP status code.
error:
type: string
description: The error code.
message:
type: string
description: The error message.
securitySchemes:
conversationsOauth:
type: oauth2
flows:
clientCredentials:
tokenUrl: https://{conversations-api-gateway-hostname}/oauth/{company}/token
scopes: {}