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

Issuing Verifiable Credentials

Function

This API is used to issue credentials. The time of issuance is the current time by default.

URI

POST /v1/identity/issue-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.

credentialInfo

Yes

CredentialSubjectInfo object

Credential subject details.

Table 2 CredentialSubjectInfo

Parameter

Mandatory

Type

Description

applyer

Yes

String

Applicant identifier.

issuer

Yes

String

Issuer identifier.

sequence

Yes

String

Credential sequence number.

schemaIndex

Yes

String

Credential schema index.

expirationDate

No

String

Expiration time.

data

Yes

String

Plaintext credential data.

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

vcIndex

String

VC index.

Status code: 500

Table 4 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" : "org1",
  "channelID" : "mychannel",
  "cryptoMethod" : "this is a demo",
  "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",
  "applyer" : "did:example:ebfeb1f712ebc6f1c276e12ec21",
  "issuer" : "did:example:fdsafre767f8a3hr773j4h1jkhr",
  "sequence" : "10025469331",
  "schemaIndex" : "did:example:ebfeb1f712ebc6f1c276e12ec21_IDCard",
  "data" : "{\"name\": \"xm\",\"age\": 18}"
}

Example Responses

Status code: 200

VCResponeParams Information

{
  "vcIndex" : "string"
}

Status code: 500

Error response.

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

Status Codes

Status Code

Description

200

VCResponeParams Information

500

Error response.

Error Codes

See Error Codes.