@@ -962,6 +962,36 @@ paths:
962
962
$ref : ' #/components/responses/NotAllowed'
963
963
' 500 ' :
964
964
$ref : ' #/components/responses/InternalError'
965
+ /answers/constructor :
966
+ post :
967
+ tags :
968
+ - messages
969
+ operationId : construct
970
+ description : |-
971
+ Sends answer on construction request. Answer can contain any prepared message and/or keyboard to help user interact with bot.
972
+ summary : Construct message
973
+ parameters :
974
+ - name : session_id
975
+ description : Constructor session identifier
976
+ required : true
977
+ in : query
978
+ schema :
979
+ type : string
980
+ requestBody :
981
+ required : true
982
+ content :
983
+ application/json :
984
+ schema :
985
+ $ref : ' #/components/schemas/ConstructorAnswer'
986
+ responses :
987
+ ' 200 ' :
988
+ $ref : ' #/components/responses/SuccessResponse'
989
+ ' 401 ' :
990
+ $ref : ' #/components/responses/Unauthorized'
991
+ ' 405 ' :
992
+ $ref : ' #/components/responses/NotAllowed'
993
+ ' 500 ' :
994
+ $ref : ' #/components/responses/InternalError'
965
995
/updates :
966
996
get :
967
997
operationId : getUpdates
@@ -1454,10 +1484,41 @@ components:
1454
1484
type : string
1455
1485
nullable : true
1456
1486
readOnly : false
1487
+ constructor :
1488
+ description : Bot-constructor created this message
1489
+ readOnly : false
1490
+ nullable : true
1491
+ allOf :
1492
+ - $ref : ' #/components/schemas/User'
1457
1493
required :
1458
1494
- recipient
1459
1495
- body
1460
1496
- timestamp
1497
+ ConstructedMessage :
1498
+ description : Message constructed i in chat
1499
+ properties :
1500
+ sender :
1501
+ description : User who sent this message
1502
+ allOf :
1503
+ - $ref : ' #/components/schemas/User'
1504
+ timestamp :
1505
+ description : Unix-time when message has been created
1506
+ type : integer
1507
+ format : int64
1508
+ link :
1509
+ description : ' Any linked message: forward or reply'
1510
+ nullable : true
1511
+ readOnly : false
1512
+ allOf :
1513
+ - $ref : ' #/components/schemas/LinkedMessage'
1514
+ body :
1515
+ description : Body of created message. Text + attachments
1516
+ allOf :
1517
+ - $ref : ' #/components/schemas/MessageBody'
1518
+ required :
1519
+ - sender
1520
+ - body
1521
+ - timestamp
1461
1522
MessageStat :
1462
1523
description : Message statistics
1463
1524
properties :
@@ -1626,6 +1687,28 @@ components:
1626
1687
type : object
1627
1688
allOf :
1628
1689
- $ref : ' #/components/schemas/MediaAttachmentPayload'
1690
+ thumbnail :
1691
+ description : Video thumbnail
1692
+ type : string
1693
+ nullable : true
1694
+ readOnly : false
1695
+ allOf :
1696
+ - $ref : ' #/components/schemas/PhotoAttachmentPayload'
1697
+ width :
1698
+ description : Video width
1699
+ type : integer
1700
+ nullable : true
1701
+ readOnly : false
1702
+ height :
1703
+ description : Video height
1704
+ type : integer
1705
+ nullable : true
1706
+ readOnly : false
1707
+ duration :
1708
+ description : Video duration in seconds
1709
+ type : integer
1710
+ nullable : true
1711
+ readOnly : false
1629
1712
required :
1630
1713
- payload
1631
1714
AudioAttachment :
@@ -2175,6 +2258,42 @@ components:
2175
2258
nullable : true
2176
2259
readOnly : false
2177
2260
type : string
2261
+ ConstructorAnswer :
2262
+ description : Bot's answer on construction request
2263
+ properties :
2264
+ messages :
2265
+ type : array
2266
+ description : Array of prepared messages. This messages will be sent as user taps on "Send" button
2267
+ readOnly : false
2268
+ items :
2269
+ $ref : ' #/components/schemas/NewMessageBody'
2270
+ allow_user_input :
2271
+ description : ' If `true` user can send any input manually. Otherwise, only keyboard will be shown'
2272
+ type : boolean
2273
+ readOnly : false
2274
+ hint :
2275
+ description : ' Hint to user. Will be shown on top of keyboard'
2276
+ nullable : true
2277
+ readOnly : false
2278
+ type : string
2279
+ data :
2280
+ description : |-
2281
+ In this property you can store any additional data up to 4KB. We send this data back to bot within the
2282
+ next construction request. It is handy to store here any state of construction session
2283
+ type : string,
2284
+ readOnly : false
2285
+ maxLength : 4096
2286
+ keyboard :
2287
+ description : ' Keyboard to show to user in constructor mode'
2288
+ nullable : true
2289
+ readOnly : false
2290
+ allOf :
2291
+ - $ref : ' #/components/schemas/Keyboard'
2292
+ placeholder :
2293
+ nullable : true
2294
+ readOnly : false
2295
+ description : ' Text to show over the text field of TamTam clients'
2296
+ type : string
2178
2297
Error :
2179
2298
description : Server returns this if there was an exception to your request
2180
2299
properties :
@@ -2253,6 +2372,8 @@ components:
2253
2372
user_removed : ' #/components/schemas/UserRemovedFromChatUpdate'
2254
2373
bot_started : ' #/components/schemas/BotStartedUpdate'
2255
2374
chat_title_changed : ' #/components/schemas/ChatTitleChangedUpdate'
2375
+ message_construction_request : ' #/components/schemas/MessageConstructionRequest'
2376
+ message_constructed : ' #/components/schemas/MessageConstructedUpdate'
2256
2377
message_chat_created : ' #/components/schemas/MessageChatCreatedUpdate'
2257
2378
properties :
2258
2379
update_type :
@@ -2440,6 +2561,85 @@ components:
2440
2561
- chat_id
2441
2562
- user
2442
2563
- title
2564
+ MessageConstructionRequest :
2565
+ description : Bot will get this update when user sent to bot any message or pressed button during construction process
2566
+ allOf :
2567
+ - $ref : ' #/components/schemas/Update'
2568
+ - properties :
2569
+ user :
2570
+ description : User who initiated this request
2571
+ allOf :
2572
+ - $ref : ' #/components/schemas/UserWithPhoto'
2573
+ user_locale :
2574
+ description : Current user locale in IETF BCP 47 format
2575
+ type : string
2576
+ readOnly : false
2577
+ session_id :
2578
+ description : Constructor session identifier
2579
+ type : string
2580
+ data :
2581
+ description : data received from previous `ConstructorAnswer`
2582
+ type : string
2583
+ readOnly : false
2584
+ nullable : true
2585
+ maxLength : 4096
2586
+ input :
2587
+ description : User's input. It can be message (text/attachments) or simple button's callback
2588
+ allOf :
2589
+ - $ref : ' #/components/schemas/ConstructorInput'
2590
+ required :
2591
+ - user
2592
+ - session_id
2593
+ - input
2594
+ ConstructorInput :
2595
+ description : It can be either message (text/attachments) or button callback
2596
+ discriminator :
2597
+ propertyName : input_type
2598
+ mapping :
2599
+ callback : ' #/components/schemas/CallbackConstructorInput'
2600
+ message : ' #/components/schemas/MessageConstructorInput'
2601
+ properties :
2602
+ input_type :
2603
+ type : string
2604
+ required :
2605
+ - input_type
2606
+ CallbackConstructorInput :
2607
+ description : Bot will get this input as soon as soon user taps on button created by bot in construction mode
2608
+ allOf :
2609
+ - $ref : ' #/components/schemas/ConstructorInput'
2610
+ - properties :
2611
+ payload :
2612
+ description : Pressed button payload
2613
+ type : string
2614
+ required :
2615
+ - payload
2616
+ MessageConstructorInput :
2617
+ description : Bot will get this input in case when user sends message to bot manually
2618
+ allOf :
2619
+ - $ref : ' #/components/schemas/ConstructorInput'
2620
+ - properties :
2621
+ messages :
2622
+ description : Messages sent by user during construction process. Typically it is single element array but sometimes it can contains multiple messages. Can be empty on initial request when user just opened constructor
2623
+ type : array
2624
+ nullable : true
2625
+ items :
2626
+ $ref : ' #/components/schemas/NewMessageBody'
2627
+ required :
2628
+ - messages
2629
+ MessageConstructedUpdate :
2630
+ description : Bot will get this update when constructed message has been posted to any chat
2631
+ allOf :
2632
+ - $ref : ' #/components/schemas/Update'
2633
+ - properties :
2634
+ session_id :
2635
+ description : Constructor session identifier
2636
+ type : string
2637
+ message :
2638
+ description : User message
2639
+ $ref : ' #/components/schemas/ConstructedMessage'
2640
+ required :
2641
+ - session_id
2642
+ - message
2443
2643
MessageChatCreatedUpdate :
2444
2644
description : Bot will get this update when chat has been created as soon as first user clicked chat button
2445
2645
allOf :
0 commit comments