-
Notifications
You must be signed in to change notification settings - Fork 57
/
swagger.yaml
783 lines (750 loc) · 20.4 KB
/
swagger.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
swagger: '2.0'
schemes:
- http
host: localhost:8911
basePath: /api/v2
info:
description: |
# Introduction
The Developer API allows our more advanced users to interact with Mix It Up using external or customized programs. To use this feature, ensure the Developer API is enabled on the Services page. All APIs are REST-like endpoints that you can perform calls receiving/using JSON text. All endpoints begin with the base address of http://localhost:8911/api/v2/
version: '2.0.0'
title: Mix It Up Developer API
produces:
- application/json
consumes:
- application/json
tags:
- name: User
description: Operations related to Mix It Up User data
- name: Currency
description: Operations related to Mix It Up Currency data
- name: Chat
description: Operations related to Mix It Up Chat
- name: Commands
description: Operations related to Mix It Up Commands
- name: Inventory
description: Operations related to Mix It Up Inventory data
paths:
'/users/{userId}':
parameters:
- name: userId
in: path
description: 'The Mix It Up user ID that needs to be fetched'
required: true
type: string
format: uuid
get:
tags:
- User
summary: Get user data by Mix It Up user ID
operationId: userId
produces:
- application/json
responses:
'200':
description: Success
schema:
$ref: '#/definitions/MixItUpUser'
'404':
description: User not found
schema:
$ref: '#/definitions/Error'
'/users/{platform}/{usernameOrID}':
parameters:
- name: platform
in: path
description: 'The name of the streaming platform (EX: Twitch, YouTube, etc.)'
required: true
type: string
- name: usernameOrID
in: path
description: 'The platform username or ID that needs to be fetched'
required: true
type: string
get:
tags:
- User
summary: Get user data by platform username or ID
operationId: getPlatformUserByUsernameOrID
produces:
- application/json
responses:
'200':
description: Success
schema:
$ref: '#/definitions/MixItUpUser'
'404':
description: User not found
schema:
$ref: '#/definitions/Error'
'/users':
parameters:
- name: skip
in: query
description: 'How many users to skip'
required: true
type: string
- name: pageSize
in: query
description: 'The total number of users to return'
required: true
type: string
get:
summary: This API can be used to lookup multiple users at once.
tags:
- User
produces:
- application/json
responses:
'200':
description: Success
schema:
$ref: '#/definitions/ListOfMixItUpUsers'
'400':
description: Bad request was sent in
schema:
$ref: '#/definitions/Error'
'/users/active':
parameters:
- name: skip
in: query
description: 'How many users to skip'
required: true
type: string
- name: pageSize
in: query
description: 'The total number of users to return'
required: true
type: string
get:
summary: This API can be used to lookup multiple active users at once.
tags:
- User
produces:
- application/json
responses:
'200':
description: Success
schema:
$ref: '#/definitions/ListOfMixItUpUsers'
'400':
description: Bad request was sent in
schema:
$ref: '#/definitions/Error'
'/currency':
get:
tags:
- Currency
summary: Gets a list of all currencies available.
operationId: getAllCurrencies
produces:
- application/json
responses:
'200':
description: Success
schema:
$ref: '#/definitions/ListOfMixItUpCurrency'
'/currency/{currencyId}/{userId}':
parameters:
- name: currencyId
in: path
description: 'The currency ID to query'
required: true
type: string
format: uuid
- name: userId
in: path
description: 'The Mix It Up user ID to query for'
required: true
type: string
format: uuid
get:
tags:
- Currency
summary: Gets the currency amount for a specific user
operationId: getCurrencyById
produces:
- application/json
responses:
'200':
description: Success
schema:
type: integer
'404':
description: The currency could not be found.
schema:
$ref: '#/definitions/Error'
patch:
tags:
- Currency
summary: Updates the currency amount for a specific user
operationId: patchCurrencyById
parameters:
- name: updateAmount
description: 'The amount to update the currency by'
in: body
required: true
schema:
$ref: '#/definitions/UpdateCurrencyAmount'
produces:
- application/json
responses:
'200':
description: Success
schema:
type: integer
'404':
description: The currency could not be found.
schema:
$ref: '#/definitions/Error'
put:
tags:
- Currency
summary: Set the currency amount for a specific user
operationId: putCurrencyById
parameters:
- name: updateAmount
description: 'The amount to set the currency to'
in: body
required: true
schema:
$ref: '#/definitions/UpdateCurrencyAmount'
produces:
- application/json
responses:
'200':
description: Success
schema:
type: integer
'404':
description: The currency could not be found.
schema:
$ref: '#/definitions/Error'
'/chat/message':
post:
tags:
- Chat
summary: Sends a message to the chat
operationId: sendChatMessage
parameters:
- name: chatMessage
description: 'The chat message to send'
in: body
required: true
schema:
$ref: '#/definitions/MixItUpChatMessage'
produces:
- application/json
responses:
'200':
description: Success
'400':
description: Bad request was sent in
schema:
$ref: '#/definitions/Error'
'/chat/clear':
post:
tags:
- Chat
summary: Clears the chat for all connected platforms
operationId: clearChat
produces:
- application/json
responses:
'200':
description: Success
'400':
description: Bad request was sent in
schema:
$ref: '#/definitions/Error'
'/commands':
get:
parameters:
- name: skip
in: query
description: 'How many commands to skip'
required: true
type: string
- name: pageSize
in: query
description: 'The total number of commands to return'
required: true
type: string
tags:
- Commands
summary: Gets a list of all commands available.
operationId: getAllCommands
produces:
- application/json
responses:
'200':
description: Success
schema:
$ref: '#/definitions/ListOfMixItUpCommands'
'/commands/{commandId}':
parameters:
- name: commandId
in: path
description: 'The command ID to query'
required: true
type: string
format: uuid
get:
tags:
- Commands
summary: Gets the requested command.
operationId: getCommand
produces:
- application/json
responses:
'200':
description: Success
schema:
$ref: '#/definitions/MixItUpCommand'
'404':
description: The command could not be found.
schema:
$ref: '#/definitions/Error'
post:
tags:
- Commands
summary: Used to run the requested command.
operationId: runCommand
parameters:
- name: parameters
description: 'The parameters to run the command'
in: body
required: true
schema:
$ref: '#/definitions/MixItUpCommandParameters'
produces:
- application/json
responses:
'200':
description: Success
'404':
description: The command could not be found.
schema:
$ref: '#/definitions/Error'
'/commands/{commandId}/state/{state}':
parameters:
- name: commandId
in: path
description: 'The command ID to query'
required: true
type: string
format: uuid
- name: state
in: path
description: 'The state to update the command to (0 = Disabled, 1 = Enabled, 2 = Toggle)'
required: true
type: integer
patch:
tags:
- Commands
summary: Updates the command's state'.
operationId: updateCommandState
produces:
- application/json
responses:
'200':
description: Success
schema:
$ref: '#/definitions/MixItUpCommand'
'404':
description: The command could not be found.
schema:
$ref: '#/definitions/Error'
'/inventory':
get:
tags:
- Inventory
summary: Gets a list of all inventories available.
operationId: getAllInventories
produces:
- application/json
responses:
'200':
description: Success
schema:
$ref: '#/definitions/ListOfMixItUpInventory'
'/inventory/{inventoryId}/{userId}':
parameters:
- name: inventoryId
in: path
description: 'The inventory ID to query'
required: true
type: string
format: uuid
- name: userId
in: path
description: 'The Mix It Up user ID to query'
required: true
type: string
format: uuid
get:
tags:
- Inventory
summary: Gets a specific inventory for a specific user
operationId: getInventoryById
produces:
- application/json
responses:
'200':
description: Success
schema:
$ref: '#/definitions/ListOfMixItUpInventoryItemAmount'
'404':
description: The inventory could not be found.
schema:
$ref: '#/definitions/Error'
'/inventory/{inventoryId}/{itemId}/{userId}':
parameters:
- name: inventoryId
in: path
description: 'The inventory ID to query'
required: true
type: string
format: uuid
- name: itemId
in: path
description: 'The inventory item ID to query'
required: true
type: string
format: uuid
- name: userId
in: path
description: 'The Mix It Up user ID to query for'
required: true
type: string
format: uuid
get:
tags:
- Inventory
summary: Gets the inventory item amount for a specific user
operationId: getInventoryItemById
produces:
- application/json
responses:
'200':
description: Success
schema:
type: integer
'404':
description: The inventory item could not be found.
schema:
$ref: '#/definitions/Error'
patch:
tags:
- Inventory
summary: Updates the inventory item amount for a specific user
operationId: patchInventoryItemById
parameters:
- name: updateAmount
description: 'The amount to update the inventory item by'
in: body
required: true
schema:
$ref: '#/definitions/UpdateInventoryAmount'
produces:
- application/json
responses:
'200':
description: Success
schema:
type: integer
'404':
description: The inventory item could not be found.
schema:
$ref: '#/definitions/Error'
put:
tags:
- Inventory
summary: Set the inventory item amount for a specific user
operationId: putInventoryById
parameters:
- name: updateAmount
description: 'The amount to set the inventory item to'
in: body
required: true
schema:
$ref: '#/definitions/UpdateInventoryAmount'
produces:
- application/json
responses:
'200':
description: Success
schema:
type: integer
'404':
description: The inventory item could not be found.
schema:
$ref: '#/definitions/Error'
'/status/version':
get:
tags:
- Status
summary: Gets the Mix It Up version number
operationId: statusVersion
produces:
- application/json
responses:
'200':
description: Success
schema:
type: string
example: 1.0.0.0
'400':
description: Bad request was sent in
schema:
$ref: '#/definitions/Error'
definitions:
MixItUpUser:
type: object
required: [ ID ]
properties:
ID:
description: The Mix It Up User ID.
type: string
format: uuid
example: 137CD793-F4E7-4330-8282-B06E52644F78
PlatformData:
type: object
additionalProperties:
$ref: '#/definitions/MixItUpPlatformUser'
LastActivity:
description: The last date time of activity.
type: string
LastUpdated:
description: The last date time of updates.
type: string
OnlineViewingMinutes:
description: The total number of online viewing minutes in your stream.
type: integer
example: 1234567890
CustomTitle:
description: The user's custom title.
type: string
example: Ultimate
IsSpecialtyExcluded:
description: Whether the user is a specialty excluded user.
type: boolean
example: false
Notes:
description: The notes for the user.
type: string
example: Is a lovely person
CurrencyAmounts:
type: object
additionalProperties:
type: integer
InventoryAmounts:
type: object
additionalProperties:
type: object
additionalProperties:
type: integer
StreamPassAmounts:
type: object
additionalProperties:
type: integer
MixItUpPlatformUser:
type: object
required: [ ID, ViewingMinutes, CurrencyAmounts ]
properties:
Platform:
description: The Platform name.
type: string
example: Twitch
ID:
description: The Platform user ID.
type: string
example: 1234567890
Username:
description: The Platform username.
type: string
example: saviorxtanren
DisplayName:
description: The Platform display name.
type: string
example: SaviorXTanren
AvatarLink:
description: The Platform avatar URL.
type: string
SubscriberBadgeLink:
description: The Platform subscriber badge URL.
type: string
RoleBadgeLink:
description: The Platform role badge URL.
type: string
SpecialtyBadgeLink:
description: The Platform specialty badge URL.
type: string
Roles:
type: array
description: The list of Platform roles.
items:
type: string
AccountDate:
description: The platform account date.
type: string
FollowDate:
description: The platform follow date.
type: string
SubscribeDate:
description: The platform subscriber date.
type: string
SubscriberTier:
description: The platform subscriber tier.
type: integer
ListOfMixItUpUsers:
type: array
items:
$ref: '#/definitions/MixItUpUser'
UpdateCurrencyAmount:
type: object
required: [ Amount ]
properties:
Amount:
description: The amount to adjust the user's currency. This amount may be positive or negative.
type: integer
MixItUpCurrency:
type: object
required: [ ID, Name ]
properties:
ID:
description: The Mix It Up currency ID.
type: string
format: uuid
example: 1783e5d9-c2ab-423a-ae64-7dc9a086b194
Name:
description: The Mix It Up currency name.
type: string
example: Influence
ListOfMixItUpCurrency:
type: array
items:
$ref: '#/definitions/MixItUpCurrency'
UpdateInventoryAmount:
type: object
required: [ Amount ]
properties:
Amount:
description: The amount to adjust the user's inventory item. This amount may be positive or negative.
type: integer
MixItUpInventoryItemAmount:
type: object
required: [ ID, Name, Items ]
properties:
ID:
description: The Mix It Up inventory item ID.
type: string
format: uuid
Name:
description: The Mix It Up inventory item name.
type: string
example: Influence
Amount:
description: The amount of this item the user has.
type: integer
example: 2751
ListOfMixItUpInventoryItemAmount:
type: array
items:
$ref: '#/definitions/MixItUpInventoryItemAmount'
MixItUpInventoryItem:
type: object
required: [ ID, Name ]
properties:
ID:
description: The Mix It Up inventory item ID.
type: string
format: uuid
example: 1783e5d9-c2ab-423a-ae64-7dc9a086b194
Name:
description: The Mix It Up inventory item name.
type: string
example: Influence
MixItUpInventory:
type: object
required: [ ID, Name ]
properties:
ID:
description: The Mix It Up inventory ID.
type: string
format: uuid
example: 1783e5d9-c2ab-423a-ae64-7dc9a086b194
Name:
description: The Mix It Up inventory name.
type: string
example: Equipment
Items:
type: array
items:
$ref: '#/definitions/MixItUpInventoryItem'
ListOfMixItUpInventory:
type: array
items:
$ref: '#/definitions/MixItUpInventory'
MixItUpCommand:
required: [ ID, Name, IsEnabled, Category ]
type: object
properties:
ID:
description: The Mix It Up command ID.
type: string
format: uuid
example: 1783e5d9-c2ab-423a-ae64-7dc9a086b194
Name:
description: The Mix It Up command name.
type: string
Type:
description: The Mix It Up command type.
type: string
IsEnabled:
description: True if enabled, false otherwise
type: boolean
Unlocked:
description: Whether the command is unlocked or not.
type: boolean
GroupName:
description: The name of the group the command belongs to, if any.
type: string
ListOfMixItUpCommands:
type: array
items:
$ref: '#/definitions/MixItUpCommand'
MixItUpCommandParameters:
type: object
properties:
Platform:
description: The streaming platform to send the message to.
type: string
example: Twitch
Arguments:
description: The arguments for the command.
type: string
MixItUpChatMessage:
required: [ Message ]
type: object
properties:
Message:
description: The message to send to chat.
type: string
example: This is a test of the emergency broadcast system!
Platform:
description: The streaming platform to send the message to.
type: string
example: Twitch
SendAsStreamer:
description: True will force the message to send as the streamer. False will try to send as the registered bot, if available.
type: boolean
example: false
default: false
Error:
type: object
required: [ Message ]
properties:
Message:
description: "A description of the problem."
type: string