Create a credential schema
A credential schema must be defined. The schema may vary slightly depending on the intended format which is governed by the credential definition. The general format is defined by a JSONLD schema.
Following is an example of an mDL based schema. This request must be done using an access token
authorized to create credential schemas as or on behalf of the issuing
agent:
POST https://<host>/diagency//v2.0/diagency/credential_schemas
{
"name": "GovDMVLicense",
"version": "0.0.9",
"contexts": {
"@context": {
"schema": "http://schema.org/",
"org.iso.18013.5.1:family_name": {
"@id": "org.iso.18013.5.1:family_name",
"@type": "schema:Text"
},
"org.iso.18013.5.1:given_name": {
"@id": "org.iso.18013.5.1:given_name",
"@type": "schema:Text"
},
"org.iso.18013.5.1:birth_date": {
"@id": "org.iso.18013.5.1:birth_date",
"@type": "schema:Date"
},
"org.iso.18013.5.1:issue_date": {
"@id": "org.iso.18013.5.1:issue_date",
"@type": "schema:Date"
},
"org.iso.18013.5.1:expiry_date": {
"@id": "org.iso.18013.5.1:expiry_date",
"@type": "schema:Date"
},
"org.iso.18013.5.1:issuing_country": {
"@id": "org.iso.18013.5.1:issuing_country",
"@type": "schema:Text"
},
"org.iso.18013.5.1:issuing_authority": {
"@id": "org.iso.18013.5.1:issuing_authority",
"@type": "schema:Text"
},
"org.iso.18013.5.1:document_number": {
"@id": "org.iso.18013.5.1:document_number",
"@type": "schema:Text"
},
"org.iso.18013.5.1:portrait": {
"@id": "org.iso.18013.5.1:portrait",
"@type": "schema:ImageObject"
},
"org.iso.18013.5.1:driving_privileges": {
"@id": "org.iso.18013.5.1:driving_privileges",
"@type": "schema:ItemList"
},
"org.iso.18013.5.1:un_distinguishing_sign": {
"@id": "org.iso.18013.5.1:un_distinguishing_sign",
"@type": "schema:Text"
}
}
}
}