Skip to content

Latest commit

 

History

History
66 lines (50 loc) · 1.47 KB

File metadata and controls

66 lines (50 loc) · 1.47 KB

Retrieving token balance

Retrieves the token balance of the authorized FIB user's peer account at the time of the request.

Protocol: HTTP

EncodingJSON

Endpoint/data/api/v1/wallet-management/balance

MethodGET

Header: Authorization — represented by a string that is the accessToken value that was returned either at the authorization, or the previous time the token has been refreshed.

Input/request structure

A GET request to the endpoint with the Authorization header specified.

Output/response structure

::: details Show

::: code-group Data structure

{
  status: {
    code: integer($int32),
    name: 'string'
  },
  data: {
    tokenId: {
      definitionId: 'assetName#assetDomain',
      accountId: 'accountName@accountDomain'
    },
    balance: integer($int64)
  }
}
{
  status: {
    code: 200,
    name: 'OK'
  },
  data: {
    tokenId: {
      definitionId: 'credit#admin',
      accountId: 'admin@admin'
    },
    balance: 500
  }
}

:::

Responses

Response Code Description
200 Token balance has been retrieved successfully.
401 accessToken is either expired or invalid.
403 Forbidden (in case a non-admin peer attempts to request the credit balance of another peer).
500 Internal server error.