Skip to main content

LootBoxesApi

All URIs are relative to http://localhost

MethodHTTP requestDescription
createLootboxPOST /lootboxesCreate a new lootbox
deleteLootboxDELETE /lootboxes/{id}Delete a lootbox
listLootboxesGET /lootboxesFetch lootboxes
openLootboxPOST /lootboxes/{id}/openOpen lootbox
showLootboxGET /lootboxes/{id}Show information about lootbox
updateLootboxPATCH /lootboxes/{id}Update a lootbox

createLootbox#

/*** @returns PublicLootBox**/async function createLootbox(body: AdminNewLootBoxBody)

Create a new lootbox

Notes:#

NOTE: user should have scope AdminLootBoxWrite

Example#

const yat = require('yatjs');const api = new yat.YatJs();
await api.login("[email protected]", "your_password");
let body = new YatJs.AdminNewLootBoxBody(); // AdminNewLootBoxBody // populate body...
try {  let res = await api.lootBoxes().createLootbox(body);  // res is of type PublicLootBox  console.log('API called successfully. Result: ', res);} catch (error) {  console.error(error);}

Parameters#

NameTypeDescriptionNotes
bodyAdminNewLootBoxBody

Return type#

PublicLootBox

Authorization#

two_factor

HTTP request headers#

  • Content-Type: Not defined
  • Accept: /

deleteLootbox#

/*** @returns PublicLootBox**/async function deleteLootbox(id: String)

Delete a lootbox

Notes:#

NOTE: user should have scope AdminLootBoxWrite

Example#

const yat = require('yatjs');const api = new yat.YatJs();
await api.login("[email protected]", "your_password");
let id = null; // String // populate id...
try {  let res = await api.lootBoxes().deleteLootbox(id);  // res is of type PublicLootBox  console.log('API called successfully. Result: ', res);} catch (error) {  console.error(error);}

Parameters#

NameTypeDescriptionNotes
idString

Return type#

PublicLootBox

Authorization#

two_factor

HTTP request headers#

  • Content-Type: Not defined
  • Accept: /

listLootboxes#

/*** @returns ListOfPublicLootBox**/async function listLootboxes(opts)

Fetch lootboxes

Notes:#

Return lootboxes with their usage and availability information NOTE: user should have scope LootBoxAdmin or LootBoxUse

Example#

const yat = require('yatjs');const api = new yat.YatJs();
await api.login("[email protected]", "your_password");
let opts = {  'dir': "dir_example", // String |   'limit': 56, // Number |   'ownerId': null, // String | Search by LootBox owner  'page': 56, // Number |   'sort': "sort_example", // String |   'status': "status_example" // String | Search for LootBoxes by status};try {  let res = await api.lootBoxes().listLootboxes(opts);  // res is of type ListOfPublicLootBox  console.log('API called successfully. Result: ', res);} catch (error) {  console.error(error);}

Parameters#

NameTypeDescriptionNotes
dirString[optional]
limitNumber[optional]
ownerIdString
Search by LootBox owner[optional]
pageNumber[optional]
sortString[optional]
statusStringSearch for LootBoxes by status[optional]

Return type#

ListOfPublicLootBox

Authorization#

apiKey

HTTP request headers#

  • Content-Type: Not defined
  • Accept: /

openLootbox#

/*** @returns PublicLootBox**/async function openLootbox(id: String)

Open lootbox

Notes:#

Will reassign all yats to user and return full lootbox view NOTE: user should have scope LootBoxUse

Example#

const yat = require('yatjs');const api = new yat.YatJs();
await api.login("[email protected]", "your_password");
let id = null; // String // populate id...
try {  let res = await api.lootBoxes().openLootbox(id);  // res is of type PublicLootBox  console.log('API called successfully. Result: ', res);} catch (error) {  console.error(error);}

Parameters#

NameTypeDescriptionNotes
idString

Return type#

PublicLootBox

Authorization#

apiKey

HTTP request headers#

  • Content-Type: Not defined
  • Accept: /

showLootbox#

/*** @returns PublicLootBox**/async function showLootbox(id: String)

Show information about lootbox

Notes:#

For admin it will show full lootbox information including yats For user only lootbox owned by user, yats stripped NOTE: user should have scope AdminLootBoxRead or LootBoxUse

Example#

const yat = require('yatjs');const api = new yat.YatJs();
await api.login("[email protected]", "your_password");
let id = null; // String // populate id...
try {  let res = await api.lootBoxes().showLootbox(id);  // res is of type PublicLootBox  console.log('API called successfully. Result: ', res);} catch (error) {  console.error(error);}

Parameters#

NameTypeDescriptionNotes
idString

Return type#

PublicLootBox

Authorization#

apiKey

HTTP request headers#

  • Content-Type: Not defined
  • Accept: /

updateLootbox#

/*** @returns PublicLootBox**/async function updateLootbox(id: String, body: AdminUpdateLootBoxBody)

Update a lootbox

Notes:#

NOTE: user should have scope AdminLootBoxWrite

Example#

const yat = require('yatjs');const api = new yat.YatJs();
await api.login("[email protected]", "your_password");
let id = null; // String // populate id...
let body = new YatJs.AdminUpdateLootBoxBody(); // AdminUpdateLootBoxBody // populate body...
try {  let res = await api.lootBoxes().updateLootbox(id, body);  // res is of type PublicLootBox  console.log('API called successfully. Result: ', res);} catch (error) {  console.error(error);}

Parameters#

NameTypeDescriptionNotes
idString
bodyAdminUpdateLootBoxBody

Return type#

PublicLootBox

Authorization#

two_factor

HTTP request headers#

  • Content-Type: Not defined
  • Accept: /