-
Notifications
You must be signed in to change notification settings - Fork 6
/
OpenAPI-v2.yml
1906 lines (1902 loc) · 54.4 KB
/
OpenAPI-v2.yml
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
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
openapi: 3.1.0
info:
title: TruckersMP API
version: '2.0'
x-logo:
url: 'https://truckersmp.com/assets/img/truckersmp-logo-black.png'
href: 'https://truckersmp.com'
servers:
- url: 'https://api.truckersmp.com/v2'
description: V2 - Production
paths:
'/player/{id}':
parameters:
- schema:
type: integer
name: id
in: path
required: true
description: SteamID64 or TruckersMP ID
get:
summary: Fetch player information
tags:
- Players
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
error:
type: boolean
default: false
description: If any error occurred during the request
response:
$ref: '#/components/schemas/Player'
required:
- error
'404':
description: Not Found
content:
application/json:
schema:
description: ''
type: object
properties:
error:
type: boolean
default: true
descriptor:
type: string
example: Unable to find player with that ID.
response:
type: string
example: Unable to find player with that ID.
deprecated: true
required:
- error
- response
operationId: get-player-id
description: |-
Lookup player information
**NOTE**: The API will respond with a 200 instead of 404 status code, but will have the respected body.
'/bans/{id}':
parameters:
- schema:
type: string
name: id
in: path
required: true
description: SteamID64 or TruckersMP ID
get:
summary: Fetch player bans
tags:
- Players
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
error:
type: boolean
default: false
description: If any error occurred during the request
response:
type: array
items:
$ref: '#/components/schemas/Ban'
required:
- error
'404':
description: Not Found
content:
application/json:
schema:
description: ''
type: object
properties:
error:
type: boolean
default: true
descriptor:
type: string
example: Invalid user ID
required:
- error
- descriptor
operationId: get-bans-id
description: |-
Latest 5 bans for a selected user if bans are not hidden or user has no bans. Fetch the player information to check if user is currently banned
For the user to be banned the `expiration` date has to be passed or `active` has to be false.
**NOTE**: The API will respond with a 200 instead of 404 status code, but will have the respected body.
/servers:
get:
summary: Fetch all the available servers
tags:
- Servers
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
error:
type: boolean
default: false
description: If any error occurred during the request
response:
type: array
items:
$ref: '#/components/schemas/Server'
required:
- error
operationId: get-servers
description: List of available TruckersMP servers and their status
/game_time:
get:
summary: Fetch the current in-game time
tags:
- Servers
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
error:
type: boolean
default: false
description: If any error occurred during the request
game_time:
type: integer
description: Game time returned in minutes (10 real seconds is 1 minute in-game)
required:
- error
- game_time
operationId: get-game_time
description: |-
The current in-game time.
Game time is expressed in minutes, where 10 real seconds is 1 minute of in-game time. It is number of minutes since 2015-25-10 15:48:32 CET.
Note: Game time may not be exact as time will drift.
/events:
get:
summary: 'Fetch all the current, upcoming, and featured events'
tags:
- Events
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
error:
type: boolean
default: false
description: If any error occurred during the request
response:
type: object
properties:
featured:
type: array
items:
$ref: '#/components/schemas/EventIndex'
today:
type: array
items:
$ref: '#/components/schemas/EventIndex'
now:
type: array
items:
$ref: '#/components/schemas/EventIndex'
upcoming:
type: array
items:
$ref: '#/components/schemas/EventIndex'
required:
- error
operationId: get-v2-events
description: 'List all of the current, upcoming, and featured TruckersMP events.'
parameters: []
'/events/{id}':
parameters:
- schema:
type: string
name: id
in: path
required: true
description: Event ID
get:
summary: Fetch the specified event
tags:
- Events
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
error:
type: boolean
default: false
description: If any error occurred during the request
response:
$ref: '#/components/schemas/Event'
required:
- error
examples: {}
'404':
$ref: '#/components/responses/PageNotFound'
operationId: get-events-id
'/events/user/{id}':
parameters:
- schema:
type: string
name: id
in: path
required: true
description: User ID
get:
summary: Fetch all the events from the specified user
tags:
- Events
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
error:
type: boolean
default: false
description: If any error occurred during the request
response:
type: array
items:
$ref: '#/components/schemas/EventIndex'
required:
- error
'404':
$ref: '#/components/responses/PageNotFound'
operationId: get-user-id-events
/vtc:
get:
summary: 'Fetch all the recent, featured, and featured cover VTCs'
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
error:
type: boolean
default: false
description: If any error occurred during the request
response:
type: object
properties:
recent:
type: array
items:
$ref: '#/components/schemas/VTCIndex'
featured:
type: array
items:
$ref: '#/components/schemas/VTCIndex'
featured_cover:
type: array
items:
$ref: '#/components/schemas/VTCIndex'
required:
- recent
- featured
- featured_cover
required:
- error
operationId: get-vtc
tags:
- Virtual Trucking Companies
'/vtc/{id}':
parameters:
- schema:
type: string
name: id
in: path
required: true
description: VTC ID
get:
summary: Fetch the specified VTC
tags:
- Virtual Trucking Companies
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
error:
type: boolean
default: false
description: If any error occurred during the request
response:
$ref: '#/components/schemas/VTC'
required:
- error
'404':
$ref: '#/components/responses/PageNotFound'
operationId: get-vtc-id
'/vtc/{id}/news':
parameters:
- schema:
type: string
name: id
in: path
required: true
description: VTC ID
get:
summary: Fetch all the news from the specified VTC
tags:
- Virtual Trucking Companies
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
error:
type: boolean
default: false
description: If any error occurred during the request
response:
type: object
properties:
news:
type: array
items:
$ref: '#/components/schemas/VTCNewsIndex'
required:
- error
'404':
$ref: '#/components/responses/PageNotFound'
operationId: get-vtc-id-news
'/vtc/{id}/news/{news_id}':
parameters:
- schema:
type: string
name: id
in: path
required: true
description: VTC ID
- schema:
type: string
name: news_id
in: path
required: true
description: News Article ID
get:
summary: Fetch the specified news article from the specified VTC
tags:
- Virtual Trucking Companies
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
error:
type: boolean
default: false
description: If any error occurred during the request
response:
$ref: '#/components/schemas/VTCNews'
required:
- error
'404':
$ref: '#/components/responses/PageNotFound'
operationId: get-vtc-id-news-news_id
'/vtc/{id}/roles':
parameters:
- schema:
type: string
name: id
in: path
required: true
description: VTC ID
get:
summary: Fetch all the roles from the specified VTC
tags:
- Virtual Trucking Companies
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
error:
type: boolean
default: false
description: If any error occurred during the request
response:
type: object
properties:
roles:
type: array
items:
$ref: '#/components/schemas/VTCRole'
required:
- error
- response
'404':
$ref: '#/components/responses/PageNotFound'
operationId: get-vtc-id-roles
'/vtc/{id}/role/{role_id}':
parameters:
- schema:
type: string
name: id
in: path
required: true
description: VTC ID
- schema:
type: string
name: role_id
in: path
required: true
description: Role ID
get:
summary: Fetch the specified role from the specified VTC
tags:
- Virtual Trucking Companies
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
error:
type: boolean
default: false
description: If any error occurred during the request
response:
$ref: '#/components/schemas/VTCRole'
required:
- error
'404':
$ref: '#/components/responses/PageNotFound'
operationId: get-vtc-id-role-role_id
'/vtc/{id}/members':
parameters:
- schema:
type: string
name: id
in: path
required: true
description: VTC ID
get:
summary: Fetch all the members from the specified VTC
tags:
- Virtual Trucking Companies
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
error:
type: boolean
default: false
description: If any error occurred during the request
response:
type: object
properties:
members:
type: array
items:
$ref: '#/components/schemas/VTCMember'
required:
- error
'404':
$ref: '#/components/responses/PageNotFound'
operationId: get-vtc-id-members
'/vtc/{id}/member/{member_id}':
parameters:
- schema:
type: string
name: id
in: path
required: true
description: VTC ID
- schema:
type: string
name: member_id
in: path
required: true
description: "Member ID. **NOTE** This is the user's VTC member ID, which is different to their TruckersMP User ID. The member ID can be found by accessing the GET /vtc/{id}/members endpoint"
get:
summary: Fetch the specified member from the specified VTC
tags:
- Virtual Trucking Companies
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
error:
type: boolean
default: false
description: If any error occurred during the request
response:
$ref: '#/components/schemas/VTCMember'
required:
- error
'404':
$ref: '#/components/responses/PageNotFound'
operationId: get-vtc-id-member-member_id
'/vtc/{id}/events':
parameters:
- schema:
type: string
name: id
in: path
required: true
description: VTC ID
get:
summary: Fetch all the events from the specified VTC
tags:
- Virtual Trucking Companies
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
error:
type: boolean
default: false
description: If any error occurred during the request
response:
type: array
items:
$ref: '#/components/schemas/EventIndex'
required:
- error
'404':
$ref: '#/components/responses/PageNotFound'
operationId: get-vtc-id-events
'/vtc/{id}/events/{event_id}':
parameters:
- schema:
type: string
name: id
in: path
required: true
description: VTC ID
- schema:
type: string
name: event_id
in: path
required: true
description: Event ID
get:
summary: Fetch the specified event from the specified VTC
tags:
- Virtual Trucking Companies
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
error:
type: boolean
default: false
description: If any error occurred during the request
response:
$ref: '#/components/schemas/Event'
required:
- error
'404':
$ref: '#/components/responses/PageNotFound'
operationId: get-vtc-id-events-event_id
'/vtc/{id}/events/attending':
parameters:
- schema:
type: string
name: id
in: path
required: true
description: VTC ID
get:
summary: Fetch the attending events from the specified VTC
tags:
- Virtual Trucking Companies
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
error:
type: boolean
default: false
description: If any error occurred during the request
response:
$ref: '#/components/schemas/Event'
required:
- error
'404':
$ref: '#/components/responses/PageNotFound'
operationId: get-vtc-id-events-attending
/version:
get:
summary: Fetch the current TruckersMP version for ETS2 and ATS
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/Version'
operationId: get-version
tags:
- Game Information
/rules:
get:
summary: Fetch the current in-game rules
responses:
'200':
description: OK
content:
application/json:
schema:
description: ''
type: object
properties:
error:
type: boolean
default: false
description: If any error occurred during the request
rules:
type: string
description: Markdown of the current in-game rules
revision:
type: number
description: Version number
required:
- error
- rules
- revision
operationId: get-rules
description: ''
tags:
- Game Information
components:
schemas:
Version:
description: ''
type: object
properties:
name:
type: string
description: Name of the current version
numeric:
type: string
description: Numeric name of the current version
stage:
type: string
description: Current stage in the development process
ets2mp_checksum:
type: object
required:
- dll
- adb
properties:
dll:
type: string
description: Checksum of core.dll
adb:
type: string
description: Checksum of data1.adb
atsmp_checksum:
type: object
required:
- dll
- adb
properties:
dll:
type: string
description: Checksum of core.dll
adb:
type: string
description: Checksum of data1.adb
time:
type: string
description: The time that the version was released
supported_game_version:
type: string
description: ETS2 version that is supported
supported_ats_game_version:
type: string
description: ATS version that is supported
required:
- name
- numeric
- stage
- ets2mp_checksum
- atsmp_checksum
- time
- supported_game_version
- supported_ats_game_version
Player:
description: ''
type: object
properties:
id:
type: number
description: The ID of the user requested
name:
type: string
description: The name of the user
avatar:
type: string
description: URL to the avatar used on the website
smallAvatar:
type: string
description: URL to the avatar used on the website (32px x 32px)
joinDate:
type: string
description: The date and time the user registered (UTC)
steamID64:
type: number
description: The SteamID64 of the user
steamID:
type: string
description: The SteamID64 of the user
discordSnowflake:
type: string
description: The Discord account linked to the user or null if not linked or private
displayVTCHistory:
type: boolean
description: Is the user's VTC History visible
groupName:
type: string
description: The name of the group the user belongs to
groupColor:
type: string
description: The color of the group
groupID:
type: number
description: The ID of the group the user belongs to
banned:
type: boolean
description: If the user is currently banned
bannedUntil:
type: string
description: The date and time the ban will expire (UTC) or `null` if not banned or ban is permanent
bansCount:
type: integer
description: The number of active bans a user has or `null` if staff
displayBans:
type: boolean
description: If the user has their bans hidden
patreon:
type: object
required:
- isPatron
- active
properties:
isPatron:
type: boolean
description: If the user has donated or is currently donating via Patreon
active:
type: boolean
description: If the user has an active Patreon subscription
color:
type: string
description: HEX code for subscribed tier
tierId:
type: integer
description: The tier ID of current pledge
currentPledge:
type: integer
description: Current pledge in cents
lifetimePledge:
type: integer
description: Lifetime pledge in cents
nextPledge:
type: integer
description: Next pledge in cents
hidden:
type: boolean
description: If user has their Patreon information hidden
permissions:
type: object
required:
- isStaff
- isUpperStaff
- isGameAdmin
- showDetailedOnWebMaps
properties:
isStaff:
type: boolean
description: If the user is a TruckersMP staff member
isUpperStaff:
type: boolean
description: If the user is part of upper staff within the TruckersMP team
isGameAdmin:
type: boolean
description: If the user has Game Moderator permissions
showDetailedOnWebMaps:
type: boolean
description: Always false
vtc:
type: object
required:
- id
- name
- tag
- inVTC
- memberID
properties:
id:
type: number
description: ID of the VTC the user belongs to or 0 if not in a VTC
name:
type: string
description: Name of the VTC the user belongs to or empty if not in a VTC
tag:
type: string
description: Tag of the VTC the user belongs to or empty if not in a VTC
inVTC:
type: boolean
description: If the user is in a VTC
memberID:
type: number
description: VTC member ID or 0 if not in a VTC
vtcHistory:
type: array
description: If the user do not allow to see their VTC history `null` will be returned
items:
$ref: '#/components/schemas/VTCHistory'
achievements:
type: array
description: If the user do not allow to see their achievements `null` will be returned
items:
type: object
properties:
id:
type: number
description: ID of the achievement
title:
type: string
description: Title of achievement
description:
type: string
description: Description of achievement
image_url:
type: string
description: Link to achievement image
achieved_at:
type: string
description: Date and time the user was given the achievement (UTC)
required:
- id
- title
- description
- image_url
- achieved_at
awards:
type: array
description: If the user do not allow to see their awards `null` will be returned
items:
type: object
properties:
id:
type: number
description: ID of the award
name:
type: string
description: Name of award
image_url:
type: string
description: Link to award image
awarded_at:
type: string
description: Date and time the user was given the award (UTC)
required:
- id
- name
- image_url
- awarded_at
required:
- id
- name
- avatar
- smallAvatar
- joinDate
- steamID64
- steamID
- displayVTCHistory
- groupName
- groupColor
- groupID
- banned
- displayBans
- patreon
- permissions
- vtc
Ban:
description: ''
type: object
properties:
expiration:
type: string
description: The time the ban will expire
timeAdded:
type: string
description: The time the ban was issued
active:
type: boolean
description: If the ban is still active or was disabled. When a ban was issued by mistake, staff may deactivate it manually but it still shows as inactive in the ban history. Does not change if the ban expires naturally on the expiration date.
reason:
type: string
description: The reason for the ban
adminName:
type: string
description: Name of the admin that banned the user. Generally redacted.
adminID:
type: number
description: TruckersMP ID for the admin that banned the user. Generally redacted.
required:
- expiration
- timeAdded
- active
- reason
- adminName
- adminID
Server:
description: ''
type: object