Verifiable Credentials API Intro
This page introduces working with Verifiable Credentials through the VDP API. The full set of relevant endpoints are listed on the VDP OpenAPI Spec, notably in these sections:
- https://platform.transmute.industries/openapi/openapi.yaml#tag–Interoperability
- https://platform.transmute.industries/openapi/openapi.yaml#tag–Credentials
Basic, standards-compliant Verifiable Credentials can be issued with the
/credentials/issue
endpoint:curl --location --request POST 'https://platform.transmute.industries/credentials/issue' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
"credential": {
"@context": [
"https://www.w3.org/2018/credentials/v1"
],
"id": "urn:uuid:0da152f5-58eb-4352-ab0e-f247700182ef",
"type": [
"VerifiableCredential"
],
"issuer": "did:key:z6MkjcrxZHykMdAQBv4tqyayg2caVET2bgdj5iiM8V8yseXK",
"issuanceDate": "2010-01-01T19:23:24Z",
"credentialSubject": {
"id": "did:example:123"
}
},
"options": {
"type": "Ed25519Signature2018"
}
}'
Note that if you are using the request payload example from the OpenAPI Spec, the
issuer
must be changed to one of your organization’s DIDs – you can only sign with your own private keys.Note!
Remember that the issuer must be a DID, not a DID URL – the
issuer
must not contain a fragment (#
).It is important to understand the content of this request payload. Below is a brief introduction to get started, please see the VC specification for a complete reference.
The response of this call is a Verifiable Credential:
{
"@context": ["https://www.w3.org/2018/credentials/v1"],
"id": "urn:uuid:4eec2d83-2cbe-4b66-b845-266681e89aa3",
"type": ["VerifiableCredential"],
"issuer": "did:key:z6MkjcrxZHykMdAQBv4tqyayg2caVET2bgdj5iiM8V8yseXK",
"issuanceDate": "2010-01-01T19:23:24Z",
"credentialSubject": {
"id": "did:example:123"
},
"proof": {
"type": "Ed25519Signature2018",
"created": "2022-05-24T11:51:46Z",
"verificationMethod": "did:key:z6MkjcrxZHykMdAQBv4tqyayg2caVET2bgdj5iiM8V8yseXK#z6MkjcrxZHykMdAQBv4tqyayg2caVET2bgdj5iiM8V8yseXK",
"proofPurpose": "assertionMethod",
"jws": "eyJhbGciOiJFZERTQSIsImI2NCI6ZmFsc2UsImNyaXQiOlsiYjY0Il19..fupFQg5_7e0qSTWtK2VQuiBPV9PHwIITu_QcQTJJY5Rg8x5zpTt7h5-P0JSbKInhl89ACkG90y6qdj0IEdwrCA"
}
}