Skip to main content

Request the Status of an Issued Verifiable Credential (VC)

Request the status of an issued Verifiable Credential (VC) using the BlockID SDK. As defined in the W3C Verifiable Credentials Data Model, the credential status property provides information about the current status of a verifiable credential, such as whether it is suspended or revoked.

The BlockID SDK allows users to request the status of credentials issued by 1Kosmos. Please see Request a Verifiable Credential (VC) for a Driver's License and Request a Verifiable Credential (VC) for an Employment Card for information on how to request an issued Verifiable Credential.

Prerequisites

Users first need to request a Verifiable Credential. Once a credential has been issued, users can request the status of an issued credential.

Please see the pages below for more information on how to request a verifiable credential for a Driver's License or Employment Card:

Once a credential has been issued, the credential will contain different parameters containing values. Only the string from the id parameter of the issued credential is needed to check the status.

issuedVerifiableCredential
{
"vc": {
"@context": [
...,
],
"id":"did:blockid:442ac157-4fb2-4dd3-99b3-ee4306deb5d1", // This string is needed to check the status of the credential
...,
],
}
}

Request a Verifiable Credential (VC) Status for your Driver's License

Parameters

  • dns: tenant domain as shown in the dashboard
  • communityName: tenant community as shown in the dashboard
  • licenseKey: tenant license key as shown in the dashboard
  • vcId: the id string from the issued Verifiable Credential to check the status of

Request Format

tip

All requests are plug-and-play, not copy-paste. Please ensure that you are replacing the parameters in the request format below with the actual values

Please use the following format outlined below to request the status of an issued verifiable credential. In this example we are requesting the status of an issued Driver's License credental:

  • Add dependencies and set tenant info
const BIDTenant = require("blockid-nodejs-helpers/BIDTenant.js");
const BIDVerifiableCredential = require("blockid-nodejs-helpers/BIDVerifiableCredential.js");

const tenantInfo = {
dns: "<tenant dns>",
communityName: "<community name>",
licenseKey: "<license key>",
};
  • Request VC status
async function getVcStatusById(vcId) {
let vcStatus = await BIDVerifiableCredential.getVcStatusById(tenantInfo, vcId);

console.log("vcStatus::::::", JSON.stringify(vcStatus));

return vcStatus;
}

// Calling getVcStatusById function
getVcStatusById(<vcId>);

Example Request

We've provided a complete example request below for reference:

tip

The vcID shown here is taken from the Driver's License VC response Dummy information is provided in this example

const BIDTenant = require("blockid-nodejs-helpers/BIDTenant.js");
const BIDVerifiableCredential = require("blockid-nodejs-helpers/BIDVerifiableCredential.js");

let tenantInfo = {
dns: "blockid-trial.1kosmos.net",
communityName: "devx",
licenseKey: "9b074532-845b-4c75-ba3e-2b8950000000",
};

async function getVcStatusById(vcId) {
let vcStatus = await BIDVerifiableCredential.getVcStatusById(
tenantInfo,
vcId
);

console.log("vcStatus::::::", JSON.stringify(vcStatus));

return vcStatus;
}

getVcStatusById("did:blockid:442ac157-4fb2-4dd3-99b3-ee4306deb5d1");

Server Responses

Please review the responses below for expected output after requesting the status of an issued Verifiable Credential.

tip

Dummy information is provided in this example

200 OK
{
"result": {
"subject": {
"did": "did:2a651b36-c582-46cb-995c-f60380104c70",
"publicKey": "aRnlolY2VlKAgOsdB2zmry0YzfiXYDt5GrCYyZIX4ITkNpMMuoTR/rKHuzDr7hKBhwBnAm+6LGnyuPSY/WK9XQ=="
},
"type": [
"VerifiableCredential",
"DriversLicenseCredential"
],
"_id": "6396b97e028c790013b4c144",
"vcID": "did:blockid:442ac157-4fb2-4dd3-99b3-ee4306deb5d1",
"tenantId": "63627082d0b7e36525e281aa",
"communityId": "63627302d0b7e36525e2828d",
"proof": {
"type": "Ed25519Signature2020",
"created": "2022-12-12T05:17:50Z",
"verificationMethod": "did:key:blockid:z6MkvFNv22WzDetLgdzYidCFQJosD5Z9pDr9cmX7RtREuoji",
"proofPurpose": "assertionMethod",
"proofValue": "z3sMWYFHUZeo11jysZMX2f2dVpubJ47Li6uJHYBUYCWR8UjCp3wszbfy6ZBmy9YBj4HAw2kF6zDyagqsUh43zZrRh"
},
"issueTS": 1670822270,
"expiryTS": 1813449600,
"status": "issued",
"issuer": {
"id": "did:blockid:dmv:USA:WA"
}
}
}