Skip to main content

GET /credentials/:credentialId

Retrieve a Verifiable Credential by its ID.

{{baseUrl}}/credentials/:credentialId

Headers

HeaderTypeDescription
x-api-keystringThe API key required for authentication.

Path Parameters

ParameterTypeDescription
credentialIdstringThe unique identifier of the Verifiable Credential.
credentialId: DegreeCredential8fa09780-23b2-4b9c-a7b5-c9d292fd9826

Click Send and wait for the response.

Response (Success - 200)

ParameterTypeDescription
_idstringUnique identifier for the Verifiable Credential document.
@contextarrayThe JSON-LD context of the Verifiable Credential.
idstringUnique identifier for the Verifiable Credential.
typearrayThe types associated with this Verifiable Credential.
issuerstringThe DID of the entity issuing the credential.
issuanceDatestringThe issuance date of the Verifiable Credential.
expirationDatestringThe expiration date of the Verifiable Credential.
credentialSubjectarrayThe subject details of the Verifiable Credential.
proofobjectThe cryptographic proof for this credential.
__vnumberDocument version.

Sample Response Body:

{
"proof": {
"type": "HederaConsensusProof",
"created": "2024-10-23T10:03:50.676Z"
},
"_id": "6718ca08d4bb053d570669ea",
"@context": [
"https://www.w3.org/2018/credentials/v1"
],
"id": "DegreeCredential8fa09780-23b2-4b9c-a7b5-c9d292fd9826",
"type": [
"VerifiableCredential",
"DegreeCredential"
],
"issuer": "did:earthid:testnet:HwetGVKwLAu12HRZaCKcMxdijsjxdSc7Lw1KSzC6FYDR:0.0.5021630",
"issuanceDate": "2024-10-23T10:03:50.676Z",
"expirationDate": "+020245-10-23T10:03:50.676Z",
"credentialSubject": [
{
"id": "did:earthid:testnet:CqfgWPDd67TBe3wieHhhD9y9M6AderRRJnozU12DdP2t:0.0.5021687",
"degree": "Bachelor of Computer Science",
"dateOfBirth": "01-01-2000",
"city": "Delhi"
}
],
"__v": 0
}

Response (Server Error - 500)

ParameterTypeDescription
errorstringDescribes the error that occurred.

Sample Response Body:

{
"error": "Server error"
}