Skip to main content

Builder API

With Tooblox API users can automate smart-contract generation. In summary this is the general workflow:

  • Use API to create new smart-contract workflows or to update existing workflows (SLA 99.9%)
  • The API will
    • Use AI to create a workflow
    • Construct the workflow, store it and provide a URL in return
    • If id is given, update an existing workflow
  • The URL can be used to open the workflow and deploy it onto a selected blockchain
  • The URL can be shared with customers to initiate a transfer of ownership. The idea is that while a solution provider can help businesses build blockchain solutions it is up to to the customers to deploy the smart-contracts in the end to ensure proper custody.

Prerequisites

  • Credits to use the AI generator (credits are included in each plan)

Usage

There are two ways to use the API.

  1. Using Toolblox plugin for ChatGPT
  2. Using API endpoint: https://toolbloxfunctions-api.azure-api.net/api/Generate

Toolblox plugin for ChatGPT

Using Toolblox plugin for ChatGPT is the easiest way to create smart contracts. Just converse with ChatGPT, describe what process you wish to digitize as a smart contract and the plugin takes care of calling Toolblox.

Tips

A well formulated input to ChatGPT describes the asset, its properties that need to be stored on blockchain and the lifecycle especially the parties or roles that handle the asset at each stage of its lifecycle.

Specifying the API key

Optional: To get access to more AI credits provided by Toolblox subscription you need to specify the API key to the chatbot.

Example

The example shows a minimal input, and how to specify the API key while using Toolblox plugin for ChatGPT:

Using Toolblox plugin for ChatGPT

API Endpoint

Parameters

NameMandatoryDescription
apiKeyYesGenerated in Toolblox profile page
textYesContains freetext description of the desired workflow. It should describe the object type stored in the smart contract, its properties, and user roles who can perform actions throughout its lifecycle. Recommended at least 3 sentences for a good outcome but more is better.

Any language can be used although English gets the best results. Workflow will be created in English.

POST requests can omit the text parameter and replace it with request content instead. For GET requests text parameter is mandatory.
idNoContains the workflow id - if given will perform an update of existing smart contract workflow instead of creating a new workflow.

Example to create workflow

Creation of an apartment rental service using blockchain, built with API builder.

Parameters

ParameterValue
apiKeyactive API key
textcreate a workflow for managing appartment rent. add also way to pay rent each month

URL

https://toolbloxfunctions-api.azure-api.net/api/Generate?apiKey=TIX-xxxxxxx&text=create%20a%20workflow%20for%20managing%20appartment%20rent.%20add%20also%20way%20to%20pay%20rent%20each%20month

Response

{
"currentUsage": 1,
"url": "https://app.toolblox.net/transfer/appartment_rent_workflow_xxxxxx",
"id": "xxxxxxx-xxxxx-xxxxx-xxxx-xxxxxx"
}

This is the smart contract workflow that got generated and opens using the received link.

Generated smart contract for real estate rental

Example to update workflow

Parameters

ParameterValue
apiKeyactive API key
textAdd a way to make apartments unavailable for rent
idid returned from first request

URL

https://toolbloxfunctions-api.azure-api.net/api/Generate?apiKey=TIX-xxxxxxx&text=Add%20a%20way%20to%20make%20apartments%20unavailable%20for%20rent&id=xxxxxxx-xxxxx-xxxxx-xxxx-xxxxxx

Response

When refreshing the UI for the smart contract we see that an 'Unavailable' state has been added:

Updated smart contract for real estate rental