Updated on 2022-12-06 GMT+08:00

This API is used to query a credential by index.

Function

This API is used to query a credential by index.

URI

POST /v1/identity/query-vc

Request Parameters

Table 1 Request body parameters

Parameter

Mandatory

Type

Description

orgID

Yes

String

Organization ID.

channelID

Yes

String

Channel ID.

cryptoMethod

Yes

String

Encryption method, which is fixed at SW.

cert

Yes

String

User certificate. Add an explicit line break (\n) at the end of each line.

sk

Yes

String

User private key. Add an explicit line break (\n) at the end of each line.

timestamp

Yes

String

Timestamp.

vcIndex

Yes

String

VC index.

Response Parameters

Status code: 200

Table 2 Response body parameters

Parameter

Type

Description

context

String

Content.

sequence

String

Serial number of the credential of the issuer.

type

Array of strings

Verifiable credential type.

issuer

String

Issuer identifier.

issuanceDate

String

Issuance date.

expirationDate

String

Credential validity period.

credentialSubject

CredentialSubject object

Credential subject.

revocation

Revocation object

Revocation.

Table 3 CredentialSubject

Parameter

Type

Description

owner

String

Applicant identifier.

type

String

Credential type.

schemaID

String

schema ID

dataURI

String

Data URI.

encryptedAeskey

String

Encrypted symmetric key.

uriType

String

Data index type.

dataHash

String

Data hash value.

Table 4 Revocation

Parameter

Type

Description

id

String

API for querying revocation or URL of the revocation list.

type

String

Revocation type.

Status code: 500

Table 5 Response body parameters

Parameter

Type

Description

errorCode

String

Error code.

Minimum: 8

Maximum: 36

errorMsg

String

Error description.

Minimum: 2

Maximum: 512

Example Requests

{
  "orgID" : "4f1439758ebb41f7411b5f684b67713c08b89198",
  "channelID" : "mychannel",
  "cryptoMethod" : "SW",
  "cert" : "-----BEGIN CERTIFICATE-----\n...\n...\n-----END CERTIFICATE-----",
  "sk" : "------BEGIN PRIVATE KEY-----\n...\n...\n-----END PRIVATE KEY-----",
  "timestamp" : "2020-10-27T17:28:16+08:00",
  "vcIndex" : 0
}

Example Responses

Status code: 200

VerifiableCredential Information

{
  "context" : "https://www.w3.org/2018/credentials/v1",
  "sequence" : "x00123456",
  "type" : [ "VerifiableCredential", "AlumniCredential" ],
  "issuer" : "https://example.edu/issuers/565049",
  "issuanceDate" : "1606720551",
  "expirationDate" : "1606720551",
  "credentialSubject" : {
    "owner" : "did:example:ebfeb1f712ebc6f1c276e12ec21",
    "type" : "professional",
    "schemaID" : "did:example:ebfeb1f712ebc6f1c276e12ec21_IDCard",
    "dataURI" : "string",
    "encryptedAeskey" : "string",
    "uriType" : "index",
    "dataHash" : "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b85"
  },
  "revocation" : {
    "id" : "string",
    "type" : "string"
  }
}

Status code: 500

Error response.

{
  "errorCode" : "stringst",
  "errorMsg" : "string"
}

Status Codes

Status Code

Description

200

VerifiableCredential Information

500

Error response.

Error Codes

See Error Codes.