BWS API Docs
Contact UsCreate AccountSign In
  • Welcome!
    • Developer Grants
  • Quick Start
  • Platform Fees
    • Fees Calculator
  • API How Tos
    • API Endpoint
    • Authentication
      • Get your API Key
    • Main API Methods
      • 'call' API Method
      • 'fetch' API Method
    • API Responses
      • Error Status Codes
  • Certificate Of Trust
  • Media Assets
    • BWS Logo
    • Snapshots
      • BWS.IPFS.Upload
  • PLATFORM APIs
    • BWS.IPFS.Upload
      • Solution Overview
      • Operations
    • BWS.Blockchain.Save
      • Solution Overview
      • Operations
    • BWS.Blockchain.Hash
      • Solution Overview
      • Operations
    • BWS.NFT.zK
      • Solution Overview
        • NFT Ownership
        • NFT Data Location
        • Available Networks
      • Operations
        • Create NFT
        • List NFTs
        • Transfer NFT
        • Send NFT by Email
      • NFT Attributes (traits)
  • Marketplace Solutions
    • BWS.Blockchain.Badges
      • Badges User Interface
      • Badges API
        • Issuers
        • Badges
        • Awards (Credentials)
    • BWS.NFT.GameCube
      • NFT Game Overview
      • NFT Game Cube API
        • Calendar
        • Field
        • Cubes
        • Plays (Field-Calendar)
        • Match
        • Prizes
        • Event Types
        • Live Events
    • BWS.ESG.Credits
      • Solution Overview
      • ESG Credits API
        • Taxonomy
        • Translations
        • Currencies
        • Frameworks
        • Projects
        • Issuers
        • Assets
        • Investors
        • Positions
        • Portfolios
        • Impacts
        • Blockchain
        • Users
  • TELEGRAM BOTS
    • X BOT
      • Install
        • How does it work?
      • Commands
        • X Filtering
        • Leaderboard Points
        • Report Schedule
Powered by GitBook
On this page
  • Method Parameters
  • API call Response

Was this helpful?

  1. API How Tos
  2. Main API Methods

'call' API Method

POST https://api.bws.ninja/v1/call

PreviousMain API MethodsNext'fetch' API Method

Last updated 4 months ago

Was this helpful?

BWS Solutions use a single API endpoint to call BWS Solutions: https://api.bws.ninja/v1/call

CODE EXAMPLE

The following javascript code shows how to use to write "Hello World!" to the mumbai blockchain network using the save operation.

const response = await fetch("https://api.bws.ninja/v1/call", {
  method: "post",
  body: JSON.stringify({
    solution: "BWS.Blockchain.Save",
    version: 1,
    network: "mumbai",
    operation: "save",
    parameters: {
      value: "Hello World!",
    },
  }),
  headers: {
    "Content-Type": "application/json",
    "X-Api-Key": "your api key",
  },
});
const result = await response.json();

if (result.statusCode != 200) throw new Error(result.statusMessage);

return result;

Method Parameters

Parameter
Type
Description

solution

string

The solution id. Each BWS Solution has a unique ID (e.g. BWS.Blockchain.Save)

version

number

The solution version to use. As solutions may get upgraded with new features, it's important to note which version you want to use.

network

string

The network id to use. Each solution will be available on different blockchain networks, just set here which one to use.

operation

string

The operation id to call. Each BWS Solution provides multiple operations to provide a full set of features.

parameters

json

Each operation requires a different set of parameters. Check the operation parameters documentation.

Please note:

  • The solution, operation and parameters attributes are used to call any of the Blockchain Web Services available solutions.

  • network is the blockchain network you want to use (for example, use the mumbainetwork to test without requiring any funds).

  • Check the available networks for the selected solution you plan to use.

API call Response

Whenever you execute a call to run a BWS solution, please note the following:

  • You will get a 200 status code if your call is correctly received.

  • If your call is synchronous, the info part will contain the call result values.

API RESPONSE EXAMPLE

Response example when running a call to an asynchronous operation.

{
  "statusCode": 200,
  "info": {
    "jobId": "aacee908-3a85-4966-945c-ab8f09ebabf9"
  }
}

Please include the following parameters on each API call in the Body part of a POST request message using format (Content-Type header attribute must be set to application/json)

If your call is asynchronous, the info response attribute will contain the jobId you can use to call the operation to get the call status and results.

BWS.Blockchain.Save
JSON
fetch