Match Events

new_event

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

Request Body

Name
Type
Description

solution*

string

BWS.NFT.GameCube

operation*

string

new_event

parameters*

JSON

check method parameters

new_event Method Parameters

Parameter
Type
Desciption

matchId

string

The Match Id for which you want to register the event.

fieldId

string

The Field Id the match is linked to.

calendarId

string

The calendar Id the match is linked to.

event

JSON

check event parameter

new_event Event Parameter

Parameter
Type
Desciption

coordinates

JSON

check coordinates parameter

eventTypeId

string

The Event Type Id of the event you want to register.

new_event Coordinates Parameter

Parameter
Type
Desciption

x

string

The 2D x coordinate of the event.

y

string

The 2D y coordinate of the event.

new_event API Call Example

const axios = require('axios');

/* build request to use BWS Badges solution */
const request = {
{
  "solution": "BWS.NFT.GameCube",
  "operation": "new_event",
  "parameters":  {
      "matchId": "e16d3f98-4eeb-44b9-837c-eddbbfe305ee",
      "fieldId": "5a1486f3-753c-4194-b2d4-ea68b6e420c2",
      "calendarId": "8a7324f4-311d-43a8-a28f-87d9c424c354",
      "event":  {
        "coordinates": {
          "x": "45",
          "y": "40"
        },
      "eventTypdId": "34339c99-43cf-4fe9-b632-4f8606e3c1bc"
      }
  }
}

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

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

{
  "statusCode": 200
}

Last updated