Calendar Match

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

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.

new_match API Call Example

const axios = require('axios');

/* build request to use BWS Badges solution */
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"
  }
}

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"
            }
        }
    ]
  }
}

update_match-cube-price

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

Request Body

Name
Type
Description

solution*

string

BWS.NFT.GameCube

operation*

string

update-match-cube-price

parameters*

JSON

check method parameters

update_match-cube-price Method Parameters

Parameter
Type
Desciption

matchId

string

The Match Id of the match you want to change the cube default price.

calendarId

string

The Calendar Id the match is linked to.

priceInCents

number

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

update_match-cube-price API Call Example

const axios = require('axios');

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

/* 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-cube-price Call Response

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

{
  "statusCode": 200
}

update_match-status

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

Request Body

Name
Type
Description

solution*

string

BWS.NFT.GameCube

operation*

string

update-match-cube-price

parameters*

JSON

check method parameters

update_match-status Method Parameters

Parameter
Type
Desciption

matchId

string

The Match Id of the match you want to change the cube default price.

calendarId

string

The Calendar Id the match is linked to.

status

string

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

update_match-status API Call Example

const axios = require('axios');

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

/* 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-status Call Response

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

{
  "statusCode": 200
}

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
}

Last updated