Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • All APIs by default start with a prefix of /api/v1/, e.g., to get the information of a specific network, you can use  GET network/<network-uuid>
  • The POST request is a JSON structure, like the following: key: value, }
  • The response is a JSON structure, like the following:

    Code Block
    {
    	status: ‘successful’ or ‘fail’
    	data: {} // useful data for the requestor
    	msg: ‘’ // additional messages when there’s error
    }




2.

...

...

  1. POST api/v1/organizations/     #create organization,just for MSP and tls
  2. POST api/v1/nodes/     #create orderer, peer, just for MSP and tls.
  3. POST api/v1/users/   #create user, bind current user.

...

  1. POST api/v1/agents/   #create agent and connect to the resource; bind to organization.

3. Routes

3.1 Register organization and user  

...

POST api/v1/

...

  1. POST api/v1/nodes/{id}/operations/    #start, stop, restart a node.

...

  1. POST api/v1/channels #create channel

...

  1. POST api/v1/chaincode #upload the chaincode
  2. POST api/v1/chaincode{id}/operations/   #intall, instanitate the chaincode.

2.1 Agent

...

2.2 Network

...

2.3 Node

...

status

...

The status of the node

...

2.4 Organization

...

2.5 UserProfile

...

register/ #register organization and user(admin)

Body ParameterTypeNote
usernamestring
rolestring
passwordstring
passwrodAgainstring
orgNamestring
emailstring

Example

2.6 Channel

...

2.7 Chaincode

...

3. Routes

3.1 Register organization and user  

POST api/v1/register/ #register organization and user(admin)

Example:

Request Body:

Code Block
{
    "username": "test",
    "role": "administrator",
    "password": "foo",
    "passwordAgain": "foo",
    "orgName": "org1.cello.com",
    "email": "foo@email.com"
}

Example Response Body:

Code Block
{
    "data": {
        "id": "0b245629-06cf-4fa5-92d9-7109a3a64b56"
    },
    "msg": null,
    "status": "successful"
}

...