Verify a JSON credential
Verify a JSON credential by providing its payload. The credential is verified against the following criteria:
- Issuer DID can be resolved, so that the referenced DID Document is available and valid and the public key is obtainable.
- Proof is valid and the credential has not been tampered with.
- JSON-LD context is valid for subject claims.
Optional verification checks:
- If
assertExpiry
is set totrue
and the credential has a set expiration date, verification will fail if the expiration date has passed. - If
checkRevocation
is set totrue
and the provided credential contains a revocation status list, verification will fail if the credential has been set torevoked
.
Analytic events
- CREDENTIAL_WEB_SEMANTIC_VERIFY_START
- CREDENTIAL_WEB_SEMANTIC_VERIFY_SUCCESS
- CREDENTIAL_WEB_SEMANTIC_VERIFY_FAIL
Request Body schema: application/jsonrequired
required | object (VerifiableCredential) Replace with the contents of the credential object from the response obtained when creating a JSON credential. Make sure you only include the contents of the |
assertExpiry | boolean Deprecated Default: true When set to |
checkRevocation | boolean Default: true When set to |
assertValidFrom | boolean Default: true When set to |
assertValidUntil | boolean Default: false When set to |
Verification completed
Bad Request
- Payload
- curl
- Node.js
- JavaScript
- Python
- C#
- Java
{- "payload": {
- "id": "873277c0-a162-11ea-8a1d-a111119347e6",
- "type": [
- "VerifiableCredential",
- "AlumniCredential"
], - "issuer": {
- "id": "did:web:organization.com",
- "name": "Example University"
}, - "issuanceDate": "2020-05-02T12:06:29.156Z",
- "credentialStatus": {
- "type": "RevocationList2020Status",
- "revocationListIndex": 1,
- "revocationListCredential": "https://tenant.vii.mattr.global/core/v1/revocation-lists/cc641396-3750-43c8-b8b8-f30d74eb3fb3"
}, - "credentialSubject": {
- "givenName": "Jamie",
- "familyName": "Doe",
- "alumniOf": "Example University"
}, - "proof": {
- "type": "Ed25519Signature2018",
- "created": "2020-05-02T12:06:29Z",
- "jws": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
- "proofPurpose": "assertionMethod",
- "verificationMethod": "did:web:organization.com"
}, - "name": "Alumni Credential",
- "description": "This credential shows that the person has attended the mentioned university."
}, - "assertExpiry": true,
- "checkRevocation": true,
- "assertValidFrom": true,
- "assertValidUntil": false
}
- 200
- 400
{- "verified": true,
- "reason": {
- "type": "string",
- "message": "string"
}
}
Create a presentation template
Creates a presentation template defining what type of credential is required for a particular verification workflow. Presentation templates are used to create presentation requests that are shared with a specific holder.
Analytic events
- PRESENTATION_WEB_SEMANTIC_TEMPLATE_CREATE_START
- PRESENTATION_WEB_SEMANTIC_TEMPLATE_CREATE_SUCCESS
- PRESENTATION_WEB_SEMANTIC_TEMPLATE_CREATE_FAIL
Request Body schema: application/jsonrequired
The template
domain required | string Informs the wallet holder what domain is the verification request coming from. The value must match your tenant URL or your custom domain (if you have one set up). If the domain validation is unsuccessful, the wallet will not let the user proceed with the verification workflow.
|
name required | string Unique value that is used internally to manage your templates. It must be unique across all presentation templates on your tenant, but is not shown to the holder. |
required | Array of CreatePresentationQueryByExample (object) or CreatePresentationQueryByFrame (object) or CreatePresentationDidAuthTemplate (object) Indicates what type of query method would be used by presentation requests created from this presentation template:
|
Presentation template created
Bad request, Invalid request body
- Payload
- curl
- Node.js
- JavaScript
- Python
- C#
- Java
{- "domain": "tenant.vii.mattr.global",
- "name": "alumni_credential_request",
- "query": [
- {
- "type": "QueryByExample",
- "credentialQuery": [
- {
- "required": true,
- "reason": "We need you to prove your alumni membership.",
- "example": {
- "type": "AlumniCredential",
- "trustedIssuer": [
- {
- "required": true,
- "issuer": "did:key:z6MkjBWPPa1njEKygyr3LR3pRKkqv714vyTkfnUdP6ToFSH5"
}
]
}
}
]
}
]
}
- 201
- 400
{- "id": "364b6a1b-3600-4927-a6ac-4d66aa6bbac3",
- "domain": "tenant.vii.mattr.global",
- "name": "alumni_credential_request",
- "query": [
- {
- "type": "QueryByExample",
- "credentialQuery": [
- {
- "required": true,
- "reason": "We need you to prove your alumni membership.",
- "example": {
- "type": "AlumniCredential",
- "trustedIssuer": [
- {
- "required": true,
- "issuer": "did:key:z6MkjBWPPa1njEKygyr3LR3pRKkqv714vyTkfnUdP6ToFSH5"
}
]
}
}
]
}
]
}
Retrieve all presentation templates
Returns a list of all presentation templates on your tenant.
Analytic events
- PRESENTATION_WEB_SEMANTIC_TEMPLATE_RETRIEVE_LIST_START
- PRESENTATION_WEB_SEMANTIC_TEMPLATE_RETRIEVE_LIST_SUCCESS
- PRESENTATION_WEB_SEMANTIC_TEMPLATE_RETRIEVE_LIST_FAIL
Presentation templates retrieved
- curl
- Node.js
- JavaScript
- Python
- C#
- Java
- 200
{- "nextCursor": "Y3JlYXRlZEF0PTIwMjAtMDgtMjVUMDY6NDY6MDkuNTEwWiZpZD1hNjZmZmVhNS04NDhlLTQzOWQtODBhNC1kZGE1NWY1M2UzNmM",
- "data": [
- {
- "id": "64e45290-9980-11ea-b872-f1bee5fb328f",
- "domain": "tenant.vii.mattr.global",
- "name": "alumni_credential_request",
- "query": [
- {
- "type": "QueryByExample",
- "credentialQuery": [
- {
- "required": true,
- "reason": "string",
- "example": [
- { }
]
}
]
}
]
}
]
}
Retrieve a presentation template
Retrieve an existing presentation template by its ID.
Analytic events
- PRESENTATION_WEB_SEMANTIC_TEMPLATE_RETRIEVE_START
- PRESENTATION_WEB_SEMANTIC_TEMPLATE_RETRIEVE_SUCCESS
- PRESENTATION_WEB_SEMANTIC_TEMPLATE_RETRIEVE_FAIL
Presentation template retrieved
Invalid templateId parameter format
Not Found
- curl
- Node.js
- JavaScript
- Python
- C#
- Java
- 200
- 400
- 404
{- "id": "64e45290-9980-11ea-b872-f1bee5fb328f",
- "domain": "tenant.vii.mattr.global",
- "name": "alumni_credential_request",
- "query": [
- {
- "type": "QueryByExample",
- "credentialQuery": [
- {
- "required": true,
- "reason": "string",
- "example": [
- {
- "@context": [
- null
], - "type": "AlumniCredential",
- "trustedIssuer": [
- { }
]
}
]
}
]
}
]
}
Delete a presentation template
Deletes an existing presentation template by its ID.
Analytic events
- PRESENTATION_WEB_SEMANTIC_TEMPLATE_DELETE_START
- PRESENTATION_WEB_SEMANTIC_TEMPLATE_DELETE_SUCCESS
- PRESENTATION_WEB_SEMANTIC_TEMPLATE_DELETE_FAIL
Presentation template deleted
Invalid templateId parameter format.
Not Found
- curl
- Node.js
- JavaScript
- Python
- C#
- Java
- 400
- 404
{- "code": "string",
- "message": "string",
- "details": [
- {
- "value": "string",
- "msg": "Invalid value",
- "param": "id",
- "location": "body"
}
]
}
Update a presentation template
Updates an existing presentation template by its ID.
Analytic events
- PRESENTATION_WEB_SEMANTIC_TEMPLATE_UPDATE_START
- PRESENTATION_WEB_SEMANTIC_TEMPLATE_UPDATE_SUCCESS
- PRESENTATION_WEB_SEMANTIC_TEMPLATE_UPDATE_FAIL
Request Body schema: application/json
id | string |
domain required | string Informs the wallet holder what domain is the verification request coming from. The value must match your tenant URL or your custom domain (if you have one set up). If the domain validation is unsuccessful, the wallet will not let the user proceed with the verification workflow.
|
name required | string Unique value that is used internally to manage your templates. It must be unique across all presentation templates on your tenant, but is not shown to the holder. |
required | Array of CreatePresentationQueryByExample (object) or CreatePresentationQueryByFrame (object) or CreatePresentationDidAuthTemplate (object) Indicates what type of query method would be used by presentation requests created from this presentation template:
|
OK
- Payload
- curl
- Node.js
- JavaScript
- Python
- C#
- Java
{- "id": "string",
- "domain": "string",
- "name": "string",
- "query": [
- {
- "type": "QueryByExample",
- "credentialQuery": [
- {
- "required": true,
- "reason": "string",
- "example": [
- {
- "@context": [
- null
], - "type": "AlumniCredential",
- "trustedIssuer": [
- { }
]
}
]
}
]
}
]
}
- 200
{- "id": "64e45290-9980-11ea-b872-f1bee5fb328f",
- "domain": "tenant.vii.mattr.global",
- "name": "alumni_credential_request",
- "query": [
- {
- "type": "QueryByExample",
- "credentialQuery": [
- {
- "required": true,
- "reason": "string",
- "example": [
- {
- "@context": [
- null
], - "type": "AlumniCredential",
- "trustedIssuer": [
- { }
]
}
]
}
]
}
]
}
Create a presentation request
Creates a short lived presentation request based on an existing presentation template. The request is returned in the form of a JWM message and must be signed and sent to the holder via one of the following methods:
Analytic events
- PRESENTATION_WEB_SEMANTIC_REQUEST_CREATE_START
- PRESENTATION_WEB_SEMANTIC_REQUEST_CREATE_SUCCESS
- PRESENTATION_WEB_SEMANTIC_REQUEST_CREATE_FAIL
Request Body schema: application/jsonrequired
The presentation request payload
Presentation request created
Bad Request
- Payload
- curl
- Node.js
- JavaScript
- Python
- C#
- Java
{- "challenge": "64e45290-9980-11ea-b872-f1bee5fb328f",
- "did": "did:key:z6Mkt7bFYc4V2HdAxwhMtaY6cgJckYXwhYdPLJCcnVqzrkpr",
- "templateId": "64e45290-9980-11ea-b872-f1bee5fb328f",
- "expiresTime": 1592955632103,
}
- 201
- 400
{- "id": "c74128a0-9949-11ea-9554-b5a630b3c119",
- "request": {
- "id": "c74128a0-9949-11ea-9554-b5a630b3c119",
- "from": "did:key:z6MkrYVmyqSA93o4B1GwERM8kaQDMAUKAFV2TC3weQKeg9Gq",
- "created_time": 1606709582907,
- "expires_time": 2594859115000,
- "reply_to": [
- "did:key:z6MkrYVmyqSA93o4B1GwERM8kaQDMAUKAFV2TC3weQKeg9Gq"
], - "body": {
- "id": "64e45290-9980-11ea-b872-f1bee5fb328f",
- "domain": "tenant.vii.mattr.global",
- "name": "alumni_credential_request",
- "query": [
- {
- "type": "QueryByExample",
- "credentialQuery": [
- {
- "required": true,
- "reason": "string",
- "example": [
- { }
]
}
]
}
], - "challenge": "e1b35ae0-9e0e-11ea-9bbf-a387b27c9e60"
}
},
}
Verify a verifiable presentation
Verifies a provided verifiable presentation that adheres to the W3C Verifiable Credential Data Model:
- Ensures the presentation conforms to the VC Data model.
- For each
verifiableCredential
objects:- Issuer DID can be resolved.
- JSON-LD context is valid for subject claims.
- Proof is valid & the credential has not been tampered with.
- Is not in a
revoked
status on aRevocationList2020
. - The proof is valid for each subjectDID to prove ownership.
- Valid proof exists for the presentation
holderDID
.
The request must include a presentation
object that adheres to the W3C Verifiable Credential Data Model.
If a challenge
and/or domain
is provided they are used for credential verification. Otherwise, the challenge
and/or domain
within the presentation proof is used instead.
Analytic events
- PRESENTATION_WEB_SEMANTIC_VERIFY_START
- PRESENTATION_WEB_SEMANTIC_VERIFY_SUCCESS
- PRESENTATION_WEB_SEMANTIC_VERIFY_FAIL
Presentation verification completed
Bad Request
- Payload
- curl
- Node.js
- JavaScript
- Python
- C#
- Java
{- "presentation": {
- "@context": [
- { }
], - "type": [
- { }
], - "verifiableCredential": [
- {
- "type": [
- "VerifiableCredential",
- "AlumniCredential"
], - "issuer": {
- "id": "did:web:organization.com",
- "name": "Example University",
}, - "credentialBranding": {
- "backgroundColor": "#B00AA0",
}, - "issuanceDate": "2020-05-02T12:06:29.156Z",
- "credentialStatus": {
- "type": "RevocationList2020Status",
- "revocationListIndex": 1,
- "revocationListCredential": "https://tenant.vii.mattr.global/core/v1/revocation-lists/cc641396-3750-43c8-b8b8-f30d74eb3fb3"
}, - "credentialSubject": {
- "givenName": "Jamie",
- "familyName": "Doe",
- "alumniOf": "Example University"
}, - "proof": {
- "type": "Ed25519Signature2018",
- "created": "2020-05-02T12:06:29Z",
- "jws": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
- "proofPurpose": "assertionMethod",
- "verificationMethod": "did:web:organization.com"
}, - "name": "Alumni Credential",
- "description": "This credential shows that the person has attended the mentioned university."
}
], - "id": "string",
- "holder": "string",
- "proof": [
- {
- "type": "string",
- "created": "string",
- "challenge": "string",
- "domain": "string",
- "jws": "string",
- "proofPurpose": "string",
- "verificationMethod": "string"
}
]
}, - "challenge": "3182bdea-63d9-11ea-b6de-3b7c1404d57f",
- "domain": "example.com"
}
- 200
- 400
{- "verified": true
}