-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebcert.yaml
1334 lines (1325 loc) · 41 KB
/
webcert.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
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.3
info:
title: NFT Certificate
version: 1.0.0
contact: {}
servers:
- url: "https://staging-certapi.2p5.io"
description: NFT API
- url: "https://staging-api.2p5.io"
description: Staging Wallet Server
paths:
# AUTH
/auth/sign-in:
servers:
- url: "https://staging-api.2p5.io"
description: Staging Wallet Server
post:
tags:
- Auth
summary: Sign In
description: Sign In
operationId: signIn
requestBody:
content:
application/json:
schema:
type: object
properties:
phone_number:
type: string
example: "6285273839851"
example:
phone_number: "6285273839851"
responses:
"200":
description: Success
content:
application/json:
schema:
type: object
properties:
status:
type: string
example: success
mesage:
type: string
example: OTP was sent to xx
data:
type: string
example: success
examples:
Success:
value:
status: success
message: success request OTP
data: success
/v2/auth/otp/verification/sign-in:
servers:
- url: "https://staging-api.2p5.io"
description: Staging Wallet Server
post:
tags:
- Auth
summary: Verify OTP for Sign In
description: Verify OTP for Sign In
operationId: verifyOtpForSignIn
requestBody:
content:
application/json:
schema:
type: object
properties:
otp:
type: string
example: "315865"
phone_number:
type: string
example: "6285273839851"
example:
otp: "315865"
phone_number: "6285273839851"
responses:
"200":
description: Success
content:
application/json:
schema:
type: object
properties:
data:
type: object
properties:
token:
type: string
example: >-
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoiMSIsInBob25lX251bWJlciI6IjYyODEyMzQ1Njc4OSIsInBpbiI6dHJ1ZSwiaXNzIjoiMnA1LmlvIiwiZXhwIjoxNjc3MTQ1NDQzLCJpYXQiOjE2NzQ1NTM0NDN9.xYQJ3xB4PrRczGn_oYFhqrwwDulYfERpNGHE9g6zDd8
message:
type: string
example: OTP is valid
status:
type: string
example: success
examples:
Success:
value:
data:
token: >-
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoiMSIsInBob25lX251bWJlciI6IjYyODEyMzQ1Njc4OSIsInBpbiI6dHJ1ZSwiaXNzIjoiMnA1LmlvIiwiZXhwIjoxNjc3MTQ1NDQzLCJpYXQiOjE2NzQ1NTM0NDN9.xYQJ3xB4PrRczGn_oYFhqrwwDulYfERpNGHE9g6zDd8
message: OTP is valid
status: success
/auth/pin/create:
servers:
- url: "https://staging-api.2p5.io"
description: Staging Wallet Server
post:
tags:
- Auth
summary: Set PIN
description: Set PIN
operationId: setPin
requestBody:
content:
application/json:
schema:
type: object
properties:
pin:
type: string
example: "123456"
example:
pin: "123456"
responses:
"200":
description: Success
content:
application/json:
schema:
type: object
properties:
data:
nullable: true
example: null
message:
type: string
example: PIN is updated. Please refresh token
status:
type: string
example: success
examples:
Success:
value:
data: null
message: PIN is updated. Please refresh token
status: success
/v2/auth/refresh-token:
servers:
- url: "https://staging-api.2p5.io"
description: Staging Wallet Server
get:
tags:
- Auth
summary: Refresh Token
description: Refresh Token
operationId: refreshToken
responses:
"200":
description: Success
content:
application/json:
schema:
type: object
properties:
data:
type: object
properties:
token:
type: string
example: >-
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoiMSIsInBob25lX251bWJlciI6IjYyODEyMzQ1Njc4OSIsInBpbiI6dHJ1ZSwiaXNzIjoiMnA1LmlvIiwiZXhwIjoxNjc3MTQ1NTUwLCJpYXQiOjE2NzQ1NTM1NTB9._Kq6ydFHnT4h2rTMPJzXGe7f16nZOuV9yD5J-68Qs78
message:
type: string
example: Token refreshed
status:
type: string
example: success
examples:
Success:
value:
data:
token: >-
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoiMSIsInBob25lX251bWJlciI6IjYyODEyMzQ1Njc4OSIsInBpbiI6dHJ1ZSwiaXNzIjoiMnA1LmlvIiwiZXhwIjoxNjc3MTQ1NTUwLCJpYXQiOjE2NzQ1NTM1NTB9._Kq6ydFHnT4h2rTMPJzXGe7f16nZOuV9yD5J-68Qs78
message: Token refreshed
status: success
# USER
/users/me:
servers:
- url: "https://staging-certapi.2p5.io"
description: NFT API
patch:
security:
- bearerAuth: []
tags:
- User
summary: Update Profile
description: Update Profile
operationId: updateUserOwnProfile
requestBody:
content:
application/json:
schema:
type: object
properties:
username:
type: string
example: "johnDoe123"
example:
username: "johnDoe123"
responses:
"200":
description: Success
content:
application/json:
schema:
type: object
properties:
message:
type: string
example: success update profile
status:
type: string
example: success
examples:
Success:
value:
message: success update profile
status: success
get:
security:
- bearerAuth: []
tags:
- User
summary: Get Profile
description: Get Profile
operationId: getUserOwnProfile
responses:
"200":
description: Success
content:
application/json:
schema:
type: object
properties:
data:
type: object
properties:
uid:
$ref: "#/components/schemas/UUID"
username:
type: string
example: johnDoe123
remote_id:
type: int
example: 1
phone_number:
type: string
example: "6285273839851"
wallet_address:
type: string
example: "0x95D2B960138fc731D2a9D7D71067B279aCdd9fed"
is_activated:
type: bool
example: false
message:
type: string
example: success update profile
status:
type: string
example: success
examples:
Success:
value:
message: success get profile
status: success
data:
uid: 0ujsswThIGTUYm2K8FjOOfXtY1K
username: johnDoe123
remote_id: 1
phone_number: '6285273839851'
wallet_address: '0x95D2B960138fc731D2a9D7D71067B279aCdd9fed'
is_activated: false
# Verify
/verify:
servers:
- url: "https://staging-certapi.2p5.io"
description: NFT API
post:
security:
- bearerAuth: []
tags:
- Verify
summary: Verify Certificate
description: Verify Certificate
operationId: verifyCertificate
requestBody:
content:
application/json:
schema:
type: object
properties:
certificate_id:
type: string
example: "ALTA/01/2022/01"
full_name:
type: string
example: "David Boy"
example:
certificate_id: "ALTA/01/2022/01"
full_name: "David Boy"
responses:
"200":
description: Success
content:
application/json:
schema:
type: object
properties:
data:
type: object
properties:
verified:
type: array
items:
type: object
required:
- status
- contract_address
- nft_uid
properties:
status:
type: string
example: "found"
contract_address:
type: string
example: "0x95E5A887FDBf9d43412581e6fa62Ed518c9482cF"
nft_uid:
$ref: "#/components/schemas/UUID"
message:
type: string
example: success certificate valid
status:
type: string
example: success
examples:
Success:
value:
message: success certificate valid
status: success
data:
verified:
- status: 2
contract_address: 0x95E5A887FDBf9d43412581e6fa62Ed518c9482cF
$ref: "#/components/schemas/UUID"
# Networks
/networks:
servers:
- url: "https://staging-certapi.2p5.io"
description: NFT API
get:
security:
- bearerAuth: []
tags:
- Network
summary: Get Networks
description: Get Networks
operationId: getNetworks
responses:
"200":
description: Success
content:
application/json:
schema:
type: object
properties:
data:
type: object
properties:
networks:
type: array
items:
type: object
required:
- id
- img_url
- currency_img_url
- api_base_url
- name
- currency_name
- currency_symbol
- currency_decimals
- status
properties:
id:
$ref: "#/components/schemas/ID"
img_url:
type: string
example: https://ethereum.org/static/6b935ac0e6194247347855dc3d328e83/cdbe4/eth-diamond-black.webp
currency_img_url:
type: string
example: https://ethereum.org/static/6b935ac0e6194247347855dc3d328e83/cdbe4/eth-diamond-black.webp
api_base_url:
type: string
example: https://staging-api.2p5.io
name:
type: string
example: ethereum
currency_name:
type: string
example: ether
currency_symbol:
type: string
example: ETH
currency_decimals:
type: number
example: 16
status:
type: string
example: active
message:
type: string
example: success get networks
status:
type: string
example: success
examples:
Success:
value:
message: success get networks
status: success
data:
networks:
- id: 2
img_url: https://ethereum.org/static/6b935ac0e6194247347855dc3d328e83/cdbe4/eth-diamond-black.webp
currency_img_url: https://ethereum.org/static/6b935ac0e6194247347855dc3d328e83/cdbe4/eth-diamond-black.webp
api_base_url: https://staging-api.2p5.io
name: ethereum
currency_name: ether
currency_symbol: ETH
currency_decimals: 16
status: active
/networks/{network_id}:
servers:
- url: "https://staging-certapi.2p5.io"
description: NFT API
get:
security:
- bearerAuth: []
tags:
- Network
summary: Get Network Detail
description: Get Network Detail
operationId: getNetworkDetail
parameters:
- $ref: "#/components/parameters/NetworkUID"
responses:
"200":
description: Success
content:
application/json:
schema:
type: object
properties:
data:
type: object
required:
- id
- img_url
- currency_img_url
- api_base_url
- name
- currency_name
- currency_symbol
- currency_decimals
- status
properties:
id:
$ref: "#/components/schemas/ID"
img_url:
type: string
example: https://ethereum.org/static/6b935ac0e6194247347855dc3d328e83/cdbe4/eth-diamond-black.webp
currency_img_url:
type: string
example: https://ethereum.org/static/6b935ac0e6194247347855dc3d328e83/cdbe4/eth-diamond-black.webp
api_base_url:
type: string
example: https://staging-api.2p5.io
name:
type: string
example: ethereum
currency_name:
type: string
example: ether
currency_symbol:
type: string
example: ETH
currency_decimals:
type: number
example: 16
status:
type: string
example: active
message:
type: string
example: success get networks
status:
type: string
example: success
examples:
Success:
value:
message: success get networks
status: success
data:
id: 2
img_url: https://ethereum.org/static/6b935ac0e6194247347855dc3d328e83/cdbe4/eth-diamond-black.webp
currency_img_url: https://ethereum.org/static/6b935ac0e6194247347855dc3d328e83/cdbe4/eth-diamond-black.webp
api_base_url: https://staging-api.2p5.io
name: ethereum
currency_name: ether
currency_symbol: ETH
currency_decimals: 16
status: active
# Projects
/projects:
servers:
- url: "https://staging-certapi.2p5.io"
description: NFT API
post:
security:
- bearerAuth: []
tags:
- Project
summary: Create Project
description: Create Project
operationId: createProject
requestBody:
content:
application/json:
schema:
type: object
required:
- name
- description
- symbol
- network_id
properties:
name:
type: string
example: "Graduation 2022"
description:
type: string
example: "Certificate of Graduation Class 2022"
symbol:
type: string
example: "GG2022"
network_id:
$ref: "#/components/schemas/ID"
example:
name: Graduation 2022
description: Certificate of Graduation Class 2022
symbol: GG2022
network_id: 1
responses:
"200":
description: Success
content:
application/json:
schema:
type: object
properties:
data:
$ref: "#/components/schemas/Project"
message:
type: string
example: success create project
status:
type: string
example: success
/projects/{project_id}/image/signed-url:
servers:
- url: "https://staging-certapi.2p5.io"
description: NFT API
get:
security:
- bearerAuth: []
tags:
- Project
summary: get upload project image signed url
description: Get upload project image signed url
operationId: getUploadProjectImageSignedUrl
parameters:
- $ref: "#/components/parameters/ProjectUIDPath"
responses:
"200":
description: Success
content:
application/json:
schema:
type: object
properties:
data:
type: object
required:
- url
properties:
url:
type: string
example: external-link-url/image.png
message:
type: string
example: success generate signed url
status:
type: string
example: success
/projects/me:
servers:
- url: "https://staging-certapi.2p5.io"
description: NFT API
get:
security:
- bearerAuth: []
tags:
- Project
summary: Get User Project
description: Get User Project
operationId: getMyProject
parameters:
- $ref: "#/components/parameters/Page"
- $ref: "#/components/parameters/Limit"
- name: query_nft
in: query
description: Query nfts
schema:
type: number
default: 0
maximum: 10
example: 5
responses:
"200":
description: Success
content:
application/json:
schema:
type: object
properties:
data:
type: object
properties:
projects:
type: array
items:
$ref: "#/components/schemas/ProjectList"
message:
type: string
example: success get project
status:
type: string
example: success
/projects/{project_uid}:
servers:
- url: "https://staging-certapi.2p5.io"
description: NFT API
put:
security:
- bearerAuth: []
tags:
- Project
summary: Update Project
description: Update Project
operationId: updateProjectDetail
parameters:
- $ref: "#/components/parameters/ProjectUIDPath"
requestBody:
content:
application/json:
schema:
type: object
required:
- name
- description
- symbol
- network_id
properties:
name:
type: string
example: "Graduation 2022"
description:
type: string
example: "Certificate of Graduation Class 2022"
symbol:
type: string
example: "GG2022"
network_id:
$ref: "#/components/schemas/ID"
example:
name: Graduation 2022
description: Certificate of Graduation Class 2022
symbol: GG2022
network_id: 2
responses:
"200":
description: Success
content:
application/json:
schema:
type: object
properties:
data:
$ref: "#/components/schemas/Project"
message:
type: string
example: success update project
status:
type: string
example: success
get:
security:
- bearerAuth: []
tags:
- Project
summary: Get Project Detail
description: Get Project Detail
operationId: getProjectDetail
parameters:
- $ref: "#/components/parameters/ProjectUIDPath"
responses:
"200":
description: Success
content:
application/json:
schema:
type: object
properties:
data:
$ref: "#/components/schemas/Project"
message:
type: string
example: success get project
status:
type: string
example: success
/projects/{project_uid}/launch:
servers:
- url: "https://staging-certapi.2p5.io"
description: NFT API
post:
security:
- bearerAuth: []
tags:
- Project
summary: Launch Project
description: Launch Project
operationId: launchProject
parameters:
- $ref: "#/components/parameters/ProjectUIDPath"
responses:
"200":
description: Success
content:
application/json:
schema:
type: object
properties:
data:
$ref: "#/components/schemas/Project"
message:
type: string
example: success create project
status:
type: string
example: success
# NFTs
/nfts:
servers:
- url: "https://staging-certapi.2p5.io"
description: NFT API
post:
security:
- bearerAuth: []
tags:
- NFT
summary: Create NFT of Project
description: Create NFT of Project
operationId: createProjectNFT
requestBody:
content:
application/json:
schema:
type: object
required:
- token_id
- metadata
- project_uid
properties:
project_uid:
$ref: "#/components/schemas/UUID"
token_id:
type: string
nullable: true
example: "123456"
is_explicit:
type: boolean
example: true
metadata:
type: object
nullable: true
example:
certificate_id: ALTA/01/2022/01
full_name: David Boy
image: external-link-url/image.png
properties:
certificate_id:
type: string
example: "ALTA/01/2022/01"
full_name:
type: string
example: "David Boy"
attributes:
nullable: true
type: object
properties:
trait_type:
type: string
example: "Math"
value:
anyOf:
- type: string
- type: number
- type: integer
- type: boolean
- type: array
items: {}
- type: object
example: 10
example:
project_uid: "0ujsswThIGTUYm2K8FjOOfXtY1K"
token_id: 123456
is_explicit: true
metadata:
certificate_id: ALTA/01/2022/01
full_name: David Boy
attributes:
- trait_type: Math
value: 10
responses:
"200":
description: Success
content:
application/json:
schema:
type: object
properties:
data:
$ref: '#/components/schemas/NFT'
message:
type: string
example: success create project
status:
type: string
example: success
get:
security:
- bearerAuth: []
tags:
- NFT
summary: Get NFT List of Project
description: Get NFT List of Project
operationId: getProjectNFTs
parameters:
- $ref: "#/components/parameters/ProjectUIDQuery"
- $ref: "#/components/parameters/Page"
- $ref: "#/components/parameters/Limit"
responses:
"200":
description: Success
content:
application/json:
schema:
type: object
properties:
data:
type: array
items:
$ref: '#/components/schemas/NFT'
message:
type: string
example: success create project
status:
type: string
example: success
/nfts/{nft_uid}/image/signed-url:
servers:
- url: "https://staging-certapi.2p5.io"
description: NFT API
get:
security:
- bearerAuth: []
tags:
- NFT
summary: GET upload nft image signed url
description: Get upload nft image signed url
operationId: getUploadNFTImageSignedUrl
parameters:
- $ref: "#/components/parameters/ProjectUIDQuery"
- $ref: "#/components/parameters/NFTUID"
responses:
"200":
description: Success
content:
application/json:
schema:
type: object
properties:
data:
type: object
required:
- url
properties:
url:
type: string
example: external-link-url/image.png
message:
type: string
example: success generate signed url
status:
type: string
example: success
/nfts/{nft_uid}:
servers:
- url: "https://staging-certapi.2p5.io"
description: NFT API
get:
security:
- bearerAuth: []
tags:
- NFT
summary: Get Project NFT
description: Get Project NFT
operationId: getProjectNFTDetail
parameters:
- $ref: "#/components/parameters/NFTUID"
responses:
"200":
description: Success
content:
application/json:
schema:
type: object
properties:
data:
$ref: '#/components/schemas/NFT'
message:
type: string
example: success create project
status:
type: string
example: success
put:
security:
- bearerAuth: []
tags:
- NFT
summary: Update NFT of Project
description: Update NFT of Project
operationId: updateProjectNFT
parameters:
- $ref: "#/components/parameters/NFTUID"
requestBody:
content:
application/json:
schema:
type: object
required:
- token_id
- metadata
- project_uid
properties:
token_id:
type: string
nullable: true
example: "123456"
is_explicit:
type: boolean
example: true