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
        • Monitoring Setup
Powered by GitBook
On this page
  • new_match
  • Request Body
  • new_match API Call Example
  • update_match
  • Request Body
  • update_match API Call Example
  • list_matches
  • Request Body
  • list_matches API Call Example
  • delete_match
  • Request Body
  • delete_match API Call Example

Was this helpful?

  1. Marketplace Solutions
  2. BWS.NFT.GameCube
  3. NFT Game Cube API

Match

A Match is a time-bound, gameplay session tied to a specific Field, during which events are tracked, points are awarded, and fan interactions occur. It represents a game instance—such as a football match, chess round, or tournament heat—scheduled via the Calendar object and hosted on a defined Field.

Examples:

  • PSG vs. Manchester City

  • Green Bay Packers vs Chicago Bears

  • Magnus Carlsen vs Hikaru Nakamura

Images The images sent using base64 encoding are saved into IPFS using the BWS IPFS Solution. When getting object details, the IPFS URL is returned.

new_match

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

Request Body

Name
Type
Description

solution*

string

BWS.NFT.GameCube

operation*

string

new_match

parameters*

JSON

check method parameters

new_match Method Parameters

Optionals

All parameters are optional (except calendarId and startTimeInMillis).

Parameter
Type
Desciption

calendarId*

string

Calendar Id the match should be included in.

startTimeInMillis*

number

The expected match start time in milliseconds.

name

string

The match short name.

description

string

Match description.

image

string

An image base64 encoded string to announce the match.

team1Name

string

The team name (e.g. Manchester City)

team1Flag

string

An image base64 ecoded string representing the team flag.

team2Name

string

The team name (e.g. LA Lakers)

team2Flag

string

An image base64 ecoded string representing the team flag.

status

string

The match status. Use one of the following values: "scheduled", "playing", "finished", "canceled".

priceInCents

number

The default price in USD cents for all the cubes if no specific price is defined for a cube (e.g. 1000 for 10 USD).

new_match API Call Example

const axios = require('axios');

/* build request to create a new NFT Game Cube match */
const request = {
{
  "solution": "BWS.NFT.GameCube",
  "operation": "new_match",
  "parameters":  {
      "calendarId": "8a7324f4-311d-43a8-a28f-87d9c424c354",
      "startTimeInMillis": 1737795600000,
      "name": "PSG vs Man City",
      "description": "Paris Saint-Germain will face Manchester City ...",
      "image": "9j/4AAQSkZJRgABAQIAHA... " /* base64 encoded image string */
  }
}

/* call BWS API using Axios */
let config = {
  method: 'post',
  maxBodyLength: Infinity,
  url: 'https://api.bws.ninja/v1/call',
  headers: { 
    'X-Api-Key': 'XqaLg...... A5k2V729v', /* use your API key here! */
    'Content-Type': 'application/json'
  },
  data : JSON.stringify(request)
};

axios.request(config)
  .then((response) => {
    console.log(JSON.stringify(response.data));
  })
  .catch((error) => {
    console.log(error);
  });

new_match Call Response

When the API call is successfully executed, it returns thematchId for the newly created match.

{
  "statusCode": 200,
  "info": {
        "matchId": "e16d3f98-4eeb-44b9-837c-eddbbfe305ee"
  }
}

update_match

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

Request Body

Name
Type
Description

solution*

string

BWS.NFT.GameCube

operation*

string

update_match

parameters*

JSON

check method parameters

update_match Method Parameters

Optionals

All parameters are optional (except calendarId and matchId) Only provide those you want to update.

Parameter
Type
Desciption

calendarId*

string

Calendar Id the match is included in.

matchId*

string

The Match Id we want to update.

startTimeInMillis

number

The expected match start time in milliseconds.

name

string

The match short name.

description

string

Match description.

image

string

An image base64 encoded string to announce the match.

team1Name

string

The team name (e.g. Manchester City)

team1Flag

string

An image base64 ecoded string representing the team flag.

team2Name

string

The team name (e.g. LA Lakers)

team2Flag

string

An image base64 ecoded string representing the team flag.

status

string

The match status. Use one of the following values: "scheduled", "playing", "finished", "canceled"

priceInCents

number

The price in USD cents (e.g. 1000 for 10 USD)

update_match API Call Example

const axios = require('axios');

/* build request to update match description only */
const request = {
{
  "solution": "BWS.NFT.GameCube",
  "operation": "new_match",
  "parameters":  {
      "calendarId": "8a7324f4-311d-43a8-a28f-87d9c424c354",
      "matchId": "e16d3f98-4eeb-44b9-837c-eddbbfe305ee",
      "description": "Paris Saint-Germain will face Manchester City ...",
  }
}

/* call BWS API using Axios */
let config = {
  method: 'post',
  maxBodyLength: Infinity,
  url: 'https://api.bws.ninja/v1/call',
  headers: { 
    'X-Api-Key': 'XqaLg...... A5k2V729v', /* use your API key here! */
    'Content-Type': 'application/json'
  },
  data : JSON.stringify(request)
};

axios.request(config)
  .then((response) => {
    console.log(JSON.stringify(response.data));
  })
  .catch((error) => {
    console.log(error);
  });

update_match Call Response

When the API call is successfully executed, it returns thematchId for the updated match.

{
  "statusCode": 200,
  "info": {
        "matchId": "e16d3f98-4eeb-44b9-837c-eddbbfe305ee"
  }
}

list_matches

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

Request Body

Name
Type
Description

solution*

string

BWS.NFT.GameCube

operation*

string

list_matches

parameters

JSON

check method parameters

list_matches Method Parameters (optional)

Parameter
Type
Desciption

calendar_id

string

The Calendar Id the match is linked to.

matchId

string

(optional) The Match Id we want to list.

list_matches API Call Example

const axios = require('axios');

/* build request to use BWS Badges solution */
const request = {
{
  "solution": "BWS.NFT.GameCube",
  "operation": "list_matches",
  "parameters":  {
      "calendarId": "8a7324f4-311d-43a8-a28f-87d9c424c354",
      "matchId": "e16d3f98-4eeb-44b9-837c-eddbbfe305ee"  
  }
}

/* call BWS API using Axios */
let config = {
  method: 'post',
  maxBodyLength: Infinity,
  url: 'https://api.bws.ninja/v1/call',
  headers: { 
    'X-Api-Key': 'XqaLg...... A5k2V729v', /* use your API key here! */
    'Content-Type': 'application/json'
  },
  data : JSON.stringify(request)
};

axios.request(config)
  .then((response) => {
    console.log(JSON.stringify(response.data));
  })
  .catch((error) => {
    console.log(error);
  });

list_matches Call Response

When the API call is successfully executed, it returns the matches for the provided calendar. If we give a Match Id, it will just return the match we want to list.

{
  "statusCode": 200,
  "info": {
    "matches": [
        {
            "calendarId": "8a7324f4-311d-43a8-a28f-87d9c424c354",
            "matchId": "e16d3f98-4eeb-44b9-837c-eddbbfe305ee",
            "startTimeInMillis": "1737795600000",
            "status": "scheduled",
            "data": {
                "name": "PSG vs Man City",
                "description": "Paris Saint-Germain will face Manchester City ...",
                "image": "https://ipfs.bws.ninja/ipfs/QmQnRDsQPvNJ9RgT9bagHmCLQVxCyZxatkPpj3Avb1hsM8"
            }
        }
    ]
  }
}

delete_match

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

Request Body

Name
Type
Description

solution*

string

BWS.NFT.GameCube

operation*

string

delete_calendar

parameters*

JSON

check method parameters

delete_match Method Parameters

Parameter
Type
Desciption

matchId

string

The Match Id of the match we want to delete.

calendarId

string

The Calendar Id the match is linked to.

delete_match API Call Example

const axios = require('axios');

/* build request to use BWS Badges solution */
const request = {
{
  "solution": "BWS.NFT.GameCube",
  "operation": "delete_match",
  "parameters":  {
     "matchId": "e16d3f98-4eeb-44b9-837c-eddbbfe305ee",
     "calendarId": "8a7324f4-311d-43a8-a28f-87d9c424c354"  
  }
}

/* call BWS API using Axios */
let config = {
  method: 'post',
  maxBodyLength: Infinity,
  url: 'https://api.bws.ninja/v1/call',
  headers: { 
    'X-Api-Key': 'XqaLg...... A5k2V729v', /* use your API key here! */
    'Content-Type': 'application/json'
  },
  data : JSON.stringify(request)
};

axios.request(config)
  .then((response) => {
    console.log(JSON.stringify(response.data));
  })
  .catch((error) => {
    console.log(error);
  });

delete_match Call Response

When the API call is executed without errors, it returns a successful status code.

{
  "statusCode": 200
}

PreviousPlays (Field-Calendar)NextPrizes

Last updated 1 month ago

Was this helpful?