DICE ID is a platform that provides ability to onboarded organizations to issue credentials to their end users and customers for variety of use cases. The steps to issue a credential can be summarized as:
Schema Creation - this is a one-time setup required to define the attributes of a credential from DICE ID console UI. Once a schema is created then any number of credentials can be issued based on that. For credentials that represent skill of an individual and should contain a certificate generated on DICE ID platform, Cred_URL attribute is mandatory.
Creating Certificate Template - This is an optional one time setup required only if the credential is required to contain a certificate then a certificate template needs to be setup. Based on the certificate template the Cred_URL attribute will be populated with link to the certificate.
Generating API access key - this is one-time activity to be done from DICE ID console UI. An x-api-key will be generated that has to be used for accessing DICE ID APIs.
Obtaining Bearer Token - this step involves generating a token that represents your role on DICE ID platform and is required for authorization check
Initiating Credential Issuance - this step involves invoking an API to send an invitation email or SMS to the user and setting up of auto-issuance by providing the credential data.
The sections below will cover each of the above steps in detail.
We will take example of a Skill based credential which represents course completion or skill assessment for an individual for which a certificate is also provided.
In DICE ID console UI navigate to Credentials --> Schemas page from the left hand menu. Click on Add Schema option on this screen.
On the Add Schema screen, enter the name of the credential, version number and attributes.
Since this schema is being created to represent the structure for a skill based credential and will contain a certificate, the "Schema used for Certificate Issuance?" should be selected, which will automatically add Cred_URL attribute. During credential issuance this attributed will get auto-populated with the link to the certificate generated from DICE ID platform.
The rest of attributes and data types will be:
Name - name of the individual who completed the course or assessment
Skill - name of the skill or course for which the individual got certified
Issued Date - the date on which the certificate was issued
Valid Till - the date till which this credential and certificate is valid.
dice_display_name - A user friendly name for the credential that will get displayed in DICE ID mobile app
Click on "Create Schema" at the bottom of the screen to submit so that the schema and corresponding credential definition gets created on blockchain. You should see a confirmation message and schema listed on the following screen.
Copy the schema name and version for subsequent step of issuing credential.
3. Create Certificate Template
Since this credential is based on a Schema containing "Cred_URL" attribute that will contain the certificate URL so it is mandatory to select the Certificate Template. Detailed steps on how to create a certificate template are covered in Certificate Template
Once the template is created copy the Certificate Template ID from its detailed screen
4. Get API Access Key
Navigate to API Access from the left hand menu on Console UI. Click on "Generate Key" to get your API key as shown below.
Copy the values for API Key, Organization ID and User ID for subsequent step of issuing credential
5. Get Bearer Token
This step is required to be implemented in your application while integrating with DICE ID so that you can get the authorization token that represents your role and access levels.
You should now have the following details:
Schema name and version from Step 2
Certificate Template ID from Step 3
Organization ID, User ID and API key from Step 4
Using these values invoke an API from your application.
Replace these sample values with the one you copied from console UI
This step needs to be implemented in your application to automatically issue credentials to your application user on a real-time basis without any manual intervention. This should be implemented based on appropriate event in your application flow e.g. when user completes their certification and all the required data is available for credential issuance.
You should now have the following details:
Schema name and version from Step 2
Certificate Template ID from Step 3
Organization ID, User ID and API key from Step 4
Authorization Token from Step 5
Invoke the credential issuance API as shown below. Please make sure to use the values obtained from earlier steps
In the above sample the following is the mapping of the headers
Org_id is the Organization ID
Invoked_by is the User ID
x-api-key is the API key
Authorization is the "Bearer "+token obtained in step 5
The response that will be retuned by this API will contain a record_id which represents the credential issuance.
{"status":"Success","result": {"record_id":"7c31ec52-e2b9-429c-af7d-7a50b71861a8", "message": "Record received successfully and added to queue for processing. 'GET /cred/issuance/record/7c31ec52-e2b9-429c-af7d-7a50b71861a8' to get status of record"
}}
You can invoke the GET API specified in the message to get the current status of credential issuance, which will contain all the details of the credential.
How will user / customer get the credentials?
User needs to have access to their inbox which contains the email received from no-reply@diceid.com. The email contains instructions to download DICE ID app and scan the QR code in the email. Once the QR code is scanned from DICE ID app a secure connection is established with user's device and the credentials get downloaded and stored in the app.
If the user opens their email on phone then they need to click on the button provided below the QR code which redirect them to the DICE ID app installed on their phone.
API invocation using Postman
You also have the option of invoking the APIs from Postman tool by clicking on the file below and saving its content as JSON file and importing it into Postman. Please make sure to follow the instructions provided in Step-2 to Step-6 for replacing the attribute values as per your requirement.
Attribute Name
Description
"invite_modes": ["email"]
"email" and "sms" are 2 modes on sending onboarding invite to the user are supported.
"email": {
"invitee_email": "alice@gmail.com",
"email_template_id" : "email template id" }
A valid email id of the user to who credential is to be issued. The email template id is an option field and can be specified if you have created one following steps @ Email Template