-
Notifications
You must be signed in to change notification settings - Fork 23
/
apiary.apib
3803 lines (3186 loc) · 164 KB
/
apiary.apib
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
FORMAT: 1A
HOST: https://api.accredible.com/
# Accredible Credential API
The [Accredible](https://www.accredible.com/) Credential API allows you to create and interact with badges and certificates called [Accredible Credentials](https://www.credential.net/10000005).
There are 3 main objects in Accredible: Credentials, Groups and Designs.
### API Overview video
[![API Overview Video](https://img.youtube.com/vi/R7euTeMGaQg/0.jpg)](https://www.youtube.com/watch?v=R7euTeMGaQg)
### Getting Started with the API - Video Walkthrough
[![Getting Started with the API Video Walkthrough](https://cdn.accredible.com/api-overview.jpg)](https://www.loom.com/share/1093916cb4be421eb1ff86f085dae337?sid=0bb24e68-c7b4-41a6-aab8-f5c14841a29c)
# Credentials
[Credentials](http://docs.accrediblecredentialapi.apiary.io/#reference/credentials) are the core object in the API. They collect all of the data related to a course, training acitivity or achievment and the recipient/participant information.
You should create a credential for each achievement completion that a recipient has. For example if John Doe finishes the Programming 101 course we should create one credential to represent that. If John Doe achieves something else then he would need a new credential.
# Groups
[Groups](http://docs.accrediblecredentialapi.apiary.io/#reference/groups) are similar to a folder or a course. They contain information about the achievement and have multiple Credentials attached to them.
For example you should create a group for the Introduction to Programming course. You'd provide the Course Name, Course Descripion and Course URL. In the future you can pass the name or ID of this group when creating a credential so that the credential is passed all the information relating to the achievement.
# Designs
[Designs](http://docs.accrediblecredentialapi.apiary.io/#reference/designs) provide a visual specification for how a Credential should be rendered. Design can be used accross multiple Groups.
For example if we have three courses: Intro to Basic Programming, Intro to Advanced Programming and Intro to DevOps each of these may have the same design for their Credentials. When creating or updating their corresponding Groups you would attach the desired design accordingly.
# Departments
[Departments](http://docs.accrediblecredentialapi.apiary.io/#reference/departments), if enabled for your account allow you to manage multiple, independent organization groups. Each Department is entirely separate with it's own Designs, Groups, Branding, etc. You cannot share data between Departments except Billing and Administrators.
# Attributes
[Attributes](http://docs.accrediblecredentialapi.apiary.io/#reference/attributes), are used to merge information with your certificate designs and email templates. Attributes acts as as placeholders for information and can be added to certificate designs and email templates.
# Issuers
[Issuers](http://docs.accrediblecredentialapi.apiary.io/#reference/issuer) provide organization details.
# API Key
API keys are used as Authorization tokens in the header in all authenticated API endpoints. These Keys are managed in the [Accredible Dashboard](https://dashboard.accredible.com/). There are two types of API Keys, those that are account wide and work on all assets and those that are related to a specific department. API keys scoped to a specific department can only access the resources (Credentials, Groups, Designs etc.) belonging to that department.
# Single sign-on options on Accredible
[Single sign-on](http://docs.accrediblecredentialapi.apiary.io/#reference/sso) in addition to the student authentication provided by Accredible, you can also use single sign-on to authenticate your student into Accredible and they can directly sign-in.
SSO is also available via our Integrations and via SAML 2.0.
# Rate Limiting
We allow up to 2000 requests every 5 minutes from a single IP address, but some higher security endpoints have stricter rate limiting. Requests are counted in 30 second periods.
If you attempt to make requests more quickly than permitted by these rules, you may receive a `429 Too Many Requests` response from an endpoint.
# Errors
Accredible uses conventional HTTP response codes to indicate the success or failure of an API request. Codes in the 2xx range indicate success in general and codes in the 4xx range indicate an error that failed given the information provided (e.g., a required parameter was omitted, a permissions error, etc). Codes in the 5xx range indicate an error with Accredible.
Summary of response codes:
| Response Code | Description |
| ------------- | ------------- |
| 200 | The request was successful. |
| 401 | Invalid API key. |
| 403 | Permissions error. You do not have access to the requested resource. |
| 404 | The request used a resource that could not be found. |
| 429 | Too many requests. Please see the Rate Limiting section. |
| 500 | Accredible Internal Error. |
#Group Quick Start
In this quick start tutorial, we assume you have already created your first group. If you haven't then go to [create a group in the dashboard](https://dashboard.accredible.com/issuer/dashboard/group/new?edit=information-and-appearance) or use [this API request](https://accrediblecredentialapi.docs.apiary.io/reference/groups/groups/create-a-group).
To get you up and running the example below shows you how to create a basic Credential.
### Credentials [/v1/credentials]
#### Create a Credential [POST]
Create a Credential using this action. It requires a JSON object containing a Credential.
+ Request (application/json)
+ Headers
Authorization: Token token=YOUR API_KEY
+ Attributes
+ recipient.name (string, required) - The name of the recipient the credential is issued to.
+ recipient.email (string, required) - The recipient's email address.
+ group_id (number, required) - Group Id to which the credential should belong. Legacy field. Group name may be used in place of a Group ID.
+ Body
{
"credential": {
"recipient": {
"name": "John Doe",
"email": "person@example.com"
},
"group_id": 34
}
}
+ Response 200 (application/json)
{
"credential": {
"id": 1234,
"recipient": {
"name": "John Doe",
"email": "john@doe.com",
"id" : 817,
"meta_data": null
},
"issuer": {
"name": "Course Provider",
"url": "http://www.awesomelearningexample.com",
"description": "Technical courses at an introductory level..."
},
"name": "Credential Name",
"description": "A detailed description of what the credential is for",
"issued_on": "2014-06-14",
"group_name": "Test Group",
"group_id": 34,
"grade": null,
"complete": true,
"expired_on": null,
"custom_attibutes": null,
"course_link": null,
"url": "https://www.credential.net/1234",
"private": false,
"certificate": {
"image": {
"preview": "https://staging.accredible.com/v1/frontend/credential_website_embed_image/certificate/10000005"
}
},
"badge": {
"image": {
"preview": "https://staging.accredible.com/v1/frontend/credential_badge_image/10000005"
}
},
"meta_data": null
}
}
# Group Credentials
Credentials are the core object in Accredible. They collect all of the data related to a course/training/achievment and a recipient.
You should create a credential for each achievement completion that a recipient has. For example if John Doe finishes the Programming 101 course we should create one credential to represent that. If John Doe achieves something else then he would need a new credential.
By default a Group doesn't allow duplicate credentials to be issued to the same recipient. You can update this setting if you would like to do so: https://help.accredible.com/can-i-allow-duplicate-credentials-in-a-group
## Credentials [/v1/credentials]
#### Create a New Credential [POST]
You create a Credential with optional EvidenceItems and References using this action. Please make sure that you've created a group on your dashboard before creating a Credential. If you haven't then [create a group in the dashboard](https://dashboard.accredible.com/issuer/dashboard/group/new?edit=information-and-appearance) or use [this API request](https://accrediblecredentialapi.docs.apiary.io/reference/groups/groups/create-a-group).
This endpoint requires a JSON object containing a Credential.
**Important:** If you don’t have enough credits when attempting to create Credentials with this endpoint, your credentials will still be created in your account, but will not be published. This will save your data and prevent you from having to re-attempt your request later. You will be able to publish the created credentials in your account when you have the required credits
[Creating Credentials - Video Walkthrough](https://www.loom.com/share/c7c47531a46d4a3f85abaf7413d9e636?sid=b3998a3d-dd4a-4289-84fc-db6df40efd5b)
+ Request (application/json)
+ Headers
Authorization: Token token=YOUR API_KEY
+ Attributes
+ id (string, optional) - The unique ID of the credential. If you supply your own internal ID we'll use this as a reference for the Credential. If not we'll assign an ID.
+ recipient.name (string, required) - The name of the recipient the credential is issued to.
+ recipient.email (string, required) - The recipient's email address.
+ recipient.id (string, optional) - The recipient's user ID as defined by your organization. This alllows you to easily map your recipients to their Credentials regardless of changes to their email address.
+ recipient.meta_data(object, optional) - You can use this parameter to attach key-value strings to the object. Meta data is useful for storing additional, structured information on an object.
+ group_id (number, required) - Group Id to which the credential should belong. Legacy field. Group name may be used in place of a Group ID.
+ name (string, optional) - The Credential/course name displayed to recipients. This is required if the Group the Credential belongs to doesn't have a Course Name set.
+ description (string, optional) - The credential/course description displayed to recipients. This is required if the Group the Credential belongs to doesn't have a Course Description set.
+ custom_attributes (object, optional) - Custom variables to display on the Credential. These should be added to the design using the visual editor. Data should be formatted as a JSON hash where keys are the custom attribute names and the values are the values to be displayed on the Credential.
+ issued_on (string, optional) - Date of issue, the default is when the credential is created. Format: YYYY-MM-DD (DD/MM/YYYY also works but is deprecated)
+ expired_on (string, optional) - Date you would like the credential to expire on, null by default. Format: YYYY-MM-DD (DD/MM/YYYY also works but is deprecated)
+ complete (boolean, optional) - Whether the achievement is complete or still in progress, true by default.
+ private (boolean, optional) - Whether to make credential private. When it is set to `true`, the Credential will be private and visible only to its recipient who has signed into credential.net. If no value is set, the default value will be automatically assigned based on `Group.generate_private_credential` and `Department.generate_private_credential`. `Department.generate_private_credential` will be used as the default when `Group.generate_private_credential` is set to `null`. `Group.generate_private_credential` will override `Department.generate_private_credential` and be used as the default when it is set to `true` or `false`.
+ approve (boolean, optional) - Whether to publish credential at the time of creation. By default this is true but settings at dashboard for sandbox_mode take precendence.
+ allow_supplemental_evidence (boolean, optional) - Whether to allow recipients to add their own supplemental evidence to the Credential, true by default.
+ allow_supplemental_references (boolean, optional) - Whether to allow recipients to add their own supplemental references to the credential, true by default.
+ evidence_items (array, optional) - Evidence to add to this credential, that provide more information about how the recipient met the achievement. See http://docs.accrediblecredentialapi.apiary.io/#reference/evidence-items/evidence-item/create-a-new-evidence-item for fields. Typically this would include work samples for a course.
+ references (array, optional) - References to add to this Credential, that provide more information about how the recipient met the achievement. see http://docs.accrediblecredentialapi.apiary.io/#reference/references/reference/create-a-new-reference for fields. Typically this would be a peer, teacher or manager giving their feedback.
+ meta_data (object, optional) - You can use this parameter to attach key-value strings to the object. Meta data is useful for storing additional, structured information on an object.
+ Body
{
"credential": {
"recipient": {
"name": "John Doe",
"email": "person@example.com",
"id": "PK-17993",
"meta_data": {
"credential_batch": "772"
}
},
"name": "Credential Name",
"group_name": "course1234",
"group_id": 23,
"description": null,
"issued_on": "2014-06-14",
"evidence_items": [
{
"description": "Report card including all grades",
"url": "http://www.awesomelearningexample.com/johndoe/reportcard",
"category": "url"
},
{
"description": "Final essay",
"file": "https://s3.amazonaws.com/accredible_api_evidence_items/files/12/original/open-uri20140316-15266-1m3by6h.jpeg",
"category": "file"
}
],
"references": [
{
"description": "John worked hard on this course and provided exemplary understanding of the core concepts",
"referee": {
"name": "Jane Doe",
"email": "person2@example.com",
"avatar": "https://placehold.it/100x100",
"url": "https://any-url.com"
},
"relationship": "managed"
}
],
"custom_attributes": {
"custom_variables": "some value",
"dob": "29 jan 1970"
},
"meta_data": {
"batch_id": "TK210"
}
}
}
+ Response 200 (application/json)
{
"credential": {
"id": "10000005",
"name": "Example Certificate",
"description": "This is an example description - you can write anything you want here.\n\nWe recommend describing the achievement.",
"approve": true,
"grade": null,
"complete": true,
"issued_on": "2014-08-14",
"course_link": "https://www.accredible.com",
"custom_attributes": {
"Location": "London"
},
"expired_on": null,
"group_name": "Example Certificate Design",
"group_id": 9549,
"url": "https://www.credential.net/10000005",
"encoded_id": "10000005",
"private": false,
"seo_image": "https://api.accredible.com/v1/frontend/credential_seo_image/10000005",
"certificate": {
"image": {
"preview": "https://api.accredible.com/v1/frontend/credential_website_embed_image/certificate/10000005"
}
},
"badge": {
"image": {
"preview": "https://api.accredible.com/v1/frontend/credential_badge_image/10000005"
}
},
"evidence_items": [
{
"id": 826,
"description": "Final Grade",
"preview_image_url": null,
"link_url": null,
"type": "grade",
"string_object": {
"grade": 80
},
"supplemental": false,
"position": 1
},
{
"id": 10,
"description": "Presentation",
"preview_image_url": "https://s3.amazonaws.com/staging_accredible_api_evidence_items/previews/10/medium/open-uri20140316-15300-14jngj.jpg?1408372366",
"link_url": "https://s3.amazonaws.com/staging_accredible_api_evidence_items/files/10/original/open-uri20140316-15300-14jngj.pdf",
"type": "file",
"string_object": null,
"supplemental": true,
"position": 4
}
],
"references": [
{
"id": 2,
"description": "Although he had difficulty with the course material at first, John learned a lot throughout the course. His final project was one of the best in his class.",
"relationship": "mentored",
"supplemental": false,
"approve": true,
"referee": {
"name": "Example Person",
"email": null,
"avatar": "https://s3.amazonaws.com/staging_accredible_api_individuals/images/4/thumb/open-uri20140815-11960-1r0hppg?1408416647"
}
}
],
"recipient": {
"name": "Jordan Smith",
"email": "jor@dan.org",
"id": "ct992",
"meta_data": {
"bar": "foo"
}
},
"issuer": {
"name": "Example Organization",
"description": null,
"url": "http://www.accredible.com",
"id": 4897
},
"meta_data": {
"foo": "bar"
}
}
}
## Create Multiple Credentials [/v1/credentials/bulk_create]
### Bulk Create credentials [POST]
Create multiple Credentials using this action. It requires a JSON object containing credentials in an array.
**Important:** If you don’t have enough credits when attempting to create Credentials with this endpoint, your credentials will still be created in your account, but will not be published. This will save your data and prevent you from having to re-attempt your request later. You will be able to publish the created credentials in your account when you have the required credits.
**API Limits:** Each request can accommodate up to 100 credentials. Should you have a larger set of credentials to process, it's recommended to split them into batches of 100 and make successive calls to this API.
[Bulk Creating Credentials - Video Walkthrough](https://www.loom.com/share/df043cb9d2b04140bcc53b633d232147?sid=005848bc-91a9-49cc-8f12-7f31c15245f8)
+ Request (application/json)
+ Headers
Authorization: Token token=YOUR API_KEY
+ Attributes
+ credentials (array, required) - Array of the credentials payload all field applicable which is in create credential endpoint.
+ Body
{
"credentials": [
{
"recipient":
{
"name": "John Doe", "email": "student@example.com" }, "group_id": "22625"
},
{
"recipient":
{
"name": "John Doe", "email": "student@example.com" }, "group_id": "62430"
}
]
}
+ Response 200 (application/json)
[
{
"credential": {
"id": 1234,
"recipient": {
"name": "John Doe",
"email": "person2@example.com",
"id": 232,
"meta_data": null
},
"issuer": {
"name": "Course Provider",
"url": "http://www.awesomelearningexample.com",
"description": "Technical courses at an introductory level..."
},
"name": "Credential Name",
"description": "A detailed description of what the credential is for",
"issued_on": "2014-06-14",
"group_name": "Test Group",
"url": "https://www.credential.net/10000005",
"grade": null,
"complete": true,
"expired_on": null,
"custom_attibutes": null,
"course_link": null,
"meta_data": null
},
{
"credential": {
"id": 1234,
"recipient": {
"name": "John Doe",
"email": "person2@example.com",
"id": 2232,
"meta_data": {
"bar": "foo"
}
},
"issuer": {
"name": "Course Provider",
"url": "http://www.awesomelearningexample.com",
"description": "Technical courses at an introductory level..."
},
"name": "Credential Name",
"description": "A detailed description of what the credential is for",
"issued_on": "2014-06-14",
"group_name": "Test Group",
"grade": null,
"complete": true,
"expired_on": null,
"custom_attibutes": null,
"course_link": null,
"meta_data": {
"checked_by": "CP Leung"
}
}
}
]
## Bulk Create Credentials V2 [/v2/credentials/bulk_create]
This is an alternative to the v2 Bulk Create Credentials API. It also requires a JSON object containing credentials in an array.
### Bulk Create Credentials [POST]
**Important:** If you don’t have enough credits when attempting to create Credentials with this endpoint, your credentials will still be created in your account, but will not be published.
It supports multi-status responses, where partial successes and errors are consolidated into a single structure with `status: 207 Multi-Status`.
You will be able to publish the created credentials in your account when you have the required credits.
**API Limits:** Each request can accommodate up to 30 credentials. Should you have a larger set of credentials to process, it's recommended to split them into batches of 30 and make successive calls to this API.
+ Request (application/json)
+ Headers
Authorization: Token token=YOUR API_KEY
+ Attributes
+ credentials (array, required) - Array of the credentials payload all field applicable which is in create credential endpoint.
+ Body
{
"credentials": [
{
"name": "Credential Name",
"description": "A detailed description of what the credential is for",
"recipient":
{
"name": "John Doe", "email": "student@example.com" }, "group_id": "22625"
},
{
"name": "Credential Name",
"description": "A detailed description of what the credential is for",
"recipient":
{
"name": "John Doe", "email": "student@example.com" }, "group_id": "62430"
}
}
]
}
+ Response 200 (application/json)
{
"results": [
{
"credential": {
"id": 1234,
"approve": true,
"recipient": {
"name": "John Doe",
"email": "person2@example.com",
"id": 232,
"meta_data": null
},
"issuer": {
"name": "Course Provider",
"url": "http://www.awesomelearningexample.com",
"description": "Technical courses at an introductory level..."
},
"name": "Credential Name",
"description": "A detailed description of what the credential is for",
"issued_on": "2014-06-14",
"group_name": "Test Group",
"url": "https://www.example.com/10000005",
"grade": null,
"complete": true,
"expired_on": null,
"custom_attibutes": null,
"course_link": null,
"meta_data": null,
"evidence_items": [],
"references": []
},
{
"credential": {
"id": 1234,
"approve": true,
"recipient": {
"name": "John Doe",
"email": "person2@example.com",
"id": 2232,
"meta_data": {
"bar": "foo"
}
}
"issuer": {
"name": "Course Provider",
"url": "http://www.awesomelearningexample.com",
"description": "Technical courses at an introductory level..."
},
"name": "Credential Name",
"description": "A detailed description of what the credential is for",
"issued_on": "2014-06-14",
"group_name": "Test Group",
"url": "https://www.example.com/10000005",
"grade": null,
"complete": true,
"expired_on": null,
"custom_attibutes": null,
"course_link": null,
"meta_data": {
"checked_by": "Jane Doe"
}
}
}
]
}
+ Response 207 (application/json)
{
"results": [
{
"credential": {
"id": 1234,
"approve": false,
"recipient": {
"name": "John Doe",
"email": "person2@example.com",
"id": 232,
"meta_data": null
},
"issuer": {
"name": "Course Provider",
"url": "http://www.awesomelearningexample.com",
"description": "Technical courses at an introductory level..."
},
"name": "Credential Name",
"description": "A detailed description of what the credential is for",
"issued_on": "2014-06-14",
"group_name": "Test Group",
"url": "https://www.example.com/10000005",
"grade": null,
"complete": true,
"expired_on": null,
"custom_attibutes": null,
"course_link": null,
"meta_data": null,
"evidence_items": [],
"references": []
},
"errors": {
"code": "insufficient_credits",
"message": "The credential was created but not published."
}
}
]
}
+ Response 422 (application/json)
{
"results": [
{
"errors": {
"code": "credential_invalid",
"message": "The credential is not valid",
"details": [
{
"property": "recipient.email",
"message": "has already been taken. Your group settings do not allow duplicates of this credential to be sent to the same email."
}
]
}
}
]
}
## Credential [/v1/credentials/{id}]
### View a Credential [GET]
[View Credentials - Video Walkthrough](https://www.loom.com/share/9724ce5eb0694dfab0c03f5b70d8a3f3?sid=cea2c757-5031-4ff1-b33d-91b361fd0cdf)
+ Parameters
+ id (string) - ID of the Credential in the form of an integer or string for the particular Credential requested.
+ Request (application/json)
+ Headers
Authorization: Token token=YOUR API _KEY
+ Response 200 (application/json)
{
"credential": {
"id": "10000005",
"name": "Example Certificate",
"description": "This is an example description - you can write anything you want here.\n\nWe recommend describing the achievement.",
"approve": true,
"grade": null,
"complete": true,
"issued_on": "2014-08-14",
"course_link": "https://www.accredible.com",
"custom_attributes": {
"Location": "London"
},
"expired_on": null,
"group_name": "Example Certificate Design",
"group_id": 9549,
"url": "https://www.credential.net/10000005",
"encoded_id": "10000005",
"private": false,
"seo_image": "https://api.accredible.com/v1/frontend/credential_seo_image/10000005",
"certificate": {
"image": {
"preview": "https://api.accredible.com/v1/frontend/credential_website_embed_image/certificate/10000005"
}
},
"badge": {
"image": {
"preview": "https://api.accredible.com/v1/frontend/credential_badge_image/10000005"
}
},
"evidence_items": [
{
"id": 826,
"description": "Final Grade",
"preview_image_url": null,
"link_url": null,
"type": "grade",
"string_object": {
"grade": 80
},
"supplemental": false,
"position": 1
},
{
"id": 10,
"description": "Presentation",
"preview_image_url": "https://s3.amazonaws.com/staging_accredible_api_evidence_items/previews/10/medium/open-uri20140316-15300-14jngj.jpg?1408372366",
"link_url": "https://s3.amazonaws.com/staging_accredible_api_evidence_items/files/10/original/open-uri20140316-15300-14jngj.pdf",
"type": "file",
"string_object": null,
"supplemental": true,
"position": 4
}
],
"references": [
{
"id": 2,
"description": "Although he had difficulty with the course material at first, John learned a lot throughout the course. His final project was one of the best in his class.",
"relationship": "mentored",
"supplemental": false,
"approve": true,
"referee": {
"name": "Example Person",
"email": null,
"avatar": "https://s3.amazonaws.com/staging_accredible_api_individuals/images/4/thumb/open-uri20140815-11960-1r0hppg?1408416647"
}
}
],
"recipient": {
"name": "Jordan Smith",
"email": "jor@dan.org",
"id": "dw373",
"meta_data": null
},
"issuer": {
"name": "Example Organization",
"description": null,
"url": "http://www.accredible.com",
"id": 4897
},
"meta_data": null
}
}
### Update a Credential [PUT]
[Updating Credentials - Video Walkthrough](https://www.loom.com/share/4940d9cf43da43dc870f40ac4dd3831f?sid=ebfe460c-01a1-40a0-b5fe-6e8d13386f54)
+ Parameters
+ id (string, optional) - The unique ID of the credential. If you supply your own internal ID we'll use this as a reference for the Credential. If not we'll assign an ID.
+ Request (application/json)
+ Headers
Authorization: Token token=YOUR API _KEY
+ Attributes
+ id (string, optional) - The unique ID of the credential. If you supply your own internal ID we'll use this as a reference for the Credential. If not we'll assign an ID.
+ recipient.name (string, required) - The name of the recipient the credential is issued to.
+ recipient.email (string, required) - The recipient's email address.
+ recipient.id (string, optional) - The recipient's user ID as defined by your organization. This alllows you to easily map your recipients to their Credentials regardless of changes to their email address.
+ recipient.meta_data (object, optional) - You can use this parameter to attach key-value strings to the object. Meta data is useful for storing additional, structured information on an object.
+ group_id (number, required) - Group Id to which the credential should belong. Legacy field. Group name may be used in place of a Group ID.
+ name (string, optional) - The Credential/course name displayed to recipients. This is required if the Group the Credential belongs to doesn't have a Course Name set.
+ description (string, optional) - The credential/course description displayed to recipients. This is required if the Group the Credential belongs to doesn't have a Course Description set.
+ custom_attributes (object, optional) - Custom variables to display on the Credential. These should be added to the design using the visual editor. Data should be formatted as a JSON hash where keys are the custom attribute names and the values are the values to be displayed on the Credential.
+ issued_on (string, optional) - Date of issue, the default is when the credential is created. Format: YYYY-MM-DD (DD/MM/YYYY also works but is deprecated)
+ expired_on (string, optional) - Date you would like the credential to expire on, null by default. Format: YYYY-MM-DD (DD/MM/YYYY also works but is deprecated)
+ complete (boolean, optional) - Whether the achievement is complete or still in progress, true by default.
+ allow_supplemental_evidence (boolean, optional) - Whether to allow recipients to add their own supplemental evidence to the Credential, true by default.
+ allow_supplemental_references (boolean, optional) - Whether to allow recipients to add their own supplemental references to the credential, true by default.
+ evidence_items (array, optional) - Evidence to add to this credential, that provide more information about how the recipient met the achievement. See http://docs.accrediblecredentialapi.apiary.io/#reference/evidence-items/evidence-item/create-a-new-evidence-item for fields. Typically this would include work samples for a course.
+ references (array, optional) - References to add to this Credential, that provide more information about how the recipient met the achievement. see http://docs.accrediblecredentialapi.apiary.io/#reference/references/reference/create-a-new-reference for fields. Typically this would be a peer, teacher or manager giving their feedback.
+ meta_data (object, optional) - You can use this parameter to attach key-value strings to the object. Meta data is useful for storing additional, structured information on an object.
+ Body
{
"credential": {
"approve": true
}
}
+ Response 200 (application/json)
{
"credential": {
"id": "10000005",
"name": "Example Certificate",
"description": "This is an example description - you can write anything you want here.\n\nWe recommend describing the achievement.",
"approve": true,
"grade": null,
"complete": true,
"issued_on": "2014-08-14",
"course_link": "https://www.accredible.com",
"custom_attributes": {
"Location": "London"
},
"expired_on": null,
"group_name": "Example Certificate Design",
"group_id": 9549,
"url": "https://www.credential.net/10000005",
"encoded_id": "10000005",
"private": false,
"seo_image": "https://api.accredible.com/v1/frontend/credential_seo_image/10000005",
"certificate": {
"image": {
"preview": "https://api.accredible.com/v1/frontend/credential_website_embed_image/certificate/10000005"
}
},
"badge": {
"image": {
"preview": "https://api.accredible.com/v1/frontend/credential_badge_image/10000005"
}
},
"evidence_items": [
{
"id": 826,
"description": "Final Grade",
"preview_image_url": null,
"link_url": null,
"type": "grade",
"string_object": {
"grade": 80
},
"supplemental": false,
"position": 1
},
{
"id": 10,
"description": "Presentation",
"preview_image_url": "https://s3.amazonaws.com/staging_accredible_api_evidence_items/previews/10/medium/open-uri20140316-15300-14jngj.jpg?1408372366",
"link_url": "https://s3.amazonaws.com/staging_accredible_api_evidence_items/files/10/original/open-uri20140316-15300-14jngj.pdf",
"type": "file",
"string_object": null,
"supplemental": true,
"position": 4
}
],
"references": [
{
"id": 2,
"description": "Although he had difficulty with the course material at first, John learned a lot throughout the course. His final project was one of the best in his class.",
"relationship": "mentored",
"supplemental": false,
"approve": true,
"referee": {
"name": "Example Person",
"email": "email@example.com"
"avatar": "https://s3.amazonaws.com/staging_accredible_api_individuals/images/4/thumb/open-uri20140815-11960-1r0hppg?1408416647"
}
}
],
"recipient": {
"name": "Jordan Smith",
"email": "jor@dan.org",
"id": 236,
"meta_data": {
"zip_code": "35956"
}
},
"issuer": {
"name": "Example Organization",
"description": null,
"url": "http://www.accredible.com",
"id": 4897
},
"meta_data": {
"foo": "bar"
}
}
}
### Delete a Credential [DELETE]
[Deleting Credentials - Video Walkthrough](https://www.loom.com/share/5cf48b55e1a74803bb9ad3ce87bdc657?sid=44bb79e9-47ee-4070-9e03-bc6a68957789)
+ Parameters
+ id (string) - ID of the credential for the particular Credential requested.
+ Request (application/json)
+ Headers
Authorization: Token token=YOUR API _KEY
+ Response 200 (application/json)
{
"credential": {
"id": "10000005",
"name": "Example Certificate",
"description": "This is an example description - you can write anything you want here.\n\nWe recommend describing the achievement.",
"approve": true,
"grade": null,
"complete": true,
"issued_on": "2014-08-14",
"course_link": "https://www.accredible.com",
"custom_attributes": {
"Location": "London"
},
"expired_on": null,
"group_name": "Example Certificate Design",
"group_id": 9549,
"url": "https://www.credential.net/10000005",
"encoded_id": "10000005",
"private": false,
"seo_image": "https://api.accredible.com/v1/frontend/credential_seo_image/10000005",
"certificate": {
"image": {
"preview": "https://api.accredible.com/v1/frontend/credential_website_embed_image/certificate/10000005"
}
},
"badge": {
"image": {
"preview": "https://api.accredible.com/v1/frontend/credential_badge_image/10000005"
}
},
"evidence_items": [
{
"id": 826,
"description": "Final Grade",
"preview_image_url": null,
"link_url": null,
"type": "grade",
"string_object": {
"grade": 80
},
"supplemental": false,
"position": 1
},
{
"id": 10,
"description": "Presentation",
"preview_image_url": "https://s3.amazonaws.com/staging_accredible_api_evidence_items/previews/10/medium/open-uri20140316-15300-14jngj.jpg?1408372366",
"link_url": "https://s3.amazonaws.com/staging_accredible_api_evidence_items/files/10/original/open-uri20140316-15300-14jngj.pdf",
"type": "file",
"string_object": null,
"supplemental": true,
"position": 4
}
],
"references": [
{
"id": 2,
"description": "Although he had difficulty with the course material at first, John learned a lot throughout the course. His final project was one of the best in his class.",
"relationship": "mentored",
"supplemental": false,
"approve": true,
"referee": {
"name": "Example Person",
"email": null,
"avatar": "https://s3.amazonaws.com/staging_accredible_api_individuals/images/4/thumb/open-uri20140815-11960-1r0hppg?1408416647"
}
}
],
"recipient": {
"name": "Jordan Smith",
"email": "jor@dan.org",
"id": "net772",
"meta_data": null
},
"issuer": {
"name": "Example Organization",
"description": null,
"url": "http://www.accredible.com",
"id": 4897
},
"meta_data": null
}
}
## All Credentials DEPRECATED [/v1/all_credentials{?group_id}{?email}{?page_size}{?page}{?recipient_id}]
### View many Credentials [GET]
[View Many Credentials - Video Walkthrough](https://www.loom.com/share/520347485c3b44c7b64daeb17f1b307b?sid=9deb6be0-e636-4a03-ac2a-3dc831b1e3ad)
+ Parameters
+ group_id (string, optional) - Limit the returned Credentials to a specific group ID.
+ email (string, optional) - Limit the returned Credentials to a specific recipient's email address.
+ recipient_id (string, optional) - Limit the returned Credentials to a specific recipient user identifier (ID) you set whilst creating Credentials.
+ license_id (string, optional) - Limit the returned Credential to a specific credential id you set whilst creating credential.
+ start_date (string, optional) - Date after which credentials issued should be return. Format: YYYY-MM-DD (DD/MM/YYYY also works but is deprecated)
+ end_date (string, optional) - Date before which credetials issued should be return. Format: YYYY-MM-DD (DD/MM/YYYY also works but is deprecated)
+ start_updated_date (string, optional) - Date after which Credentials updated should be returned. Format: YYYY-MM-DD (DD/MM/YYYY also works but is deprecated)
+ end_updated_date (string, optional) - Date before which Credentials updated should be returned. Format: YYYY-MM-DD (DD/MM/YYYY also works but is deprecated)
+ page_size(number, optional) - The pagination response size, default of 50.
+ page(number,optional) - The pagination page.
+ Request (application/json)
+ Headers
Authorization: Token token=YOUR API_KEY
+ Response 200 (application/json)
{
"credentials": [
{
"id": 10250009,
"name": "TestCourse",
"description": "Test Description",
"grade": null,
"complete": true,
"issued_on": "2015-07-03",
"allow_supplemental_references": null,
"allow_supplemental_evidence": null,
"course_link": "http://example.com",
"custom_attributes": null,
"expired_on": null,
"group_name": "test",
"private": false,
"recipient": {
"name": "John Doe",
"email": "person2@example.com",
"id": 772,
"meta_data": {
"zip_code": "10459"
}
},
"issuer": {
"name": "Example Provider",
"description": " Best place to manage online learning",
"url": "http://www.accredible.com"
},
"meta_data": {
"foo": "bar"
}
},
{
"id": 10250010,
"name": "TestCourse",
"description": "Test Description",
"grade": null,
"complete": true,
"issued_on": "2015-07-03",
"allow_supplemental_references": null,
"allow_supplemental_evidence": null,
"course_link": "http://example.com",
"custom_attributes": null,
"expired_on": null,
"group_name": "test",
"private": false,
"recipient": {