Presentation

Entity Studio SSI API base URL: https://api.entity.hypersign.id

POST/api/v1/presentation
Authorization
Header parameters
Body
credentialDocuments*array of CredDoc (object)

list of credentials

holderDid*string

list of credentials

challenge*string

Challenge can be used to match the response to a request

domain*string

domain that will receive verifiable presentation

Response

Response of presentation

Body
presentation*all of

Detail of presentaion that has created

Request
const response = await fetch('/api/v1/presentation', {
    method: 'POST',
    headers: {
      "Authorization": "Bearer JWT",
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      "credentialDocuments": [
        {
          "@context": [
            "https://www.w3.org/2018/credentials/v1",
            {
              "hs": "https://api.jagrat.hypersign.id/hypersign-protocol/hidnode/ssi/schema/sch:hid:testnet:...........:1.0:"
            },
            {
              "name": "hs:name"
            },
            "https://w3id.org/security/suites/ed25519-2020/v1"
          ],
          "id": "vc:hid:testnet:......",
          "type": [
            "VerifiableCredential",
            "nameschema"
          ],
          "expirationDate": "2027-12-10T18:30:00Z",
          "issuanceDate": "2027-12-10T18:30:00Z",
          "issuer": "did:hid:testnet:..........",
          "credentialSubject": {
            "id": "did:hid:testnet:..............."
          },
          "credentialSchema": {
            "id": "sch:hid:testnet:...............",
            "type": "JsonSchemaValidator2018"
          },
          "credentialStatus": {
            "id": "https://api.jagrat.hypersign.id/hypersign-protocol/hidnode/ssi/credential/vc:hid:testnet:...............",
            "type": "CredentialStatusList2017"
          },
          "proof": {
            "type": "Ed25519Signature2020",
            "created": "2023-01-25T17:01:02Z",
            "verificationMethod": "did:hid:testnet:...............#key-${id}",
            "proofPurpose": "assertionMethod",
            "proofValue": "z5LairjrBYkc5FtP.......................EXFHm37aDvcMtCvnYfmvQ"
          }
        }
      ],
      "holderDid": "did:hid:testnet:............",
      "challenge": "skfdhldklgjh-gaghkdhgaskda-aisgkjheyi",
      "domain": "example.com"
    }),
});
const data = await response.json();
Response
{
  "presentation": {
    "@context": [
      "https://www.w3.org/2018/credentials/v1"
    ],
    "type": [
      "VerifiablePresentation"
    ],
    "verifiableCredential": [
      {
        "@context": [
          "https://www.w3.org/2018/credentials/v1",
          {
            "hs": "https://api.jagrat.hypersign.id/hypersign-protocol/hidnode/ssi/schema/sch:hid:testnet:...........:1.0:"
          },
          {
            "name": "hs:name"
          },
          "https://w3id.org/security/suites/ed25519-2020/v1"
        ],
        "id": "vc:hid:testnet:......",
        "type": [
          "VerifiableCredential",
          "nameschema"
        ],
        "expirationDate": "2027-12-10T18:30:00Z",
        "issuanceDate": "2027-12-10T18:30:00Z",
        "issuer": "did:hid:testnet:..........",
        "credentialSubject": {
          "id": "did:hid:testnet:..............."
        },
        "credentialSchema": {
          "id": "sch:hid:testnet:...............",
          "type": "JsonSchemaValidator2018"
        },
        "credentialStatus": {
          "id": "https://api.jagrat.hypersign.id/hypersign-protocol/hidnode/ssi/credential/vc:hid:testnet:...............",
          "type": "CredentialStatusList2017"
        },
        "proof": {
          "type": "Ed25519Signature2020",
          "created": "2023-01-25T17:01:02Z",
          "verificationMethod": "did:hid:testnet:...............#key-${id}",
          "proofPurpose": "assertionMethod",
          "proofValue": "z5LairjrBYkc5FtP.......................EXFHm37aDvcMtCvnYfmvQ"
        }
      }
    ],
    "id": "vp:hid:testnet:..........................",
    "holder": "did:hid:testnet:..............",
    "proof": {
      "type": "Ed25519Signature2020",
      "created": "2023-01-25T17:01:02Z",
      "verificationMethod": "did:hid:testnet:...............#key-${id}",
      "proofPurpose": "authentication",
      "challenge": "skfdhldklgjh-gaghkdhgaskda-aisgkjheyi",
      "proofValue": "z5LairjrBYkc5FtPWeDVuLdQUzpMTBULcp3Q5YDnrLh63UuBuY6BpdiQYhTEcKBFW76TEXFHm37aDvcMtCvnYfmvQ"
    }
  }
}

POST/api/v1/presentation/request
Authorization
Header parameters
Body
challenge*string

Challenge can be used to match the response to a request

did*string

did of the verifier

templateId*string

templateId of the presentation templete to form presentation request

expiresTime*number

expiresTime for the presentation request (unix timestamp)

callbackUrl*string

callbackUrl that will receive verifiable presentation

Response

Presentation request is created

Body
id*string

id of presentation request template

from*string

did of the holder

created_time*number

Time of request creation

expires_time*number

Time at which challenge become invalid

reply_url*string

Url that will receive verifiable presentation

reply_to*array of string

list of dids to whome presentationis to be given

body*all of

Presentatioin template detail

Request
const response = await fetch('/api/v1/presentation/request', {
    method: 'POST',
    headers: {
      "Authorization": "Bearer JWT",
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      "challenge": "skfdhldklgjh-gaghkdhgaskda-aisgkjheyi",
      "did": "did:hid:<namespace>:...............",
      "templateId": "6392854982......",
      "expiresTime": 1231423,
      "callbackUrl": "https://example.com/verify/callback"
    }),
});
const data = await response.json();
Response
{
  "id": "f....8-84ae-4..2-a..3-efab....d4db",
  "from": "did:hid:testnet:...............",
  "created_time": 1675167388737,
  "expires_time": 1675177277551,
  "reply_url": "https://example.com/verify/callback",
  "reply_to": [
    "did:hid:testnet:................."
  ],
  "body": {
    "appId": "43...18-...........",
    "domain": "fyre.hypersign.id",
    "query": [
      {
        "type": "QueryByExample",
        "credentialQuery": [
          {
            "required": true,
            "reason": "We need you to prove your eligibility to work.",
            "example": {
              "@context": [
                "https://www.w3.org/2018/credentials/v1"
              ],
              "type": "AlumniCredential",
              "credentialSubject": {
                "name": "Random name",
                "id": "did:hid:testnet:............................."
              },
              "credentialSchema": {
                "id": "sch:hid:testnet:...............",
                "type": "JsonSchemaValidator2018"
              },
              "trustedIssuer": [
                {
                  "required": true,
                  "issuer": "did:hid:testnet:................"
                }
              ]
            }
          }
        ]
      }
    ]
  }
}

POST/api/v1/presentation/verify
Authorization
Header parameters
Body
presentation*all of

list of credentials

Response

presentation verification done successfully

Body
verified*boolean

resul of verification

results*array of Presentation (object)

detailed information of verification

credentialResults*array of CredentialResults (object)

verification result of credential

Request
const response = await fetch('/api/v1/presentation/verify', {
    method: 'POST',
    headers: {
      "Authorization": "Bearer JWT",
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      "presentation": {
        "@context": [
          "https://www.w3.org/2018/credentials/v1"
        ],
        "type": [
          "VerifiablePresentation"
        ],
        "verifiableCredential": [
          {
            "@context": [
              "https://www.w3.org/2018/credentials/v1",
              {
                "hs": "https://api.jagrat.hypersign.id/hypersign-protocol/hidnode/ssi/schema/sch:hid:testnet:...........:1.0:"
              },
              {
                "name": "hs:name"
              },
              "https://w3id.org/security/suites/ed25519-2020/v1"
            ],
            "id": "vc:hid:testnet:......",
            "type": [
              "VerifiableCredential",
              "nameschema"
            ],
            "expirationDate": "2027-12-10T18:30:00Z",
            "issuanceDate": "2027-12-10T18:30:00Z",
            "issuer": "did:hid:testnet:..........",
            "credentialSubject": {
              "id": "did:hid:testnet:..............."
            },
            "credentialSchema": {
              "id": "sch:hid:testnet:...............",
              "type": "JsonSchemaValidator2018"
            },
            "credentialStatus": {
              "id": "https://api.jagrat.hypersign.id/hypersign-protocol/hidnode/ssi/credential/vc:hid:testnet:...............",
              "type": "CredentialStatusList2017"
            },
            "proof": {
              "type": "Ed25519Signature2020",
              "created": "2023-01-25T17:01:02Z",
              "verificationMethod": "did:hid:testnet:...............#key-${id}",
              "proofPurpose": "assertionMethod",
              "proofValue": "z5LairjrBYkc5FtP.......................EXFHm37aDvcMtCvnYfmvQ"
            }
          }
        ],
        "id": "vp:hid:testnet:..........................",
        "holder": "did:hid:testnet:..............",
        "proof": {
          "type": "Ed25519Signature2020",
          "created": "2023-01-25T17:01:02Z",
          "verificationMethod": "did:hid:testnet:...............#key-${id}",
          "proofPurpose": "authentication",
          "challenge": "skfdhldklgjh-gaghkdhgaskda-aisgkjheyi",
          "proofValue": "z5LairjrBYkc5FtPWeDVuLdQUzpMTBULcp3Q5YDnrLh63UuBuY6BpdiQYhTEcKBFW76TEXFHm37aDvcMtCvnYfmvQ"
        }
      }
    }),
});
const data = await response.json();
Response
{
  "verified": true,
  "results": [
    {
      "@context": [
        "https://www.w3.org/2018/credentials/v1"
      ],
      "type": [
        "VerifiablePresentation"
      ],
      "verifiableCredential": [
        {
          "@context": [
            "https://www.w3.org/2018/credentials/v1",
            {
              "hs": "https://api.jagrat.hypersign.id/hypersign-protocol/hidnode/ssi/schema/sch:hid:testnet:...........:1.0:"
            },
            {
              "name": "hs:name"
            },
            "https://w3id.org/security/suites/ed25519-2020/v1"
          ],
          "id": "vc:hid:testnet:......",
          "type": [
            "VerifiableCredential",
            "nameschema"
          ],
          "expirationDate": "2027-12-10T18:30:00Z",
          "issuanceDate": "2027-12-10T18:30:00Z",
          "issuer": "did:hid:testnet:..........",
          "credentialSubject": {
            "id": "did:hid:testnet:..............."
          },
          "credentialSchema": {
            "id": "sch:hid:testnet:...............",
            "type": "JsonSchemaValidator2018"
          },
          "credentialStatus": {
            "id": "https://api.jagrat.hypersign.id/hypersign-protocol/hidnode/ssi/credential/vc:hid:testnet:...............",
            "type": "CredentialStatusList2017"
          },
          "proof": {
            "type": "Ed25519Signature2020",
            "created": "2023-01-25T17:01:02Z",
            "verificationMethod": "did:hid:testnet:...............#key-${id}",
            "proofPurpose": "assertionMethod",
            "proofValue": "z5LairjrBYkc5FtP.......................EXFHm37aDvcMtCvnYfmvQ"
          }
        }
      ],
      "id": "vp:hid:testnet:..........................",
      "holder": "did:hid:testnet:..............",
      "proof": {
        "type": "Ed25519Signature2020",
        "created": "2023-01-25T17:01:02Z",
        "verificationMethod": "did:hid:testnet:...............#key-${id}",
        "proofPurpose": "authentication",
        "challenge": "skfdhldklgjh-gaghkdhgaskda-aisgkjheyi",
        "proofValue": "z5LairjrBYkc5FtPWeDVuLdQUzpMTBULcp3Q5YDnrLh63UuBuY6BpdiQYhTEcKBFW76TEXFHm37aDvcMtCvnYfmvQ"
      }
    }
  ],
  "credentialResults": [
    {
      "verified": true,
      "results": [
        {
          "proof": {
            "type": "Ed25519Signature2020",
            "created": "2023-01-25T17:01:02Z",
            "verificationMethod": "did:hid:testnet:...............#key-${id}",
            "proofPurpose": "assertionMethod",
            "proofValue": "z5LairjrBYkc5FtP.......................EXFHm37aDvcMtCvnYfmvQ",
            "Context": [
              "https://www.w3.org/2018/credentials/v1",
              {
                "hs": "https://api.jagrat.hypersign.id/hypersign-protocol/hidnode/ssi/schema/sch:hid:testnet:z3KX4ZqoizKTaED645aV4aE8dBbnSpmQYe3xfzVBJadPY:1.0:"
              },
              {
                "name": "hs:name"
              },
              "https://w3id.org/security/suites/ed25519-2020/v1"
            ]
          },
          "verified": true,
          "verificationMethod": {
            "id": "did:hid:testnet:................................#key-${id}",
            "type": "Ed25519VerificationKey2020",
            "controller": "did:hid:method:..............",
            "publicKeyMultibase": "z28ScfSszr.............j8nCwx4DBF6nAUHu4p"
          },
          "purposeResult": {
            "valid": true
          }
        }
      ],
      "statusResult": {
        "verified": true
      },
      "credentialId": "vc:hid:testnet:......"
    }
  ]
}

Last updated