This repository was archived by the owner on Sep 20, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
API Reference [experimental]
Defelo edited this page May 31, 2020
·
9 revisions
No parameters.
Responses:
- Success:
{
"elements": [{
"element_uuid": "<UUID of the item [string, UUID]>",
"element_name": "<Name of the item [string]>",
"related_ms": "<Microservice related to the item [string]>",
"owner": "<UUID of the owner of the item [string, UUID]>"
}]
}Required parameters:
-
element_uuid: UUID of the element [string, UUID] -
target: UUID of the new owner of the element [string, UUID]
Responses:
- Success:
{"ok": true}- The element does not exist for this user:
{"error": "item_not_found"}- The element is already owned by the target user:
{"error": "cannot_trade_with_yourself"}- The target user does not exist:
{"error": "user_uuid_does_not_exist"}Required parameters:
-
item_name: Name of the item [string] -
owner: UUID of the user [string, UUID]
Responses:
- The item exists:
{"exists": true}- The item does not exist:
{"exists": false}Required parameters:
-
item_name: Name of the item [string] -
owner: UUID of the user [string, UUID] -
related_ms: Name of the related microservice [string]
Responses:
- Success:
{
"element_uuid": "<UUID of the item [string, UUID]>",
"element_name": "<Name of the item [string]>",
"related_ms": "<Microservice related to the item [string]>",
"owner": "<UUID of the owner of the item [string, UUID]>"
}- The item does not exist in the game config:
{"error": "item_not_found"}Required parameters:
-
item_uuid: UUID of the item [string, UUID]
Responses:
- Success:
{"ok": true}- The item does not exist:
{"error": "item_not_found"}Required parameters:
-
owner: UUID of the user [string, UUID]
Responses:
- Success:
{
"elements": [{
"element_uuid": "<UUID of the item [string, UUID]>",
"element_name": "<Name of the item [string]>",
"related_ms": "<Microservice related to the item [string]>",
"owner": "<UUID of the owner of the item [string, UUID]>"
}]
}Required parameters:
-
owner: UUID of the user [string, UUID]
Responses:
- Success:
{
"elements": {
"<Name of the item [string]>": "<Number of elements with this name [number]"
}
}Required parameters:
-
owner: UUID of the user [string, UUID] -
item_name: Name of the item [string]
Responses:
- Success:
{"ok": true}- The item does not exist:
{"error": "item_not_found"}Required parameters:
-
user_uuidUUID of the user to delete [string, UUID]
Responses:
- Success:
{"ok": true}No parameters.
Responses:
- Success:
{
"categories": {
"<Name of the category [string]>": {
"index": "<index of category [integer, zero based]>",
"items": {
"<Name of the product [string]>": {
"price": "<Price of the product [number]>",
"related_ms": "<Microservice related to the product [string]>"
}
},
"categories": {
"<Name of the subcategory [string]>": {
"index": "<index of category [integer, zero based]>",
"items": {
"<Name of the product [string]>": {
"price": "<Price of the product [number]>",
"related_ms": "<Microservice related to the product [string]>"
}
},
"categories": {}
}
}
}
}
}Required parameters:
-
product: Name of the product [string]
Responses:
- Success:
{
"name": "<Name of the product [string]>",
"price": "<Price of the product [number]>",
"related_ms": "<Microservice related to the product [string]>",
"category": "<Category of the product [string]>"
}- The product does not exist in the shop:
{"error": "item_not_found"}Required parameters:
-
products: Map with product names as keys and amount as values [map of string->integer] -
wallet_uuid: UUID of the wallet used for payment [string, UUID] -
key: Secure key of the wallet [string, 10 digit hexadecimal key]
Responses:
- Success:
{
"bought_products": [{
"element_uuid": "<UUID of the item [string, UUID]>",
"element_name": "<Name of the item [string]>",
"related_ms": "<Microservice related to the item [string]>",
"owner": "<UUID of the owner of the item [string, UUID]>"
}]
}- One of the products does not exist in the shop:
{"error": "item_not_found"}- The wallet does not exist:
{"error": "wallet_not_found"}-
keyis wrong:
{"error": "permission_denied"}- There are not enough coins on the wallet:
{"error": "not_enough_coins"}