light-mode-image
Learn
API ReferenceJSON credentials

Sign a JSON credential

Roles

adminissuermanaged-issuer

Analytics Events

CREDENTIAL_WEB_SEMANTIC_SIGN_STARTCREDENTIAL_WEB_SEMANTIC_SIGN_SUCCESSCREDENTIAL_WEB_SEMANTIC_SIGN_FAIL
POST/v2/credentials/web-semantic/sign

Returns a signed JSON credential generated from a provided valid payload.

Analytic events

  • CREDENTIAL_WEB_SEMANTIC_SIGN_START
  • CREDENTIAL_WEB_SEMANTIC_SIGN_SUCCESS
  • CREDENTIAL_WEB_SEMANTIC_SIGN_FAIL

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Request Body

application/json

JSON credential payload to sign

Response Body

application/json

application/json

curl -X POST "https://example.vii.au01.mattr.global/v2/credentials/web-semantic/sign" \  -H "Content-Type: application/json" \  -d '{    "payload": {      "type": [        "EducationalOccupationalCredential",        "AlumniCredential"      ],      "credentialSubject": {        "id": "did:example:abcdb1f712ebc6f1c276e12ec21",        "givenName": "Jamie",        "familyName": "Doe",        "alumniOf": "<span lang=\"en\">Example University</span>"      },      "issuer": {        "id": "did:issuer:abcdb1f712ebc6f1c276e12ec21",        "name": "ABC University"      }    }  }'
{
  "id": "873277c0-a162-11ea-8a1d-a111119347e6",
  "credential": {
    "@context": [
      "https://www.w3.org/2018/credentials/v1",
      "https://mattr.global/contexts/vc-extensions/v2",
      "https://w3id.org/vc-revocation-list-2020/v1",
      "https://optionalschema.example/"
    ],
    "type": [
      "VerifiableCredential",
      "AlumniCredential"
    ],
    "issuer": "string",
    "issuanceDate": "2020-05-02T12:06:29.156Z",
    "credentialStatus": {
      "id": "https://tenant.vii.mattr.global/v1/revocation-lists/cc641396-3750-43c8-b8b8-f30d74eb3fb3#1",
      "type": "RevocationList2020Status",
      "revocationListIndex": 1,
      "revocationListCredential": "https://tenant.vii.mattr.global/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": "EXAMPLE_JWS_TOKEN_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."
  },
  "tag": "identifier123",
  "credentialStatus": {
    "id": "https://tenant.vii.mattr.global/v1/revocation-lists/cc641396-3750-43c8-b8b8-f30d74eb3fb3#1",
    "type": "RevocationList2020Status",
    "revocationListIndex": 1,
    "revocationListCredential": "https://tenant.vii.mattr.global/v1/revocation-lists/cc641396-3750-43c8-b8b8-f30d74eb3fb3"
  },
  "issuanceDate": "2020-05-02T12:06:29.156Z"
}
{
  "code": "string",
  "message": "string",
  "details": [
    {
      "value": "string",
      "msg": "Invalid value",
      "param": "id",
      "location": "body"
    }
  ]
}

How would you rate this page?