4XX - Item management

400 - Items list

Returns the items list. Requieres authentication.

In

{"type":400}

Out

{"type":400,"data":{"items":[{"key":"potion","name":"Potion","Revitalising item":"heh","max":99}]}}

401 - Item creation

Inserts or updates an item with the provided data.name, data.description and the maximum quantity allowed to collect (data.max). Requieres administration privileges.

In

{"type":401,"data":{"name":"Potion","description":"Revitalising item","max":99}}

Out

{"type":401,"data":{"status":"OK"}}

402 - User item management

Adds or removes (in case of negative number) the quantity of data.qty of the data.name item to the authenticated user. Requieres authentication.

In

{"type":402,"data":{"name":"potion","qty":1}}

Out

{"type":402,"data":{"status":"OK"}}

403 - User inventory

Returns the inventory of the currently authenticated user. If the command is sent by an administrator and data.user is provided, the inventory of that user will be returned. Requieres authentication or administration privileges.

In

{"type":403}

Out

{"type":403,"data":{"user":"user","inventory":[{"key":"potion","name":"Potion","description":"Revitalising item","qty":1,"max":99}]}}

410 - Currencies list

Returns the currencies list. Requieres authentication.

In

{"type":410}

Out

{"type":410,"data":{"currencies":[{"key":"PufFkNzUZo","name":"Dollar","description":"$","max":9999999.99}]}}

411 - Currency creation

Inserts or updates (in case it exists) a currency with the provided data.name, data.description and maximum allowed quanitity (data.max). Requieres administration privileges.

In

{"type":411,"data":{"name":"Dollar","description":"$","max":9999999.99}}

Out

{"type":411,"data":{"status":"OK"}}

412 - User currencies management

Adds the specified data.qty of the currency data.name to the authenticated user. If the command is by an administrator and data.user is provided, will be added to that user. Requieres authentication or administration privileges.

In

{"type":412,"data":{"name":"dollar","qty":100}}

Out

{"type":412,"data":{"status":"OK"}}

413 - User currencies list

Returns the list of currencies owned by the authenticated user with quantities. If the command is by an administrator and data.user is provided, data from that user will be returned. Requieres authentication or administration privileges.

In

{"type":413}

Out

{"type":413,"data":{"user":"user","currencies":[{"key":"dollar","name":"dollar","description":"Money","qty":100,"max":9999999.99},{"key":"diamonds","name":"diamonds","description":"It shines","qty":0,"max":9999999.99}]}}

Last updated