latestOpenAPI 3.0.12026-08-1091181421.2 KB

44eb39b4bd65

Issuers
BadgeClasses

Create a new BadgeClass associated with an Issuer

post/v2/issuers/{idOrEntityId}/badgeclasses

Path parameters

idOrEntityIdstring required

Request body

achievementTypestring nullable

The type of achievement

criteriaNarrativestring nullable

Markdown formatted description of the criteria

criteriaUrlstring uri nullable

External URL that describes in a human-readable format the criteria for the BadgeClass

descriptionstring nullable required

Short description of the BadgeClass

extensionsobject
imagestring nullable required

Image of the badge class as a base64-encoded data URI. External URLs are not allowed.

imageAltTextstring nullable
issuerstring nullable

Entity ID of the issuer

namestring nullable required

Name of the BadgeClass

tagsstring[] nullable

List of tags that describe the BadgeClass

Example request

{
  "achievementType": "Course",
  "criteriaUrl": "https://example.com/badge-classes/1/criteria",
  "description": "This badge is awarded to students who have demonstrated mastery of Math.",
  "expires": {
    "amount": 30
  },
  "image": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+P+/HgAFhQJ/6+gQDQAAAABJRU5ErkJggg==",
  "issuer": "ZvYydoQhRtOKalNzFPZR2A-Q",
  "name": "Math Expert",
  "ob3Properties": {
    "creditHours": 36,
    "fieldOfStudy": "Research",
    "humanCode": "R1",
    "specialization": "Computer Science Research"
  },
  "preferences": {
    "customPropertyValues": [
      {
        "propertyId": "67b32887e2a7a7d5f7adabf1"
      }
    ],
    "defaultPrintCertTemplateId": "61e9d238c5afe622816febb3",
    "enabledPrintCertTemplateIds": [
      "61e9d238c5afe622816febb3"
    ],
    "includeOnPublicPages": true
  }
}

Response

Created

errorCodestring nullable
fieldErrorsobject required
latestTermsVersioninteger nullable
nonFieldErrorsstring[] required
timestampstring date-time nullable
validationErrorsstring[] required
warningsobject required

Example response

{
  "result": [
    {
      "achievementType": "Course",
      "createdBy": "Hey7J-GRSJeu6FNnHQwNyw",
      "criteriaUrl": "https://example.com/badge-classes/1/criteria",
      "description": "This badge is awarded to students who have demonstrated mastery of Math.",
      "entityId": "iOMWsaF1QbmMCofM54JlUg",
      "entityType": "BadgeClass",
      "expires": {
        "amount": 30
      },
      "id": "68e9d238c5afe622816febb3",
      "image": "https://api.badgr.io/public/badges/iOMWsaF1QbmMCofM54JlUg/image",
      "imagePath": "uploads/badges/badgeclass-lY1LJ6K4RqG7ThGLYvWNng.png",
      "issuer": "ZvYydoQhRtOKalNzFPZR2A-Q",
      "issuerOpenBadgeId": "https://api.badgr.io/public/issuers/ZvYydoQhRtOKalNzFPZR2A",
      "name": "Math Expert",
      "ob3Properties": {
        "creditHours": 36,
        "fieldOfStudy": "Research",
        "humanCode": "R1",
        "specialization": "Computer Science Research"
      },
      "openBadgeId": "https://api.badgr.io/public/badges/iOMWsaF1QbmMCofM54JlUg",
      "originalJson": "{}",
      "preferences": {
        "customPropertyValues": [
          {
            "propertyId": "67b32887e2a7a7d5f7adabf1"
          }
        ],
        "defaultPrintCertTemplateId": "61e9d238c5afe622816febb3",
        "enabledPrintCertTemplateIds": [
          "61e9d238c5afe622816febb3"
        ],
        "includeOnPublicPages": true
      },
      "source": "local",
      "sourceUrl": "https://example.com/badge-classes/1"
    }
  ],
  "status": {
    "description": "ok"
  }
}