Querying a DID
Function
This API is used to query the document of a specified DID.
URI
POST /v1/identity/query-did
Request 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. |
did |
Yes |
String |
Decentralized identifier. |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
context |
String |
context |
id |
String |
Decentralized identifier. |
publicKey |
Array of DocPublicKey objects |
Public keys. |
authentication |
Array of strings |
Identifier of the DID master public key. |
recovery |
String |
Identifier of the DID backup public key, which can be used to modify the master key. |
service |
Array of Service objects |
Service list. |
proof |
Proof object |
Proof structure, which can be left empty. |
created |
String |
Creation time. |
updated |
String |
Update time. |
status |
String |
Status. |
Parameter |
Type |
Description |
---|---|---|
id |
String |
Public key identifier. |
type |
String |
Public key type. |
controller |
String |
Public key controller identifier. |
publicKeyPem |
String |
Public key certificate. |
Parameter |
Type |
Description |
---|---|---|
id |
String |
Service identifier. |
type |
String |
Service type. |
serviceEndpoint |
String |
Service endpoint. |
credentialApplySchema |
CredentialApplySchema object |
Schema used for applying for a VC. |
Parameter |
Type |
Description |
---|---|---|
type |
String |
Type. |
name |
String |
Name. |
description |
String |
Description. |
attributes |
Array of Attribute objects |
Attributes. |
Parameter |
Type |
Description |
---|---|---|
name |
String |
Name. |
type |
String |
Type. |
description |
String |
Description. |
Parameter |
Type |
Description |
---|---|---|
creator |
String |
Creator identifier. |
type |
String |
Signature type. |
created |
String |
Signature creation time. |
signatureValue |
String |
Signature. |
Status code: 500
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", "did" : "did:example:ebfeb1f712ebc6f1c276e12ec21" }
Example Responses
Status code: 200
DID document structure.
{ "context" : "https://www.w3.org/ns/did/v1", "id" : "did:example:ebfeb1f712ebc6f1c276e12ec21", "publicKey" : [ { "id" : "string", "type" : "string", "controller" : "string", "publicKeyPem" : "string" } ], "authentication" : [ "did:example:ebfeb1f712ebc6f1c276e12ec21#key-0" ], "recovery" : "string", "service" : [ { "id" : "did:example:ebfeb1f712ebc6f1c276e12ec21#xdi", "type" : "XdiService", "serviceEndpoint" : "https://xdi.example.com/8377464", "credentialApplySchema" : { "type" : "LegalCitizen", "name" : "LegalCitizen", "description" : "Certified Chinese citizens", "attributes" : [ { "name" : "name", "type" : "someType", "description" : "Identity number" } ] } } ], "proof" : { "creator" : "did:example:ebfeb1f712ebc6f1c276e12ec21", "type" : "RsaSignature2018", "created" : "1606720551", "signatureValue" : "eyJhbGciOiJSUzI1NiIsImI2NCI6ZmFsc2UsImNyaXQiOlsiYjY0I PAYuNzVBAh4vGHSrQyHUdBBPM" }, "created" : "1588921521", "updated" : "", "status" : "active" }
Status code: 500
Error response.
{ "errorCode" : "BCS.5002034", "errorMsg" : "request timed out or been cancelled" }
Status Codes
Status Code |
Description |
---|---|
200 |
DID document structure. |
500 |
Error response. |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot