Blockchain as a Service (BaaS) exposes its functionality through an HTTP-based API. Send an HTTP POST request to the BaaS endpoint with the required parameters, and the service returns a response. Both requests and responses use UTF-8 encoding.
Request syntax
BaaS APIs use RPC style. Each request follows this pattern:
http://Endpoint/?Action=xx&Parameters| Component | Description |
|---|---|
Endpoint | The BaaS API endpoint: baas.aliyuncs.com |
Action | The operation to run, such as DescribeFabricOrganization |
Version | The API version: 2018-12-21 |
Parameters | Request parameters separated by ampersands (&) |
Parameters fall into two categories:
Common parameters — included in every request; cover the API version and identity authentication. See Common parameters.
API-specific parameters — vary by operation; defined in each API's reference page.
Example request
The following request calls DescribeFabricOrganization to query a blockchain organization.
https://baas.aliyuncs.com/?Action=DescribeFabricOrganization
&Format=xml
&Version=2018-12-21
&Signature=xxxx%xxxx%3D
&SignatureMethod=HMAC-SHA1
&SignatureNonce=15215528852396
&SignatureVersion=1.0
&AccessKeyId=key-test
&Timestamp=2012-06-01T12:00:00Z
…The common parameters in this example are described below.
| Parameter | Example value | Description |
|---|---|---|
Format | xml | Response format |
Version | 2018-12-21 | API version |
Signature | xxxx%xxxx%3D | Request signature |
SignatureMethod | HMAC-SHA1 | Signature algorithm |
SignatureNonce | 15215528852396 | Unique random number |
SignatureVersion | 1.0 | Signature algorithm version |
AccessKeyId | key-test | Your AccessKey ID |
Timestamp | 2012-06-01T12:00:00Z | Request timestamp |
What's next
Common parameters — full list of parameters required in every BaaS API request