GET /credentials/:credentialId
Retrieve a Verifiable Credential by its ID.
{{baseUrl}}/credentials/:credentialId
Headers
Header | Type | Description |
---|---|---|
x-api-key | string | The API key required for authentication. |
Path Parameters
Parameter | Type | Description |
---|---|---|
credentialId | string | The unique identifier of the Verifiable Credential. |
credentialId: DegreeCredential8fa09780-23b2-4b9c-a7b5-c9d292fd9826
Click Send
and wait for the response.
Response (Success - 200)
Parameter | Type | Description |
---|---|---|
_id | string | Unique identifier for the Verifiable Credential document. |
@context | array | The JSON-LD context of the Verifiable Credential. |
id | string | Unique identifier for the Verifiable Credential. |
type | array | The types associated with this Verifiable Credential. |
issuer | string | The DID of the entity issuing the credential. |
issuanceDate | string | The issuance date of the Verifiable Credential. |
expirationDate | string | The expiration date of the Verifiable Credential. |
credentialSubject | array | The subject details of the Verifiable Credential. |
proof | object | The cryptographic proof for this credential. |
__v | number | Document 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)
Parameter | Type | Description |
---|---|---|
error | string | Describes the error that occurred. |
Sample Response Body:
{
"error": "Server error"
}