-
Notifications
You must be signed in to change notification settings - Fork 9
/
coursebatchcertificateapi (1).yaml
673 lines (670 loc) · 22.2 KB
/
coursebatchcertificateapi (1).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
openapi: 3.0.1
info:
title: Course Batch Certificate api
description: |-
These APIs are used to attach and remove course batch certificate templates,
and to issue certificates for course batch.
- [TestCases](https://app.getpostman.com/run-collection/416aa8eeb21eaa3fe30c)
version: "1.0"
servers:
- url: https://staging.open-sunbird.org/api
paths:
/course/batch/cert/v1/template/add:
patch:
tags:
- Certificate Template Api
summary: Add certificate template to a course batch
description: |-
This API allows you to attach certificate templates.
- On request, the **_ /template/add_** endpoint attaches a template to the course batch.
- All fields marked with an * are mandatory
- The mandatory fields cannot be null or empty
- Backend route: http://lms-service:9000/v1/course/batch/cert/template/add
operationId: AddCertificateTemplate
parameters:
- name: Content-Type
in: header
description: The Content Type entity is the media type of the resource.Possible
media types can be Application/json
required: true
schema:
type: string
- name: ts
in: header
description: 'The timestamp at which the **Add certificate template** request
was sent. '
required: false
schema:
type: string
- name: X-msgid
in: header
description: A unique ID that identifies the request, in case the same API
is executed multiple times.
required: false
schema:
type: string
- name: x-authenticated-user-token
in: header
description: The access token of the registered user sending the given API
request. This is an alphanumeric string.
required: true
schema:
type: string
- name: Authorization
in: header
description: To make use of the API, you require authorization. Raise a request
to the administrator for the use of the API. You will receive the authorization
key. Specify the key received here.
required: true
schema:
type: string
requestBody:
description: The body refers to the format of the request. The body contains
metadata about the request to add the certificate template.
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/coursebatchcertificateapiApiRequest'
- $ref: '#/components/schemas/coursebatchcertificateapiAddCertificateTemplateRequest'
required: true
responses:
200:
description: OK ! Operation successful."Add Certificate template" operation
was executed successfully.
content:
application/json:
schema:
type: object
properties:
coursebatchcertificateapiApiResponse:
$ref: '#/components/schemas/coursebatchcertificateapiApiResponse'
coursebatchcertificateapiSuccessResponse:
$ref: '#/components/schemas/coursebatchcertificateapiSuccessResponse'
example:
id: api.course.batch.cert.template.add
ver: v1
ts: 2020-12-03 05:15:43:693+0000
params:
resmsgid:
msgid: dcef916a-bbf0-48b6-bb20-2e4b9e90745d
err:
status: success
errmsg:
responseCode: OK
result:
response: SUCCESS
400:
description: BAD REQUEST. The "Add Certificate template" operation failed.
Input for a mandatory parameter may be missing.
content:
application/json:
schema:
$ref: '#/components/schemas/coursebatchcertificateapiAddCertificateTemplateErrorResponse'
example:
id: api.course.batch.cert.template.add
ver: v1
ts: 2020-12-03 05:16:35:486+0000
params:
resmsgid:
msgid: 3d203596-1344-4abd-bb2e-430f1dc865e1
err: null
status: SERVER_ERROR
errmsg: No such batch exists.
responseCode: CLIENT_ERROR
result: {}
401:
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/coursebatchcertificateapiAddCertificateTemplateErrorResponse'
example:
id: api.course.batch.cert.issue
ver: v1
ts: 2020-12-03 04:59:57:705+0000
params:
resmsgid:
msgid: fefbbbf8-1e39-40a9-b76d-3bd60b9f3786
err: UNAUTHORIZED_USER
status: SERVER_ERROR
errmsg: You are not authorized.
responseCode: CLIENT_ERROR
result: {}
500:
description: INTERNAL SERVER ERROR ! Looks like something went wrong. These
errors are tracked automatically. Try refreshing the page. If the problem
persists, contact info@sunbird.org.
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/coursebatchcertificateapi500ServerError'
example:
id: api.course.batch.cert.template.add
ver: v1
ts: '2020-11-23 15:15:18:331+0000'
params:
resmsgid: null
msgid: null
err: INTERNAL_ERROR
status: SERVER_ERROR
errmsg: 'Process failed,please try again later.'
responseCode: SERVER_ERROR
result: {}
x-codegen-request-body-name: Body
security:
- bearer: []
- userToken: []
/course/batch/cert/v1/template/remove:
patch:
tags:
- Certificate Template Api
summary: remove certificate template from course batch
description: |-
This API is associated with detaching certificate templates.
- The **_ /template/remove_** endpoint detaches a template from the course batch.
- All fields marked with an * are mandatory
- Required fields cannot be null or empty
- Backend Route: http://lms-service:9000/v1/course/batch/cert/template/remove
operationId: RemoveCertificateTemplate
parameters:
- name: Content-Type
in: header
description: The Content Type entity is the media type of the resource.Possible
media types can be Application/json
required: true
schema:
type: string
- name: ts
in: header
description: 'The timestamp at which the **remove certificate template** request
was sent. '
required: false
schema:
type: string
- name: X-msgid
in: header
description: A unique ID that identifies the request in case the same API
is executed multiple times.
required: false
schema:
type: string
- name: x-authenticated-user-token
in: header
description: The access token of the registered user sending the given API
request. This is an alphanumeric string.
required: true
schema:
type: string
- name: Authorization
in: header
description: To make use of the API, you require authorization. Raise a request
to the administrator for the use of the API. You will receive the authorization
key. Specify the key received here.
required: true
schema:
type: string
requestBody:
description: The body refers to the format of the request. The body contains
metadata about the request to remove certificate template.
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/coursebatchcertificateapiApiRequest'
- $ref: '#/components/schemas/coursebatchcertificateapiRemoveCertificateTemplateRequest'
example:
request:
batch:
courseId: courseId
batchId: batchId
template:
identifier: template Identifier
required: true
responses:
200:
description: OK ! Operation successful."Remove Certificate template" operation
was executed successfully.
content:
application/json:
schema:
type: object
properties:
coursebatchcertificateapiApiResponse:
$ref: '#/components/schemas/coursebatchcertificateapiApiResponse'
coursebatchcertificateapiSuccessResponse:
$ref: '#/components/schemas/coursebatchcertificateapiSuccessResponse'
example:
id: api.course.batch.cert.template.remove
ver: v1
ts: 2020-12-03 05:36:09:531+0000
params:
resmsgid:
msgid: cac9434e-fc66-47dc-b37b-15438b3c68ab
err:
status: success
errmsg:
responseCode: OK
result:
response: SUCCESS
400:
description: BAD REQUEST. The "Remove Certificate template" operation failed.
Input for a mandatory parameter may be missing.
content:
application/json:
schema:
$ref: '#/components/schemas/coursebatchcertificateapiRemoveCertificateTemplateErrorResponse'
example:
id: api.course.batch.cert.template.remove
ver: v1
ts: 2020-12-03 05:36:09:531+0000
params:
resmsgid:
msgid: cac9434e-fc66-47dc-b37b-15438b3c68ab
err:
status: success
errmsg:
responseCode: OK
result:
response: SUCCESS
401:
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/coursebatchcertificateapiAddCertificateTemplateErrorResponse'
example:
id: api.course.batch.cert.issue
ver: v1
ts: 2020-12-03 04:59:57:705+0000
params:
resmsgid:
msgid: fefbbbf8-1e39-40a9-b76d-3bd60b9f3786
err: UNAUTHORIZED_USER
status: SERVER_ERROR
errmsg: You are not authorized.
responseCode: CLIENT_ERROR
result: {}
500:
description: INTERNAL SERVER ERROR ! Looks like something went wrong. These
errors are tracked automatically. Try refreshing the page. If the problem
persists, contact info@sunbird.org.
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/coursebatchcertificateapi500ServerError'
example:
id: api.course.batch.cert.template.remove
ver: v1
ts: '2020-11-23 15:15:18:331+0000'
params:
resmsgid: null
msgid: null
err: INTERNAL_ERROR
status: SERVER_ERROR
errmsg: 'Process failed,please try again later.'
responseCode: SERVER_ERROR
result: {}
x-codegen-request-body-name: Body
security:
- bearer: []
- userToken: []
components:
schemas:
coursebatchcertificateapi500ServerError:
title: 500ServerError
required:
- id
- ver
- ts
- params
- responseCode
- result
type: object
properties:
id:
type: string
ver:
type: string
ts:
type: string
params:
type: string
responseCode:
type: string
result:
type: object
properties:
message:
type: string
coursebatchcertificateapiAddCertificateTemplateRequest:
title: AddCertificateTemplateRequest
required:
- request
type: object
properties:
request:
$ref: '#/components/schemas/coursebatchcertificateapiAddCourseBatchTemplateRequest'
coursebatchcertificateapiAddCourseBatchTemplateRequest:
title: AddCourseBatchTemplateRequest
required:
- batch
type: object
properties:
batch:
$ref: '#/components/schemas/coursebatchcertificateapiAddCourseBatchTemplate'
coursebatchcertificateapiAddCourseBatchTemplate:
title: AddCourseBatchTemplate
required:
- batchId
- courseId
- template
type: object
properties:
courseId:
type: string
description: The course identifier
batchId:
type: string
description: The batch identifier
template:
$ref: '#/components/schemas/coursebatchcertificateapiAddBatchTemplate'
coursebatchcertificateapiAddBatchTemplate:
title: AddBatchTemplate
required:
- criteria
- identifier
- issuer
- signatoryList
type: object
properties:
identifier:
type: string
description: The template identifier
criteria:
type: object
properties:
enrollment:
type: object
properties:
status:
type: string
example: "2"
description: The filter for the template
signatoryList:
type: array
description: The list of signatories
items:
type: object
required:
- name
- id
- designation
- image
properties:
name:
type: string
description: The signatory name
id:
type: string
description: The identifier for the signatory
designation:
type: string
description: The designation of the signatory
example: CEO
image:
type: string
description: image of the signatory signature
issuer:
type: object
required:
- name
- url
properties:
name:
type: string
description: The issuer name
url:
type: string
description: The issuer URL
publicKey:
type: array
description: The public keys
example:
- 7
- 8
items:
type: integer
format: int64
description: The filter for the template
coursebatchcertificateapiRemoveCertificateTemplateRequest:
title: RemoveCertificateTemplateRequest
required:
- request
type: object
properties:
request:
$ref: '#/components/schemas/coursebatchcertificateapiRemoveCourseBatchTemplateRequest'
coursebatchcertificateapiRemoveCourseBatchTemplateRequest:
title: RemoveCourseBatchTemplateRequest
required:
- batch
type: object
properties:
batch:
$ref: '#/components/schemas/coursebatchcertificateapiRemoveCourseBatchTemplate'
coursebatchcertificateapiRemoveCourseBatchTemplate:
title: RemoveCourseBatchTemplate
required:
- batchId
- courseId
- template
type: object
properties:
courseId:
type: string
description: The course identifier
batchId:
type: string
description: The batch identifier
template:
$ref: '#/components/schemas/coursebatchcertificateapiRemoveBatchTemplate'
coursebatchcertificateapiRemoveBatchTemplate:
title: RemoveBatchTemplate
required:
- templateId
type: object
properties:
templateId:
type: string
description: The template identifier
coursebatchcertificateapiIssueCertificateRequest:
title: Issue certificate request
required:
- request
type: object
properties:
request:
$ref: '#/components/schemas/coursebatchcertificateapiRequest'
coursebatchcertificateapiRequest:
title: Request
required:
- batchId
- courseId
type: object
properties:
courseId:
type: string
description: The course identifier
batchId:
type: string
description: The batch identifier
userIds:
type: array
description: The optional User IDs
items:
type: string
coursebatchcertificateapiIssueCertificateResponse:
type: object
properties:
result:
type: object
properties:
courseId:
type: string
description: The course identifier
batchId:
type: string
description: The batch identifier
status:
type: string
description: The certificate issue status
example: Certificates issue action for Course Batch Id 0128821148183429120
submitted Successfully!
description: The response details
description: Issue certificate Response
coursebatchcertificateapiResponseHeader:
title: ResponseHeader
type: object
properties:
id:
type: string
description: The API Identifier
ver:
type: string
description: The API version information
ts:
type: string
description: The API execution timestamp
params:
$ref: '#/components/schemas/coursebatchcertificateapiResponseParams'
responseCode:
type: string
description: The API response code
example: CLIENT_ERROR
coursebatchcertificateapiResponseParams:
title: Response Parameter
type: object
properties:
resmsgid:
type: string
description: Represents the response message ID
msgid:
type: string
description: Represents the error message ID
err:
type: string
description: Represents the error code
status:
type: string
description: The response status
errmsg:
type: string
description: Error Message
example: No such batchId exists
coursebatchcertificateapiEmptyResult:
title: Empty Result
type: object
properties:
result:
type: object
properties: {}
description: Empty Result
coursebatchcertificateapiIssueCertificateErrorResponse:
title: Create Content Error Response
allOf:
- $ref: '#/components/schemas/coursebatchcertificateapiResponseHeader'
- $ref: '#/components/schemas/coursebatchcertificateapiEmptyResult'
coursebatchcertificateapiSuccessResponse:
type: object
properties:
result:
type: object
properties:
response:
type: string
example: SUCCESS
description: Contains the success response
coursebatchcertificateapiAddCertificateTemplateErrorResponse:
title: Create cerrtificate error response
allOf:
- $ref: '#/components/schemas/coursebatchcertificateapiResponseHeader'
- $ref: '#/components/schemas/coursebatchcertificateapiEmptyResult'
coursebatchcertificateapiRemoveCertificateTemplateErrorResponse:
title: Remove certificate error response
allOf:
- $ref: '#/components/schemas/coursebatchcertificateapiResponseHeader'
- $ref: '#/components/schemas/coursebatchcertificateapiEmptyResult'
coursebatchcertificateapiApiRequest:
type: object
properties:
id:
type: string
description: Represents an API uniquely
ver:
type: string
description: Represents the version of the API which was used
ets:
type: integer
description: Represents the EPOCH (UTC) timestamp in milliseconds since
EPOCH
format: int64
params:
type: object
properties:
msgid:
type: string
description: Represents the unique ID of the message being sent
did:
type: string
description: Represents the device UUID from which API is called
coursebatchcertificateapiApiResponse:
required:
- ets
- id
- params
- ver
type: object
properties:
id:
type: string
description: Represents the ID of the request which was made
ver:
type: string
description: Represents the version of the API which was used
ets:
type: integer
description: Represents the EPOCH (UTC) timestamp in milliseconds since
EPOCH
format: int64
params:
required:
- msgid
- resmsgid
- status
type: object
properties:
msgid:
type: string
description: Represents the ID of the message sent
resmsgid:
type: string
description: Represents the ID of the response message
status:
type: string
enum:
- success
- error
responseCode:
type: string
securitySchemes:
bearer:
type: apiKey
name: Authorization
in: header
userToken:
type: apiKey
name: x-authenticated-user-token
in: header