How to verify a JSON credential
This guide will step you through making a direct API call to verify a signed JSON credential.
Prerequisites
- A signed JSON credential.
Request
Make a request of the following structure to verify a JSON credential:
HTTP
POST /v2/credentials/web-semantic/verify
Request body
JSON
{
"payload": {
"type": ["VerifiableCredential", "EducationalOccupationalCredential", "AlumniCredential"]
//... rest of JSON credential
},
"checkRevocation": true,
"assertValidFrom": true,
"assertValidUntil": false
}
payload
: Replace with the contents of thecredential
object from the response obtained when creating a JSON credential. Make sure you only include the contents of thecredential
object and not the entire response.checkRevocation
: When set totrue
and the provided credential contains a revocation status list, verification will fail if the credential has been revoked.assertValidFrom
: When set totrue
and the credential has a set valid from date, verification will fail if the credential is not active yet (issuanceDate
is in the future).assertValidUntil
: When set totrue
and the credential has a set expiry date, verification will fail if the expiry date has passed (expirationDate
is in the past).
Response
JSON
{
"verified": true
}
verified
: Indicates whether the verification status istrue
orfalse
. When verified isfalse
, a further error body is returned with more details about the error:- The credential has been revoked.
- The Issuer DID cannot be resolved.
- The issuer public key is invalid.
- The credential JSON-LD context is invalid.
- The credential signature is invalid.