NAV Navbar
Zabo JS Client Zabo JS Server REST

Introduction

Welcome to the Zabo API! Zabo's mission is to give you one application interface to access any user wallet and any cryptocurrency. We have an active sandbox available to start your integration process, and you are welcome to register in our portal to try it out. Contact us and let us know how we can help!

About the API

Zabo distributes its API through standard REST endpoints, plus a JavaScript SDK that can be used both in a client and server environment. The most accessible entry point to connect a user is by embedding the JavaScript client SDK in your application's front-end. This client SDK provides you the Zabo object, which has functions to access wallets and cryptocurrency. From there, you can continue to use the client API/SDKs or, if you are running an application server, you can take advantage of our server-side API. The SDK files are available from the following locations:

Limitations

We set specific boundaries with the following limitations. We can lift these limitations once we understand where you need us to add better functionality for your application. Current limitations are as follows:

Pagination

Most endpoints which return a list provide cursor-based pagination. Cursor information is found inside of the list_cursor object to facilitate subsequent requests. You can paginate through the results by using the id of the last resource in the list as a cursor parameter for the next call. The API provides a convenience value in list_cursor.next_uri which can be used to call for the next page of results. When has_more is false, you have reached the end of the list. The default limit is 25, but values up to 50 are permitted. We provide all lists in descending order only (newest item first).

Query Parameters

ParameterDefaultRequiredDescription
limit25OptionalCan be values 2-50
cursorFirst resource availableOptionalID of the resource to start from

This documentation explains Zabo integration in your application. We recognize that many decentralized applications do not run a server, so we do not require an application server to interact with Zabo. With that said, we do have the ability to work with your server authenticated users, which opens up two different ways you can connect with user wallets, depending on your application's setup. See Authentication for further information. You can view code examples in the dark area to the right as you read through the documentation.

Zabo API Intro

The Zabo API section defines the functions available for use in your application. These functions provide a way for your user to connect a wallet of their choice and provide the cryptocurrency data your application needs. After connecting, the client and server API functions can be accessed from your application's client or server, respectively. Each environment both shares similar functions, and has unique functions of their own. If you are only using the API from your application client, the account connection lives for as long as their session token remains unexpired in the client. After that, the user needs to connect their account again. If you are running a server which authenticates your users and would like a persistent connection, then you can use the server-side API to assign users with established accounts.

Adding Users

Zabo allows for two different types of applications: front-end only, and server-side applications. When a user connects their cryptocurrency account using the Zabo Client API, the server provides a session token which only lasts for a specific amount of time. When time expires, or if the user clears their cache, they are required to go through the connection process again. If you are running a server-side application that already authenticates users, and would like to manage connections from your server, we provide the ability to create a user object which can hold account data. This server workflow can provide a better user experience if you are already authenticating users because they won't be required to initiate connections and authenticate twice on the front-end. These functions are outlined below.

Wallet Provider Support

Due to limitations with certain wallet providers, some functions will not work if the user connected a wallet provider that does not support those functions. Your application should plan to handle these errors gracefully. See the unsupported functions section for more information on these error types. Each function will list the currenct wallet provider support level.

Security

Application developers should note that Zabo provides a simple interface with complex networking in our back-end to facilitate a better overall cryptocurrency developer and user experience. At no point do we obtain user wallet private keys or any sensitive data required to act upon cryptocurrency holdings independently. All authentication and approvals remain in the user's hands.

Base URL

Sandbox

https://api.zabo.com/sandbox-v0

Live

https://api.zabo.com/v0

Authentication

The Zabo API requires your users to authorize a connection to the wallet they choose. Before getting to this point, you must register yourself and your application with us, develop using our sandbox environment, then contact us to go live. Once the user has connected a wallet, your application can use the various Zabo functions to pull in data and provide it to your users. The user's approval happens when a user action triggers the connection widget. If your user does not have a wallet connected with Zabo, your application should provide a button or some interaction that triggers the Zabo.connect() function documented below. From there, Zabo takes the user through the process of selecting the wallet and currencies available. When the user returns from establishing a connection, the Zabo.onConnection() event provides the relevant wallet data. See the event documentation for further details.

Front-end only apps

If you're running a front-end only application, users receive a session token that initializes the Zabo SDK for JS in the client, and you do not need to take any further action for authentication. Session tokens do have a limited time-to-live depending on user activity and, once it expires, your user needs to connect again. If you are sending REST calls, you authenticate with a Bearer token and all calls must be made from https origins. The requests must have the following header:

The Zabo SDK for JS handles this authentication for you automatically.

App Server Authentication

Zabo uses API Key authentication for the Zabo Server API. This communication link provides programmatic access to administrative functions and provides a unified experience for your authenticated users and Zabo. You must establish API keys through your Zabo administrative dashboard after registering your application. You can create API Keys in the dashboard and use them to sign and send requests from your server. These requests must be signed and have the following headers:

The Zabo NPM package will do this under the hood for you once initialized. Once a user is established in the system, with an account linked, the application server can send future authenticated requests for data.

Signing Requests

If you are using the REST endpoints directly, the signature generated for the X-Zabo-Sig header is formed by using the paired secret key to create a SHA-256 HMAC on the following concatenated string:

Timestamp + Full Request URL + Request Body where:

Errors

Zabo.getAccount()
  .then(function (account) {
    /* See getAccount() section below */
  })
  .catch(function (error) {
    console.log(error)
    /* The error object below */
  })

error is the following JSON object:

{
  "error_type": 400,
  "message": "Connection closed by the user."
}

Or it could be:

{
  "error_type": 500,
  "message": "This is our error, please note the time and let us know you received this."
}

Zabo uses promises to return most responses. When implementing the catch function, the SDK provides an error object with the following error types:

Error TypeMeaning
400Bad Request -- Your request is invalid. Usually from a missing or incorrect parameter, or an unsupported function by the connected wallet provider*
401Unauthorized -- Proper credentials were not received.
402Request Failed -- A valid request was made but it failed.
403Forbidden -- You do not have access rights to the requested resource.
404Not Found -- The resource does not exist.
429Too Many Requests -- Too many calls happened in a short period of time.
500Internal Server Error -- This our error and you should note the time and let us know if you receive this.*

* A user-friendly message should be included with these errors.

Unsupported Functions

{
  "error_type": 400,
  "message": "not supported for this wallet provider"
}

Due to limitations with certain wallet providers, some functions will not work if the user connected a wallet provider that does not support those functions. Your application should plan to handle these errors gracefully. Each function will list the currenct wallet provider support level. If a function is called, and the connected wallet provider does not support it, your application can expect to receive the error object to the right.

Connecting a user

Initialize the Zabo client SDK:

Zabo.init({
  clientId: 'YourAppKeyFromYourZaboDashboard',
  env: 'sandbox'
})

Open connect widget in a new window:

Zabo.connect()
  .onConnection(function(account) {
    console.log(account)
    /* The account object outlined below */
  })
  .onError(function(error) {
    console.log(error)
    /* See errors section for more information */
  })
  .onDisconnect(function () {
    /* Provide connect button again after disconnect */
  })

Open widget in an iframe instead:

Zabo.connect({
  interfaceType: 'iframe',
  attachTo: 'body'
})

account is the following JSON object:

{
  "id": "663925bd-205d-479e-895f-27ec3891e8b3",
  "token": "zabosession-abcdef1234567890",
  "exp_time": "Mon, 10 Jun 2019 02:45:50 UTC",
  "address": "b134235a-088a-489c-aa36-dc0841094db8",
  "wallet_provider_name": "coinbase",
  "wallet_provider_display_name": "Coinbase",
  "currencies": [
    {
      "balance": "5.068",
      "currency": "ETH",
      "updated_at": 1560134750000
    },
    {
      "balance": "0.932",
      "currency": "BTC",
      "updated_at": 1560134750000
    }
  ],
  "created_at": 1560134750000,
  "updated_at": 1560134750000,
  "resource_type": "account"
}

This process should begin when the user indicates they would like to establish a new wallet connection, such as after pressing a button. Every application must utilize the connection process in their front-end to establish an initial account connection. If your application needs to extend beyond this available process, please contact us, and we can discuss how to handle your specific application's needs. Once you establish a connection, your application can continue to use the client SDK, or you can send this account object to your server and establish a server-side connection with Zabo if you are running an application server. This server process allows you to link the account to a user. See adding users for further information.

Connection Request

Zabo.connect()

The Zabo object becomes available to you after including the Zabo Client SDK in your project. Calling the connect function without any arguments starts the user connection process in its default state. A new browser window opens for the user to select which one of the wallet provider options they wish to connect with your application.

If the new browser window is not an ideal experience for the users of your app, you have the option to start the connect process within an iframe inside your app. To enable this functionality, please call the connect function with the interfaceType and attachTo parameters.

The attachTo option accepts any DOM selector supported by the document.querySelector() function.

The connect function does not return a promise; it uses events to provide a connection response. This function returns the Zabo object, which can be used to chain event callback functions as shown in the example to the right. The events that may be triggered are outlined below, and you should provide a callback function for each event. Applications running a server can use the onConnection event data to establish account authorization for the connected user.

Arguments

ParameterTypeRequiredDescription
interfaceTypestringOptionalwindow (default) or iframe
attachTostringOptionalHTML selector to attach the iframe

Zabo connect events

onConnection

Zabo.onConnection(function (account) {
  console.log(account)
})

If using Zabo Server API:

This event is called when the user has successfully authenticated and enabled their account for use by your application. The account object returned contains the same data available via getAccount() with the exception that it includes the token and exp_time fields. If you intend to use Zabo from your server, you should forward this object to your server and use it to create or update a user. This must be done in the onConnection event because the token will only be made available this one time in the onConnection event. If you are not using the Zabo API from your server, no further action is needed to continue using the Zabo Client SDK.

onError

Zabo.onError(function (error) {
  console.error(error)
})

This event is called when an error is triggered such as when the user does not provide access to their wallet for use by your application via Zabo. See the errors section for more information about the error object returned.

Zabo API

Zabo SDK for JS client script:

<script src="https://cdn.zabo.com/0.3.0/zabo.js"></script>
<script type="text/javascript">
  Zabo.init({
    clientId: "<Your App's Key>",
    env: "sandbox"
  })
</script>

You can also use the 'latest' script:

<script src="https://cdn.zabo.com/latest/zabo.js"></script>

This section documents the Zabo API for application developers. This API is available as standard REST endpoints, a script you can add directly into your html file, and as a package you can pull into your project.

Initializing the JS SDKs

// Or pull the `zabo-sdk-js` NPM package into your framework

// Initialize the Zabo client SDK for JS:
Zabo.init({
  clientId: 'YourAppKeyFromYourZaboDashboard',
  env: 'sandbox'
})

When using one of the JS SDKs, they must be properly initialized using credentials you received when you registered in the Zabo dashboard. You have a few configuration options that can be changed to best suit your needs. Please note that some options are available only when running the SDK from the browser while others are available when running the SDK on your node.js code.

Initialization Arguments

ParameterDescriptionRequiredPlatform
clientIdApp Key acquired when registering a new application in Zabo Dashboard.RequiredBrowser
envZabo API environment the SDK is connecting with. Could be either sandbox or live. Only sandbox is available unless a live connection is approved.RequiredBoth
apiKeyAPI Key generated via the Application "Keys" tab at Zabo Dashboard.RequiredNode
secretKeySecret Key generated via the Application "Keys" tab at Zabo Dashboard.RequiredNode
autoConnectOptional boolean useful if you want the SDK to call zabo.connect() during zabo.init() for you. Defaults to true.OptionalNode

Usage

All applications must use Zabo in their application client to initiate a wallet connection. To do this, add the script to the bottom of your <body> tag and before using any of the functions, or alternatively pull the zabo-sdk-js NPM package into your front-end framework. The first step is to call the connect function outlined above and establish a connection with the user's wallet. Your application can then continue to use the functions available here on the client side or, if running a server, use the server API for more functionality. Most functions in the client SDK for JS, except for the connect function, return promises which allow you to use async/await or chain then and catch blocks to obtain responses.

Developer Setup Note

If you are developing directly in an .html file, you still must serve this file from a localhost server due to origin requirements. For mac or Linux (with python installed) you can open the terminal, go into the file's directory, and run python -m SimpleHTTPServer 8000. This will serve the file at localhost:8000. For Windows, you can use an IDE extension such as Live Server for Visual Studio.

If you are using a front-end framework, such as Reactjs, these tools will provide a server for your development process.

Get an account

Get the current account information:

Zabo.accounts.getAccount()
  .then(function (account) {
    console.log(account)
    /* account is the json object outlined below */
  })
  .catch(function (error) {
    console.log(error)
    /* See errors section for more information */
  })

// ES6 async/await
try {
  let account = await Zabo.getAccount()
  /* account is the json object outlined below */
} catch (error) {
  console.log(error)
  /* See errors section for more information */
}

Returns the account JSON:

{
  "id": "663925bd-205d-479e-895f-27ec3891e8b3",
  "address": "b134235a-088a-489c-aa36-dc0841094db8",
  "wallet_provider_name": "coinbase",
  "wallet_provider_display_name": "Coinbase",
  "currencies": [
    {
      "balance": "5.068",
      "currency": "ETH",
      "updated_at": 1560134750000
    },
    {
      "balance": "0.932",
      "currency": "BTC",
      "updated_at": 1560134750000
    }
  ],
  "created_at": 1560134750000,
  "updated_at": 1560134750000,
  "resource_type": "account"
}

This function returns the current account connected. The account object contains information such as the wallet provider and wallet address used during connection with your app. This function should only be called from your application's client. To get account information from your application server, utilize getUser documented below for one of your users.

Wallet Provider Support

All

Client SDK for JS

Zabo.accounts.getAccount()

Server SDK for JS

Not available

HTTP Request

GET BASE_URL/accounts/:account_id
GET BASE_URL/sessions

Get a specific balance

Zabo.accounts.getBalances({tickers: ['ETH', 'BTC']})
  .then(function (balances) {
    console.log(balances)
    /* balances is the json object outlined below */
  })
  .catch(function (error) {
    console.log(error)
    /* User has not yet connected or doesn't have these currencies */
  })

// ES6 async/await
try {
  let balance = await Zabo.accounts.getBalances({tickers: ['ETH', 'BTC']})
} catch (error) {
  console.log(error)
}

Returns the following JSON:

{
  "data": [
    {
      "balance": "5.068",
      "currency": "ETH",
      "updated_at": 1560134750000
    },
    {
      "balance": "0.932",
      "currency": "BTC",
      "updated_at": 1560134750000
    }
  ]
}

Returns the user balances for the requested currencies. When requesting balances from the client, the request should be made in the context of the connected account. When requesting from an application server, requests should be made in the context of a user. See documentation about users below. Cryptocurrencies available to your app can be queried using the currencies function documented below.

Wallet Provider Support

All

Client SDK for JS

Zabo.accounts.getBalances({ tickers })

Arguments

ParameterTypeRequiredDescription
tickersarrayRequiredArray of 3-letter identifiers for each currency balance requested.

Server SDK for JS

zabo.users.getBalances({ userId, accountId, tickers })

Arguments

ParameterTypeRequiredDescription
userIdstringRequiredString UUID of the user established with Zabo.
accountIdstringRequiredString UUID of an account that belongs to the user.
tickersarrayRequiredArray of 3-letter identifiers for each currency balance requested.

HTTP Request

From Client: GET BASE_URL/accounts/:account_id/balances

From Server: GET BASE_URL/users/:user_id/accounts/:account_id/balances

Query Parameters

ParameterTypeRequiredDescription
currencystringRequiredComma separated list of 3-letter identifiers for each currency requested.

Get transaction history

Get a list of blockchain transactions sent or received by this account address

Zabo.transactions.getTransactionHistory({
  accountId: '663925bd-205d-479e-895f-27ec3891e8b3',
  currencyTicker: 'ETH',
  limit: 25
}).then(function(history) {
    console.log(history)
    /* history is the array outlined below */
  })
  .catch(function(error) {
    console.log(error)
    /* See errors section for more information */
  })

// ES6 async/await
try {
  let history = await Zabo.getTransactionHistory({
    accountId: '663925bd-205d-479e-895f-27ec3891e8b3',
    currencyTicker: 'ETH',
    limit: 25
  })
} catch (error) {
  console.log(error)
}

Returns the following array of JSON objects:

{
  "list_cursor": {
    "limit": 25,
    "has_more": false,
    "self_uri": "/accounts/8b0a037f-67cb-44b7-ac2a-18e7a54561a8/transactions?limit=25&currency=eth",
    "next_uri": ""
  },
  "data": [
    {
      "id": "0x158be2ad4ba161c1a67e9b5646d2ed35bd4940b708103635dfd84f5ef252c18a",
      "type": "send",
      "amount": "0.1",
      "status": "completed",
      "other_parties": ["0x839395e20bbb182fa440d08f850e6c7a8f6f0780"],
      "initiated_at": 123456789000,
      "confirmed_at": 123456789000
    },
    {
      "id": "0x..."
    }
  ]
}

This function returns a transaction history list for the current account and given currency. This list is currently only provided in descending order.

Wallet Provider Support

All except Hedera.

Client SDK for JS

Zabo.transactions.getTransactionHistory({ currencyTicker, limit, cursor })

Arguments

ParameterTypeRequiredDescription
currencyTickerstringRequired3-letter identifier for the currency requested.

Server SDK for JS

zabo.transactions.getTransactionHistory({ userId, accountId, currencyTicker, limit, cursor })

Arguments

ParameterTypeRequiredDescription
userIdstringRequiredString UUID of the user established with Zabo.
accountIdstringRequiredString UUID of an account that belongs to the user.
currencyTickerstringRequired3-letter identifier for the currency requested.

HTTP Request

From Client: GET BASE_URL/accounts/:account_id/transactions

From Server: GET BASE_URL/users/:user_id/accounts/:account_id/transactions

Query Parameters

ParameterTypeRequiredDescription
currencystringRequired3-letter identifier for the currency requested.

Get a specific transaction

Zabo.transactions.getTransaction({
  txId: '0x158be2ad4ba161c1a67e9b5646d2ed35bd4940b708103635dfd84f5ef252c18a',
  currency: 'ETH'
}).then(function(tx) {
  console.log(tx)
  /* tx is the transaction object outlined below */
})
.catch(function(error) {
  console.log(error)
  /* See errors section for more information */
})

// ES6 async/await
try {
  let tx = await Zabo.transactions.getTransaction({
    txId: '0x158be2ad4ba161c1a67e9b5646d2ed35bd4940b708103635dfd84f5ef252c18a',
    currency: 'ETH'
  })
} catch (error) {
  console.log(error)
}

Returns a single transaction JSON object:

{
  "id": "0x158be2ad4ba161c1a67e9b5646d2ed35bd4940b708103635dfd84f5ef252c18a",
  "type": "send",
  "amount": "0.1",
  "status": "completed",
  "other_parties": ["0x839395e20bbb182fa440d08f850e6c7a8f6f0780"],
  "initiated_at": 123456789000,
  "confirmed_at": 123456789000
}

This function returns a specific transaction for the given account. If the transaction did not originate from the account, or if the account is not the recipient, an error will be returned.

Wallet Provider Support

All except Hedera.

Client SDK for JS

Zabo.transactions.getTransaction({ txId, currency })

Arguments

ParameterTypeRequiredDescription
txIdstringRequiredTransaction ID of the transaction being requested.
currencystringRequiredCurrency ticker of the transaction being requested, e.g. BTC for Bitcoin.

Server SDK for JS

zabo.transactions.getTransaction({ userId, accountId, txId, currency })

Arguments

ParameterTypeRequiredDescription
userIdstringRequiredString UUID of the user established with Zabo.
accountIdstringRequiredString UUID of an account that belongs to the user.
txIdstringRequiredTransaction ID of the transaction being requested.
currencystringRequiredCurrency ticker of the transaction being requested, e.g. BTC for Bitcoin.

HTTP Request

From Client: GET BASE_URL/accounts/:account_id/transactions/:tx_id

From Server: GET BASE_URL/users/:user_id/accounts/:account_id/transactions/:tx_id

Query Parameters

ParameterTypeRequiredDescription
currencystringRequiredThree-letter identifier for the cryptocurrency involved in this transaction.
Zabo.transactions.getCryptoTransferLink({ 
  currencyTicker: 'hbar',
  amount: 5.3,
  toAddress: 13365,
  note: 'Thank you Zabo!'
}).then(function(deeplink) {
  console.log(deeplink.request_link)
  /* deeplink is an object with a request_link to the mobile hedera wallet */
  document.getElementById('placeHolder').innerHTML = Zabo.utils.getQRCode(deeplink.request_link)
})
.catch(function(error) {
  console.log(error)
  /* See errors section for more information */
})

// ES6 async/await
try {
  let tx = await Zabo.transactions.getCryptoTransferLink({ 
    currencyTicker: 'hbar',
    amount: 5.3,
    toAddress: 13365,
    note: 'Thank you Zabo!'
  })
} catch (error) {
  console.log(error)
}

Returns the following JSON object:

{
  "request_link": "https://hedera.app.link/5vuEEQhtLQ?acc=0.0.13365&action=payRequest&a=530000000&n=Thank+you+Zabo!"
}

This function will return a deeplink which will direct the user to the appropriate mobile wallet for the requested transfer. Currently, this function is limited to only the Hedera mobile wallet. Zabo also provides a utility function in the client SDK which can be used to generate a QR Code for the user. This QR code should be injected in the UI and can be scanned using the user's mobile QR Code scanner.

NOTE: Current limitations for Hedera prevent us from obtaining a transaction receipt or transaction history. We are only capable of sending the pay request to the user's mobile wallet, but not verifying the transaction was actually sent from this wallet. Applications can verify sending and receiving by querying their respective balances after a period of time. We aim to lift this limitation as soon as transaction history is more available to us.

Wallet Provider Support

Only Hedera.

Client SDK for JS

Zabo.transactions.getCryptoTransferLink({ toAddress, currencyTicker, amount, note })

Arguments

ParameterTypeRequiredDescription
currencyTickerstringOptionalCurrency ticker of the currency to send. Currently only HBAR is supported.
toAddressstringRequiredReceiving addres of the account. For Hedera, this should only be the account number.
amountstringRequiredAmount of currency to send in terms of HBAR.
notestringOptionalA memo for this transaction.

Server SDK for JS

zabo.transactions.getCryptoTransferLink({ userId, accountId, toAddress, currencyTicker, amount, note })

Arguments

ParameterTypeRequiredDescription
userIdstringRequiredString UUID of the user established with Zabo.
accountIdstringRequiredString UUID of an account that belongs to the user.
currencyTickerstringOptionalCurrency ticker of the currency to send. Currently only HBAR is supported.
toAddressstringRequiredReceiving addres of the account. For Hedera, this should only be the account number.
amountstringRequiredAmount of currency to send in terms of HBAR.
notestringOptionalA memo for this transaction.

HTTP Request

From Client: GET BASE_URL/accounts/:account_id/transfer-request

From Server: GET BASE_URL/users/:user_id/accounts/:account_id/transfer-request

Query Parameters

ParameterTypeRequiredDescription
currencystringOptionalCurrency ticker of the currency to send. Currently only HBAR is supported.
to_addressstringRequiredReceiving addres of the account. For Hedera, this should only be the account number.
amountstringRequiredAmount of currency to send in terms of HBAR.
notestringOptionalA memo for this transaction.

Create a user

Create user:

Not available from application clients, only servers

Returns Response (201) and the following JSON:

{
  "id": "17c0f27e-9916-4ace-b8ca-18d1be2cff43",
  "application": {
    "id": "b5cfb0d8-58de-4786-9545-3d38521d7d2b",
    "name": "Your App Name"
  },
  "accounts": [
    {
      "id": "8b0a037f-67cb-44b7-ac2a-18e7a54561a8",
      "wallet_provider_name": "metamask",
      "wallet_provider_display_name": "MetaMask",
      "address": "0x667dd163f1a0e6ef3e7bbe8e0676f62146d5662d"
    }
  ],
  "created_at": 1420069800000,
  "updated_at": 1420069800000,
  "resource_type": "user"
}

This function creates a new user for your application. A user connects their cryptocurrency wallet via the Zabo Client API, and then you can create a user from your server. From there, your application server can have access this user's account data.

Wallet Provider Support

Not applicable

Client SDK for JS

Not Available

Server SDK for JS

zabo.users.create(account)

Arguments

ParameterTypeRequiredDescription
accountobjectRequiredThe account object received when the user connected. This object must contain a valid token.

HTTP Request

POST BASE_URL/users

Arguments

ParameterTypeRequiredDescription
accountobjectRequiredThe account object received from the Zabo Client after a user has connected an account, in the onConnection event. The token field must be present and associated with an active account.

Get a user

Get user information:

Not available from application clients, only servers

Returns the user JSON:

{
  "id": "17c0f27e-9916-4ace-b8ca-18d1be2cff43",
  "application": {
    "id": "b5cfb0d8-58de-4786-9545-3d38521d7d2b",
    "name": "Your App Name"
  },
  "accounts": [
    {
      "id": "8b0a037f-67cb-44b7-ac2a-18e7a54561a8",
      "wallet_provider_name": "metamask",
      "wallet_provider_display_name": "MetaMask",
      "address": "0x667dd163f1a0e6ef3e7bbe8e0676f62146d5662d"
    }
  ],
  "created_at": 1420069800000,
  "updated_at": 1420069800000,
  "resource_type": "user"
}

This function returns the user requested. The user object contains the user's unique id and accounts information, including the wallet provider and wallet address used during connection with your app.

Wallet Provider Support

Not Applicable

Client SDK for JS

Not Available

Server SDK for JS

zabo.users.getUser(userId)

Arguments

ParameterTypeRequiredDescription
userIdstringRequiredThe user ID for the request.

HTTP Request

GET BASE_URL/users/:user_id

Get a user account

Get user information:

Not available from application clients, only servers

Returns the user JSON:

{
  "id": "8b0a037f-67cb-44b7-ac2a-18e7a54561a8",
      "wallet_provider_name": "metamask",
      "wallet_provider_display_name": "MetaMask",
      "address": "0x667dd163f1a0e6ef3e7bbe8e0676f62146d5662d",
  "currencies": [
    {
      "balance": "5.068",
      "currency": "ETH",
      "updated_at": 1560134750000
    }
  ],
  "created_at": 1560134750000,
  "updated_at": 1560134750000,
  "resource_type": "account"
}

This function returns the full account object for a particular user requested.

Wallet Provider Support

All

Client SDK for JS

Not Available

Server SDK for JS

zabo.users.getAccount({userId, accountId})

Arguments

ParameterTypeRequiredDescription
userIdstringRequiredThe user ID for the request.
accountIdstringRequiredThe account ID for the request.

HTTP Request

GET BASE_URL/users/:user_id/accounts/:account_id

Get users

Get your users:

Not available from application clients, only servers

Returns the user JSON:

{
  "list_cursor": {
    "limit": 25,
    "has_more": false,
    "self_uri": "/users?limit=25",
    "next_uri": ""
  },
  "data": [
    {
      "id": "17c0f27e-9916-4ace-b8ca-18d1be2cff43",
      "accounts": [
        {
          "id": "8b0a037f-67cb-44b7-ac2a-18e7a54561a8",
          "address": "b134235a-088a-489c-aa36-dc0841094db8",
          "wallet_provider_name": "metamask",
          "wallet_provider_display_name": "MetaMask"
        }
      ]
    }
  ]
}

This function returns all users registered with the application. You must have authorization to the users.

Wallet Provider Support

Not Applicable

Client SDK for JS

Not Available

Server SDK for JS

zabo.users.getUsers()

HTTP Request

GET BASE_URL/users

Get application

Not available from application clients, only servers

Returns Response (200) and the following JSON:

{
  "id": "b5cfb0d8-58de-4786-9545-3d38521d7d2b",
  "key": "aPublicKeyIdentifyingYourApp",
  "name": "Your App Name",
  "status": "Sandbox",
  "currencies": [
    { "type": "UTXO", "list": [ "BTC" ] },
    { "type": "account", "list": [ "ETH" ] }
  ],
  "wallet_providers": [
    {
      "name": "coinbase",
      "display_name": "Coinbase",
      "scopes": [
        {
          "name": "read_balances",
          "display_name": "Read Balances",
          "description": "Can read all balance information."
        },
        {
        }
      ],
      "currencies": [
        { "type": "UTXO", "list": [ "BTC" ] },
        { "type": "account", "list": [ "ETH" ] }
      ]
    },
    {
      "name": "metamask",
      "display_name": "MetaMask",
      "scopes": [
        {
          "name": "read_balances",
          "display_name": "Read Balances",
          "description": "Can read all balance information."
        },
        {
          "name": "read_transaction_history",
          "display_name": "Read Transaction History",
          "description": "Can read all past transactions."
        }
      ],
      "currencies": [
        { "type": "account", "list": [ "ETH" ] },
        { "type": "ERC20", "list": [ "all" ] }
      ]
    }
  ],
  "authorized_origins": [
    "zabo.com", "www.zabo.com"
  ],
  "created_at": 1420069800000,
  "updated_at": 1420069800000,
  "resource_type": "application"
}

This endpoint will return the specified application resource. You must have access rights to the application.

Wallet Provider Support

Not Applicable

Client SDK for JS

Not Available

Server SDK for JS

zabo.applications.getApplication()

HTTP Request

GET BASE_URL/applications/:application_id

Data Endpoints

The following endpoints will provide general crypto information.

Get exchange rates

Get a list of current market exchange rates for all supported cryptocurrencies

Zabo.currencies.getExchangeRates().then(function(exchangeRates) {
  console.log(exchangeRates)
  /* exchangeRates is the array outlined below */
})
.catch(function(error) {
  console.log(error)
  /* See errors section for more information */
})

// ES6 async/await
try {
  let exchangeRates = await Zabo.getExchangeRates()
} catch (error) {
  console.log(error)
}

Returns the following array of JSON objects:

{
  "list_cursor": {
    "limit": 25,
    "has_more": false,
    "self_uri": "/exchange-rates?limit=25&fiat_currency=USD",
    "next_uri": ""
  },
  "data": [
    {
      "from": "BTC",
      "to": "USD",
      "rate": "8000.00",
      "timestamp": 145824503000
    },
    {
      "from": "ETH",
      "to": "USD",
      "rate": "300.00",
      "timestamp": 145824503000
    }
  ]
}

Or the following JSON object if a crypto_currency paramter is provided:

{
  "from": "BTC",
  "to": "USD",
  "rate": "8000.00",
  "timestamp": 145824503000
}

This function returns a list of exchange rates for the available cryptocurrencies for the given fiat currency. Currently, only USD is the fiat currency available. Any supported currency can be used for the cryptoCurrency parameter. This parameter is optional and, if left out, all supported cryptocurrencies will be returned.

Wallet Provider Support

Not Applicable

Client SDK for JS

Zabo.currencies.getExchangeRates({ fiatCurrency, cryptoCurrency, toCrypto })

Arguments

ParameterTypeRequiredDescription
fiatCurrencystringOptionalUSD (default) is currently the only option.
cryptoCurrencystringOptionalIf left out, all supported cryptocurrencies are returned.
toCryptoboolOptionalDefault is false and provides exchange rate to the fiatCurrency. If true, the rate will be cryptocurrency per unit of fiat.

Server SDK for JS

zabo.currencies.getExchangeRates({ fiatCurrency, cryptoCurrency, toCrypto })

Arguments

ParameterTypeRequiredDescription
fiatCurrencystringOptionalUSD (default) is currently the only option.
cryptoCurrencystringOptionalIf left out, all supported cryptocurrencies are returned.
toCryptoboolOptionalDefault is false and provides exchange rate to the fiatCurrency. If true, the rate will be cryptocurrency per unit of fiat.

HTTP Request

GET BASE_URL/exchange-rates

Query Parameters

ParameterTypeRequiredDescription
fiat_currencystringOptionalUSD (default) is currently the only option.
crypto_currencystringOptionalIf left out, all supported cryptocurrencies are returned.
to_cryptoboolOptionalDefault is false and provides exchange rate to the fiatCurrency. If true, the rate will be cryptocurrency per unit of fiat.

Get all currencies

Zabo.currencies.getCurrencies().then(function(currencies) {
  console.log(currencies)
  /* currencies is the object outlined below */
})
.catch(function(error) {
  console.log(error)
  /* See errors section for more information */
})

// ES6 async/await
try {
  let currencies = await Zabo.currencies.getCurrencies()
} catch (error) {
  console.log(error)
}

Returns Response (200) and the following JSON:

{
  "list_cursor": {
    "limit": 25,
    "has_more": false,
    "self_uri": "/currencies?limit=25",
    "next_uri": ""
  },
  "data": [
    {
      "ticker": "BTC",
      "name": "Bitcoin",
      "type": "UTXO",
      "decimals": 9,
      "address": null,
      "resource_type": "currency"
    },
    {
      "ticker": "ETH",
      "name": "Ether",
      "type": "account",
      "decimals": 18,
      "address": null,
      "resource_type": "currency"
    },
    {
      "ticker": "DAI",
      "name": "Dai",
      "type": "ERC20",
      "decimals": 18,
      "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
      "resource_type": "currency"
    }
  ]
}

This endpoint will return the full list of currencies available in the system. Use the /wallet-providers endpoint documented below to see the currencies supported by each wallet provider.

Wallet Provider Support

Not Applicable

Client SDK for JS

Zabo.currencies.getCurrencies()

Server SDK for JS

zabo.currencies.getCurrencies()

HTTP Request

GET BASE_URL/currencies

Get specific currency

Zabo.currencies.getCurrency('eth').then(function(currency) {
  console.log(currency)
  /* currency is the object outlined below */
})
.catch(function(error) {
  console.log(error)
  /* See errors section for more information */
})

Returns Response (200) and the following JSON:

{
  "ticker": "BTC",
  "name": "Bitcoin",
  "type": "UTXO",
  "decimals": 9,
  "address": null,
  "resource_type": "currency"
}

This endpoint provides information about a specific currency.

Client SDK for JS

Zabo.currencies.getCurrency(ticker)

Arguments

ParameterTypeRequiredDescription
tickerstringRequired3-letter identifier for this currency

Server SDK for JS

zabo.currencies.getCurrency(ticker)

Arguments

ParameterTypeRequiredDescription
tickerstringRequired3-letter identifier for this currency

HTTP Request

GET BASE_URL/currencies/:ticker

Get wallet providers

Not available from application clients, only servers

Returns Response (200) and the following JSON:

{
  "list_cursor": {
    "limit": 25,
    "has_more": false,
    "self_uri": "/wallet-providers?limit=25",
    "next_uri": ""
  },
  "data": [
    {
      "name": "coinbase",
      "display_name": "Coinbase",
      "auth_type": "token",
      "resource_type": "wallet_provider",
      "available_scopes": [
        {
          "name": "read_balances",
          "display_name": "Read Balances",
          "description": "Can read all balance information."
        },
        {
          "name": "read_transaction_history",
          "display_name": "Read Transaction History",
          "description": "Can read all past transactions.",
          "resource_type": "scope"
        }
      ],
      "available_currencies": [{ "type": "account", "list": [ "ETH" ] },{ "type": "UTXO", "list": [ "BTC" ] }],
      "resource_type": "wallet_provider"
    },
    {
      "name": "metamask",
      "display_name": "MetaMask",
      "auth_type": "private_key",
      "resource_type": "wallet_provider",
      "available_scopes": ["read_balances","read_transaction_history"],
      "available_currencies": [{ "type": "account", "list": [ "ETH" ] }, { "type": "ERC20", "list": [ "all" ] }],
      "resource_type": "wallet_provider"
    },
    {
      "name": "ledger",
      "display_name": "Ledger Hardware Wallet",
      "auth_type": "private_key",
      "resource_type": "wallet_provider",
      "available_scopes": ["read_balances","read_transaction_history"],
      "available_currencies": [{ "type": "account", "list": [ "all" ] }, { "type": "ERC20", "list": [ "all" ] }],
      "resource_type": "wallet_provider"
    }
  ]
}

This endpoint will return the list of all wallet providers available for an application as well as the scopes and currencies available for that particular provider.

Wallet Provider Support

Not Applicable

Client SDK for JS

Not Available

Server SDK for JS

Zabo.walletProviders.getWalletProviders()

HTTP Request

GET BASE_URL/wallet-providers

Get a wallet provider

Not available from application clients, only servers

Returns Response (200) and the following JSON:

{
  "name": "metamask",
  "display_name": "MetaMask",
  "auth_type": "private_key",
  "resource_type": "wallet_provider",
  "available_scopes": [
    {
      "name": "read_balances",
      "display_name": "Read Balances",
      "description": "Can read all balance information."
    },
    {
      "name": "read_transaction_history",
      "display_name": "Read Transaction History",
      "description": "Can read all past transactions.",
      "resource_type": "scope"
    }
  ],
  "available_currencies": [{ "type": "account", "list": [ "ETH" ] }, { "type": "ERC20", "list": [ "all" ] }],
  "resource_type": "wallet_provider"
}

This endpoint will return the requested wallet provider resource. Note: the provider name is the all lowercase 'computer' name for the wallet provider, not the display name.

Client SDK for JS

Not Available

Server SDK for JS

zabo.walletproviders.getWalletProvider(name)

Arguments

ParameterTypeRequiredDescription
namestringRequiredName of the wallet provider

HTTP Request

GET BASE_URL/wallet-providers/:provider_name