Updated on 2023-04-26 GMT+08:00

Querying the BCS Service List

Function

This API is used to query the basic information of all BCS services under the specified project.

URI

GET /v2/{project_id}/blockchains

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID obtained from IAM. Generally, a project ID contains 32 characters.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token obtained from IAM.

Minimum: 1

Maximum: 32768

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

blockchains

Array of BlockchainInfo objects

BCS service basic information.

count

Long

Total number of instances.

Table 4 BlockchainInfo

Parameter

Type

Description

id

String

BCS service instance ID.

name

String

Service name.

Status code: 400

Table 5 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

Minimum: 8

Maximum: 36

error_msg

String

Error message.

Minimum: 2

Maximum: 512

Status code: 401

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

Minimum: 8

Maximum: 36

error_msg

String

Error message.

Minimum: 2

Maximum: 512

Status code: 403

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

Minimum: 8

Maximum: 36

error_msg

String

Error message.

Minimum: 2

Maximum: 512

Status code: 404

Table 8 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

Minimum: 8

Maximum: 36

error_msg

String

Error message.

Minimum: 2

Maximum: 512

Status code: 500

Table 9 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

Minimum: 8

Maximum: 36

error_msg

String

Error message.

Minimum: 2

Maximum: 512

Example Requests

None

Example Responses

Status code: 200

Ok

{
  "blockchains" : [ {
    "id" : "b268e1ca-b5c2-28f1-1e57-f571e14ecdbd",
    "name" : "marbles"
  }, {
    "id" : "75022dfb-e186-539e-cbc7-14020c934dd0",
    "name" : "bcs-api"
  }, {
    "id" : "04a33954-c707-4ab5-9d1a-b5e37624e56e",
    "name" : "bcs-orgs"
  }, {
    "id" : "4265b6ac-c7fd-b851-7dbc-1572364da341",
    "name" : "bcs-dz8lo7"
  } ],
  "count" : 3
}

Status code: 400

Bad Request

{
  "error_code" : "BCS.4006005",
  "error_msg" : "keyType error, keyType: blok not supported"
}

Status code: 401

Unauthorized

{
  "error_code" : "BCS.4010401",
  "error_msg" : "Incorrect token or token resolution failed"
}

Status code: 403

Forbidden

{
  "error_code" : "BCS.4030403",
  "error_msg" : "No permissions to request this method"
}

Status code: 404

Not Found

{
  "error_code" : "BCS.4040404",
  "error_msg" : "Not Found:the url is not found"
}

Status code: 500

InternalServerError

{
  "error_code" : "BCS.5000500",
  "error_msg" : "Internal Server Error"
}

Status Codes

Status Code

Description

200

Ok

400

Bad Request

401

Unauthorized

403

Forbidden

404

Not Found

500

InternalServerError

Error Codes

See Error Codes.