Skip to Content

API Specifications

Staging (Sandbox) OCA/OCB Issuance Endpoint:

POST https://api.vc.staging.opencampus.xyz/issuer/vc

Production OCA/OCB Issuance Endpoint

POST https://api.vc.opencampus.xyz/issuer/vc

Authorization

Header: { X-API-KEY: `your api key` }

Body for OCA (raw JSON)

{ "credentialPayload": { ... }, "holderOcId": "bob.edu", "issuerReferenceId": "tt:1111222333" }

Body for OCB (raw JSON)

{ "credentialPayload": { ... }, "collectionSymbol": "ocbadge", "holderOcId": "bob.edu" OR "holderAddress": "0xabcD12345...", "issuerReferenceId": "tt:1111222333" }

About issuerReferenceId

Issuer reference ID is an optional field that is used to uniquely identify the OCA/OCB issued by the issuer. Each issuer reference ID can be only used once by each issuer. Issuance will fail if there is another OCA/OCB with the same issuer reference ID that has been issued by the same issuer before.

More on Credential Payload

Credential Payload is what you would use to represent the credential that you are issuing. We accept the following fields. Some of them are required and some of them are optional. Here we list the specifications for the credential payload based on the OpenBadge standard.

Please refer to the tables below for the explanation of specific fields, including examples how the metadata of Open Campus’s verifiable credential should be structured.

More on Images

There are 2 locations where you should provide your image URI when issuing your credentials. The image in credentialSubject follows the guideline of W3C standard for Achievement type of verifiable credential. The image in credentialPayload allows other platforms (NFT Marketplaces, Block explorers, etc.) to grab your VC image.

credentialPayload

Property NameData TypeRequiredPublicExampleRemark
awardedDatestringYY2023-09-08T16:00:00.000ZISO 8601 Date Format
descriptionstringYYmy school certificationDescription of the credential
validFromstringYY2023-09-08T16:00:00.000ZISO 8601 Date Format
validUntilstringNY2023-09-08T16:00:00.000ZISO 8601 Date Format
imagestringNYhttps://image.com/img/11111.jpgValid http uri. This should be the same as the one in credentialPayload, allowing other platforms to grab your VC image
credentialSubjectobjectYY{ … }see below details

credentialSubject

Property NameData TypeRequiredPublicExampleRemark
achievementobjectYY{ … }see below details
namestringYNBobstored but not exposed to public
emailstringYNbob@mycompany.xyzstored but not exposed to public
profileUrlstringNYhttps://mycompany.xyz/profiles/public/11223344this should be users public profile
imagestringNYhttps://image.com/img/11111.jpgValid http uri, this is in accordance to W3C standard for Achievement type
ext:OC_CUSTOM:customobjectNY{ … }unspecified blob of custom data

achievement

Property NameData TypeRequiredPublicExampleRemark
identifierstringYYa8505caa-8e3a-4c07-aae2-94944c6b52fcstored on-chain maxLength 50 characters
achievementTypestringYYCertificatesee appendix for valid achievement types
namestringYYBlockchain Certification
descriptionstringYYAn introductory blockchain bootcamp classdescription of the achievement requirement
attachmentsarrayNY[ { pdf: “….” , png: “….“ }, { … } ]no standard for internal objects
Last updated on