LootBoxesApi
All URIs are relative to http://localhost
| Method | HTTP request | Description |
|---|---|---|
| createLootbox | POST /lootboxes | Create a new lootbox |
| deleteLootbox | DELETE /lootboxes/{id} | Delete a lootbox |
| listLootboxes | GET /lootboxes | Fetch lootboxes |
| openLootbox | POST /lootboxes/{id}/open | Open lootbox |
| showLootbox | GET /lootboxes/{id} | Show information about lootbox |
| updateLootbox | PATCH /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#
| Name | Type | Description | Notes |
|---|---|---|---|
| body | AdminNewLootBoxBody | ||
Return type#
Authorization#
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#
| Name | Type | Description | Notes |
|---|---|---|---|
| id | String | ||
Return type#
Authorization#
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#
| Name | Type | Description | Notes |
|---|---|---|---|
| dir | String | [optional] | |
| limit | Number | [optional] | |
| ownerId | String | ||
| Search by LootBox owner | [optional] | ||
| page | Number | [optional] | |
| sort | String | [optional] | |
| status | String | Search for LootBoxes by status | [optional] |
Return type#
Authorization#
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#
| Name | Type | Description | Notes |
|---|---|---|---|
| id | String | ||
Return type#
Authorization#
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#
| Name | Type | Description | Notes |
|---|---|---|---|
| id | String | ||
Return type#
Authorization#
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#
| Name | Type | Description | Notes |
|---|---|---|---|
| id | String | ||
| body | AdminUpdateLootBoxBody | ||
Return type#
Authorization#
HTTP request headers#
- Content-Type: Not defined
- Accept: /