-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathspec.yaml
More file actions
2765 lines (2765 loc) · 81 KB
/
spec.yaml
File metadata and controls
2765 lines (2765 loc) · 81 KB
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.0.0
x-stoplight:
id: yu7gslmw7p8dt
info:
description: "All operations not tagged 'free' require an active [Ultimate](https://builtbybit.com/account/ultimate) subscription or invite-only permissions.\r\n\r\nV2 documentation: https://builtbybit.com/wiki/api-v2/ \\\r\nOAuth2 documentation: https://builtbybit.com/wiki/oauth2/"
version: v2
title: BuiltByBit API
termsOfService: 'https://builtbybit.com/wiki/terms'
contact:
url: 'https://builtbybit.com/ticket'
name: BuiltByBit
servers:
- description: BuiltByBit
url: 'https://api.builtbybit.com/'
tags:
- name: analytics
- name: events
- name: free
- name: health
- name: oauth2
- name: resources/buyer
- name: resources/creator
- name: resources/discovery
paths:
/oauth2/token:
post:
summary: Request an access token using an existing grant
tags:
- oauth2
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
access_token:
type: string
x-stoplight:
id: zsjt9ii4bl4p4
expires_in:
type: integer
x-stoplight:
id: w9gxdiz9y15yk
refresh_token:
type: string
x-stoplight:
id: c6b0c5o05iuva
scope:
type: string
x-stoplight:
id: th4bm8n8ri8yv
token_type:
type: string
x-stoplight:
id: 45ci7b7ac94e0
operationId: get-oauth2-token
x-stoplight:
id: e2kos61m784xx
parameters: []
requestBody:
content:
application/x-www-form-urlencoded:
schema:
type: object
required:
- grant_type
properties:
grant_type:
type: string
x-stoplight:
id: fel1kseew6q2q
example: authorization_code
code:
type: string
x-stoplight:
id: k4hmw14e1sycl
description: Required if grant_type = `authorization_code`.
refresh_token:
type: string
x-stoplight:
id: x37pvqrf2ewd8
description: Required if grant_type = `refresh_token`.
description: "Supported grant types: `authorization_code`, and `refresh_token`.\r\nMust authenticate via HTTP Basic Authentication, using your OAuth2 client credentials."
security:
- token: []
/oauth2/token/revoke:
post:
summary: Revoke an existing access or refresh token
tags:
- oauth2
responses:
'200':
description: OK
headers: {}
content:
application/json:
schema:
type: object
required:
- revoked
properties:
revoked:
type: boolean
x-stoplight:
id: rk9152aczpg27
default: true
operationId: get-oauth2-token-revoke
x-stoplight:
id: amvjs8enfwm15
requestBody:
content:
application/x-www-form-urlencoded:
schema:
type: object
required:
- token
properties:
token:
type: string
x-stoplight:
id: e5346lawffc2i
token_hint:
type: string
x-stoplight:
id: gpg14sbbeovih
parameters:
- $ref: '#/components/parameters/Authorization'
security:
- token: []
description: 'Must authenticate via HTTP Basic Authentication, using your OAuth2 client credentials.'
/v2/resources/discover/resources:
get:
summary: Fetch a list of resources
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
result:
type: string
x-stoplight:
id: dglyjliykl8du
example: success
default: sucess
data:
type: object
x-stoplight:
id: 2vibxcaob4nm2
required:
- resources
- stats
properties:
resources:
type: array
x-stoplight:
id: o8puq9d5e8lrd
items:
$ref: '#/components/schemas/Resource'
filters:
x-stoplight:
id: 0o7us2ki57uke
type: array
items:
$ref: '#/components/schemas/Filter'
stats:
$ref: '#/components/schemas/ListStats'
4XX:
$ref: '#/components/responses/Error'
5XX:
$ref: '#/components/responses/Error'
operationId: get-resources-discover-resources
x-stoplight:
id: p24j0imx0z6cc
parameters:
- schema:
type: string
in: query
name: category_id
description: 'A category ID to filter on. If the provided category is a parent, resources from subcategories will also be included.'
allowEmptyValue: false
- schema:
type: string
example: 'Description,Creator'
in: query
name: with
description: A comma-separated list of additional data to include. See endpoint documentation for more information.
style: form
- schema:
type: object
in: query
name: filters
description: A list of dynamic filters to apply.
explode: false
style: deepObject
- schema:
type: string
in: query
name: resource_ids
description: A comma-separated list of resource IDs to filter on.
style: form
- schema:
type: integer
default: 1
in: query
name: page
description: The page number to return.
- schema:
type: number
default: 25
maximum: 100
in: query
name: per_page
description: The number of resources to return per page.
- schema:
type: boolean
in: query
name: no_dependencies
description: "Supported 'with' hints:\r\n- `filters`: include dynamic filter information in the response.\r\n- See 'Resource' model for additional 'with' hints."
tags:
- resources/discovery
security:
- token: []
parameters: []
/v2/resources/discover/categories:
get:
summary: Fetch a list of categories
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
result:
x-stoplight:
id: xlgju922zbakq
enum:
- success
data:
type: object
x-stoplight:
id: qzpl0xc49xbqn
properties:
categories:
type: array
x-stoplight:
id: ypy1uslznrrg8
items:
$ref: '#/components/schemas/Category'
4XX:
$ref: '#/components/responses/Error'
5XX:
$ref: '#/components/responses/Error'
operationId: get-resources-discover-categories
x-stoplight:
id: 1wpuixx1xd8vo
parameters:
- schema:
type: string
in: query
name: category_id
description: A category ID to filter on.
- schema:
type: string
enum:
- SortOptions
- FilterOptions
in: query
name: with
description: A comma-separated list of submodels to include.
tags:
- resources/discovery
description: "Supported 'with' hints:\r\n- Children: includes all subcategories and their children"
security:
- token: []
parameters: []
/v2/resources/discover/licenses:
get:
summary: Fetch a list of the user's licenses
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
result:
x-stoplight:
id: n6seyo7ctng3b
enum:
- success
data:
type: object
x-stoplight:
id: ok6y9x8fnujrs
properties:
licenses:
type: array
x-stoplight:
id: ukpndrnv7kx4k
items:
$ref: '#/components/schemas/License'
stats:
$ref: '#/components/schemas/ListStats'
4XX:
$ref: '#/components/responses/Error'
5XX:
$ref: '#/components/responses/Error'
operationId: get-v2-resources-discover-licenses
x-stoplight:
id: 5ulsft847tbha
parameters:
- $ref: '#/components/parameters/page'
- $ref: '#/components/parameters/per_page'
- $ref: '#/components/parameters/with'
description: "Supported 'with' hints:\r\n- Resource: the resource the license is for if content_type = `resource`"
tags:
- resources/discovery
security:
- oauth2: []
/v2/resources/discover/cart/view:
get:
summary: View the user's cart items
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
required:
- result
- data
properties:
result:
x-stoplight:
id: nh2gpyez71rg4
enum:
- success
data:
type: object
x-stoplight:
id: s9eu4del2jl1o
required:
- items
- summary
properties:
items:
type: array
x-stoplight:
id: y5uutu1pll4ju
items:
$ref: '#/components/schemas/CartItem'
summary:
$ref: '#/components/schemas/CartSummary'
user:
$ref: '#/components/schemas/Member'
operationId: get-v2-resources-discover-cart-view
x-stoplight:
id: eikr4b3wx2qem
description: ''
tags:
- resources/discovery
security:
- oauth2: []
/v2/resources/discover/cart/add:
post:
summary: Add items to a user's cart
responses:
2XX:
description: Success
content:
application/json:
schema:
type: object
properties:
result:
type: string
x-stoplight:
id: 2frwalk3e6cdk
data:
type: string
x-stoplight:
id: oofrp2lorahcv
operationId: post-v2-resources-discover-cart-add
x-stoplight:
id: 91lnfa7dxz87w
requestBody:
content:
application/json:
schema:
type: object
properties:
add:
type: array
x-stoplight:
id: rypnfui87uxpw
items:
x-stoplight:
id: 17j3u2gvgn73u
type: array
items:
x-stoplight:
id: c1m7a3oenkptw
type: integer
description: "A list of content to add to the user's cart. The outer list is keyed by the content type and the inner list are the content IDs.\r\n\r\nFor instance, if adding a resource with the ID 555, the body becomes:\r\n```json\r\n{\"add\": {\"resource\": [555]}}\r\n```"
tags:
- resources/discovery
security:
- oauth2: []
/v2/resources/discover/cart/checkout:
post:
summary: Initiate a checkout of a user's cart
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
required:
- result
- data
properties:
result:
x-stoplight:
id: 0bq17xcx6sasp
enum:
- success
data:
type: object
x-stoplight:
id: t03u8ehqrfbfm
required:
- status
properties:
status:
x-stoplight:
id: cltailjstvwne
description: "`initiated` - the checkout request was successful and returned a Tebex basket identifier stored in the `ident` field.\r\n\r\n`bypassed` - the checkout was successful but no Tebex basket identifier was generated as it was not needed (perhaps because the buyer used a 100% off coupon)."
enum:
- initiated
- bypassed
ident:
type: string
x-stoplight:
id: 2dgphdqq1plwd
description: The Tebex cart identifier which you can use to redirect to or open a Tebex.js overlay.
url:
type: string
x-stoplight:
id: e3gsxaj64agkm
description: The Tebex checkout link to redirect to if not using Tebex.js (built from the included ident).
operationId: post-v2-resources-discover-cart-checkout
x-stoplight:
id: 0x1pcudppx63b
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/Empty'
tags:
- resources/discovery
security:
- oauth2: []
/v2/resources/discover/cart/remove:
post:
summary: Remove an item from the user's cart
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
result:
x-stoplight:
id: p1mprt5irhvp4
enum:
- success
data:
type: string
x-stoplight:
id: rrk17ep6tjvee
operationId: post-v2-resources-discover-cart-remove
x-stoplight:
id: 12m9v5ctkpynt
requestBody:
content:
application/json:
schema:
type: object
properties:
cart_item_id:
type: integer
x-stoplight:
id: ja4uc5cg03559
tags:
- resources/discovery
security:
- oauth2: []
/v2/resources/discover/cart/coupon/add:
post:
summary: Add a coupon to the user's cart
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
result:
x-stoplight:
id: ih2ptsykg2zfp
enum:
- success
data:
type: string
x-stoplight:
id: wy1y5k6tyj66w
operationId: post-v2-resources-discover-cart-coupon-add
x-stoplight:
id: g2gmfc32a3a14
requestBody:
content:
application/json:
schema:
type: object
properties:
code:
type: string
x-stoplight:
id: 4ojoigmv6ehl1
tags:
- resources/discovery
security:
- oauth2: []
parameters: []
/v2/resources/discover/cart/coupon/remove:
post:
summary: Remove a coupon from the user's cart
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
result:
x-stoplight:
id: zn9dfmuqpf8do
enum:
- success
data:
type: string
x-stoplight:
id: aw8s9itfrpeei
operationId: post-v2-resources-discover-cart-coupon-remove
x-stoplight:
id: bbvokgafxl9nf
requestBody:
content:
application/json:
schema:
type: object
properties:
code:
type: string
x-stoplight:
id: mlueurz12lym0
tags:
- resources/discovery
security:
- oauth2: []
/v2/events:
get:
summary: Fetch a list of pending events
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
result:
x-stoplight:
id: 3tmrr5vfrkfif
enum:
- success
data:
type: object
x-stoplight:
id: 4o0sz1pv0blqo
properties:
events:
type: array
x-stoplight:
id: uhm6rqy1zeb93
items:
$ref: '#/components/schemas/Event'
stats:
$ref: '#/components/schemas/ListStats'
operationId: get-v2-events
x-stoplight:
id: 00f4ahftly4s2
security:
- token: []
tags:
- events
/v2/events/complete:
post:
summary: Mark events as complete
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
result:
x-stoplight:
id: 43yhqm08jdpp7
enum:
- success
data:
type: string
x-stoplight:
id: kx5hd2kwivu68
operationId: post-v2-events-complete
x-stoplight:
id: f2lqrdli45xul
requestBody:
content:
application/json:
schema:
type: object
required:
- event_ids
properties:
event_ids:
type: array
x-stoplight:
id: k95upgj82o2zf
items:
x-stoplight:
id: 9ykv6yr4xaldk
type: integer
tags:
- events
/v2/analytics:
get:
summary: Fetch a list of analytics definitions
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
result:
x-stoplight:
id: qh5difwvjoizq
enum:
- success
data:
type: object
x-stoplight:
id: ylaffyg9gv5g0
properties:
analytics:
type: object
additionalProperties:
$ref: '#/components/schemas/Analytic'
operationId: get-v2-analytics
x-stoplight:
id: au6y5fszotgtf
security:
- token: []
tags:
- analytics
/v2/analytics/graph:
get:
summary: Fetch analytics graph data
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
result:
x-stoplight:
id: 2bq9is0ilhv95
enum:
- success
data:
$ref: '#/components/schemas/AnalyticGraphData'
operationId: get-v2-analytics-graph
x-stoplight:
id: 10brpg6zlz0yv
parameters:
- schema:
type: array
in: query
name: analytics
description: A list of analytic IDs to fetch data for.
style: form
- schema:
type: string
in: query
name: period
description: The time period to fetch data over.
- schema:
type: array
in: query
name: filters
description: A set of filters which may be used for the analytics.
- schema:
type: string
in: query
name: start_date
description: 'Only respected when ''period'' = ''custom_range'', in the format ''YYYY-MM-DD''.'
- schema:
type: string
in: query
name: end_date
description: 'Only respected when ''period'' = ''custom_range'', in the format ''YYYY-MM-DD''.'
security:
- token: []
tags:
- analytics
/v2/analytics/single:
get:
summary: Fetch a single analytics value
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
result:
x-stoplight:
id: xmfb8ky1vzpnt
enum:
- success
data:
type: object
x-stoplight:
id: ufpaq01g3dtbb
properties:
analytics:
type: object
x-stoplight:
id: jkvxuc40f3y2k
additionalProperties:
x-stoplight:
id: 7sqdxmtvvhdpe
type: number
period:
type: object
x-stoplight:
id: 0ignatns1rheq
properties:
period:
type: string
x-stoplight:
id: 8z61la6a08nvr
period_display:
type: string
x-stoplight:
id: uymu5p1qrdb8m
start_date:
type: string
x-stoplight:
id: 9tqnam1yqeh1v
end_date:
type: string
x-stoplight:
id: 9clfd4oneqi2b
operationId: get-v2-analytics-single
x-stoplight:
id: z0mpisnpeuegq
parameters:
- schema:
type: array
in: query
name: analytics
description: A list of analytic IDs to fetch data for.
explode: false
style: form
- schema:
type: string
in: query
name: period
description: The time period to fetch data over.
- schema:
type: array
in: query
name: filters
description: A set of filters which may be used for the analytics.
- schema:
type: string
in: query
name: start_date
description: 'Only respected when ''period'' = ''custom_range'', in the format ''YYYY-MM-DD''.'
- schema:
type: string
in: query
name: end_date
description: 'Only respected when ''period'' = ''custom_range'', in the format ''YYYY-MM-DD''.'
security:
- token: []
tags:
- analytics
/v2/resources/creator/update:
post:
summary: Post a resource update
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
required:
- result
- data
properties:
result:
x-stoplight:
id: exqnprziiwvbp
enum:
- success
data:
type: object
x-stoplight:
id: 344b8t2v40q02
required:
- version_id
properties:
update_id:
type: integer
x-stoplight:
id: dbrrg2c8zn7gp
version_id:
type: integer
x-stoplight:
id: dc1zs3jwc4eam
operationId: post-v2-resources-creator-update
x-stoplight:
id: wowhoeszq2hjg
requestBody:
content:
application/json:
schema:
type: object
required:
- resource_id
- version_name
- file
properties:
resource_id:
type: integer
x-stoplight:
id: cmtmq6rbwu7qg
version_name:
type: string
x-stoplight:
id: 8hv9lq3frpql9
description: 'The version name as a string (eg. 5.0, 5.0-stable). The final version name will be prepended with ''v'' (eg. v5.0, v5.0-stable).'
file:
type: object
x-stoplight:
id: 5u46zlge0nj6e
required:
- name
- data
properties:
name:
type: string
x-stoplight:
id: zbo1xazef8cb9
description: The name of the file (including extension).
data:
type: string
x-stoplight:
id: fw3l64sgufj9g
description: The base64 encoded file data.
update:
type: object
x-stoplight:
id: n2gw4000dvmce
properties:
post:
type: boolean
x-stoplight:
id: z62rbhal57j9a
description: Whether or not to post an update alongside the new version.
title:
type: string
x-stoplight:
id: odpb2hragka52
message:
type: string
x-stoplight:
id: nb28gbi9jdlg3
description: The BBCode-formatted body of the update.
description: "Creates a new version for the resource and optionally posts a public update message. The uploaded file must be encoded using base64 as part of the JSON request body shown below.\r\n\r\nThe request body (including the base64 encoded file data) cannot exceed 100MB. This roughly equates to a 67MB upload limit for the raw file when taking into account base64 encoding losses."
tags:
- resources/creator
security:
- token: []
/v2/resources/creator/resources:
get:
summary: Fetch a list of your resources
tags:
- resources/creator
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
result:
x-stoplight:
id: v5r96kr9dqwuo
enum:
- success
data:
type: object
x-stoplight:
id: dabofrq969z2z
properties:
resources:
type: array
x-stoplight:
id: d0f9nn42b377b
items:
$ref: '#/components/schemas/Resource'
stats:
$ref: '#/components/schemas/ListStats'
operationId: get-v2-resources-creator-resources
x-stoplight:
id: 103bx8jeqlgb9
security:
- token: []
parameters:
- schema:
type: array
in: query
name: resource_ids
description: A comma-separated list of resource IDs to filter on. No filter is applied if empty.
style: form
/v2/resources/creator/purchases:
get:
summary: Fetch a list of your resources' purchases
tags:
- resources/creator
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
result:
x-stoplight:
id: ijrkvq7e55lk7
enum:
- success
data:
type: object
x-stoplight:
id: rn50qk5cictkz
properties:
purchases:
type: array
x-stoplight:
id: okjk5uwg60bob
items:
$ref: '#/components/schemas/Purchase'