How to call APIs

更新时间:
复制 MD 格式

To call an API for Decentralized Identity Service (DIS), you send an HTTP request to the service endpoint. The request must include the required parameters as specified in the API reference. The service then returns a result. All requests and responses are encoded in UTF-8.

Request structure

DIS APIs are RPC-based. You can call these APIs by sending HTTP GET requests.

The request structure is as follows:
http(s)://[Endpoint]/?Action=CreatePersonalDID
&ClientToken=01357967-61d1-42a9-8a90-f0dd8a161411
&OwnerUniqueID=73BUce7y51BlPFxHucfjdOLC9cdWNnPqc7pyXXJe05c2twjraDPwDm1KhmD6v1d7tUyxjYoNhXLdX18zzp5rsogU87
&<Common request parameters>
This request includes the following components:
  • Endpoint: The API endpoint for the DIS service is baasdis.cn-hangzhou.aliyuncs.com.
  • Action: The operation to perform. For example, you can call CreatePersonalDID to create a personal DID.
  • Version: The API version to use. The API version for the DIS service is 2020-05-09.
  • Parameters: The request parameters, which are separated by an ampersand (&).

    Request parameters consist of common parameters and API-specific parameters. Common parameters include information such as the API version and identity verification.

The following example shows a call to CreatePersonalDID to create a personal DID:
Note Note: The examples in this document are formatted for readability.
https://baasdis.cn-hangzhou.aliyuncs.com/?AccessKeyId=***
&Action=CreatePersonalDID
&ClientToken=1F9FD46B-8B7D-41C4-BC89-F09E68388D6A
&Format=JSON
&OwnerUniqueID=***
&SignatureMethod=HMAC-SHA1
&SignatureNonce=***
&SignatureVersion=1.0
&Timestamp=2020-06-23T11%3A19%3A12Z
&Version=2020-05-09
&Signature=***