This repository has been archived by the owner on Sep 20, 2023. It is now read-only.
generated from cryptic-game/microservice-java-template
-
-
Notifications
You must be signed in to change notification settings - Fork 0
API Reference
Jannik Emmerich edited this page Nov 11, 2020
·
5 revisions
Required parameters:
-
name
: name of the network [string]
Response:
- success:
{
"uuid":"<uuid of the network [string, UUID]>",
"hidden":"<visibility of the network [boolean]>",
"owner":"<uuid of the owner of the network [string, UUID]>",
"name":"<name of the network [string]>"
}
- the network does not exist:
{
"error":"network_not_found"
}
Required parameters:
-
uuid
: uuid of the network [string, UUID]
Response:
- success:
{
"uuid":"<uuid of the network [string, UUID]>",
"hidden":"<visibility of the network [boolean]>",
"owner":"<uuid of the owner of the network [string, UUID]>",
"name":"<name of the network [string]>"
}
- the network does not exist:
{
"error":"network_not_found"
}
No parameters
Response:
- success:
{
"networks":
[{
"uuid":"<uuid of the network [string, UUID]>",
"hidden":"<visibility of the network [boolean]>",
"owner":"<uuid of the owner of the network [string, UUID]>",
"name":"<name of the network [string]>"
}]
}
Required parameters:
-
device
: uuid of the device that wants to create a new network [string, UUID] -
name
: name of the new network [string] -
hidden
: visibility of the new network [boolean]
Response:
- success:
{
"uuid":"<uuid of the network [string, UUID]>",
"hidden":"<visibility of the network [boolean]>",
"owner":"<uuid of the owner of the network [string, UUID]>",
"name":"<name of the network [string]>"
}
- the device is owner of more than two networks:
{
"error":"maximum_networks_reached"
}
- the name is not valid:
{
"error":"invalid_name"
}
- the name is already in use:
{
"error":"name_already_in_use"
}
- the user has no permissions for the device:
{
"error":"no_permissions"
}
- the device is not online:
{
"error":"device_not_online"
}
Required parameters:
-
uuid
: uuid of the network [string, UUID]
Response:
- success:
{
"members":
[{
"uuid":"<uuid of the membership [string, UUID]>",
"network":"<uuid of the network [string, UUID]>",
"device":"<uuid of the device [string, UUID]>"
}]
}
- the network does not exist or the user has no permissions for the owner device of the network:
{
"error":"network_not_found"
}
Required parameters:
-
device
: uuid of the device [string, UUID]
Response:
- success:
{
"networks":
[{
"uuid":"<uuid of the network [string, UUID]>",
"hidden":"<visibility of the network [boolean]>",
"owner":"<uuid of the owner of the network [string, UUID]>",
"name":"<name of the network [string]>"
}]
}
Required parameters:
-
uuid
: uuid of the network [string, UUID] -
device
: uuid of the device [string, UUID]
Response:
- success:
{
"uuid":"<uuid of the invitation [string, UUID]>",
"network":"<uuid of the network [string, UUID]>",
"device":"<uuid of the device [string, UUID]>",
"request":true
}
- the network does not exist:
{
"error":"network_not_found"
}
- the device is already member of the network:
{
"error":"already_member_of_network"
}
- the device has already been invited to the network or has already requestd to join the network:
{
"error":"invitation_already_exists"
}
- the user has no permissions for the device:
{
"error":"no_permissions"
}
- the device is not online:
{
"error":"device_not_online"
}
Required parameters:
-
device
: uuid of the device [string, UUID]
Response:
- success:
{
"invitations":
[{
"uuid":"<uuid of the invitation [string, UUID]>",
"network":"<uuid of the network [string, UUID]>",
"device":"<uuid of the device [string, UUID]>",
"request":"<invitation is request or invitation [boolean]>"
}]
}
- the user has no permissions for the device:
{
"error":"no_permissions"
}
- the device is not online:
{
"error":"device_not_online"
}
Required parameters:
-
uuid
: uuid of the network [string, UUID] -
device
: uuid of the device [string, UUID]
Response:
- success:
{
"result":true
}
- the user has no permissions for the device or the network does not exist:
{
"error":"no_permissions"
}
- the device is not a member of the network:
{
"result":false
}
- the device is the owner of the network:
{
"error":"cannot_leave_own_network"
}
- the device is not online:
{
"error":"device_not_online"
}
Required parameters:
-
device
: uuid of the device [string, UUID]
Response:
- success:
{
"networks":
[{
"uuid":"<uuid of the network [string, UUID]>",
"hidden":"<visibility of the network [boolean]>",
"owner":"<uuid of the owner of the network [string, UUID]>",
"name":"<name of the network [string]>"
}]
}
Required parameters:
-
uuid
: uuid of the network [string, UUID] -
device
: uuid of the device [string, UUID]
Response:
- success:
{
"uuid":"<uuid of the invitation [string, UUID]>",
"network":"<uuid of the network [string, UUID]>",
"device":"<uuid of the device [string, UUID]>",
"request":false
}
- the network does not exist or the user has no permissions for the owner device of the network:
{
"error":"network_not_found"
}
- the device is already member of the network:
{
"error":"already_member_of_network"
}
- the device has already been invited to the network or has already requestd to join the network:
{
"error":"invitation_already_exists"
}
- the device is not online:
{
"error":"device_not_online"
}
Required parameters:
-
uuid
: uuid of the invitation [string, UUID]
Response:
- success:
{
"result":true
}
- the invitation does not exist:
{
"error":"invitation_not_found"
}
- the user has no permissions to accept the invitation:
{
"error":"no_permissions"
}
- the device is not online:
{
"error":"device_not_online"
}
Required parameters:
-
uuid
: uuid of the invitation [string, UUID]
Response:
- success:
{
"result":true
}
- the invitation does not exist:
{
"error":"invitation_not_found"
}
- the user has no permissions to deny the invitation:
{
"error":"no_permissions"
}
- the device is not online:
{
"error":"device_not_online"
}
Required parameters:
-
uuid
: uuid of the network [string, UUID]
Response:
- success:
{
"requests":
[{
"uuid":"<uuid of the invitation [string, UUID]>",
"network":"<uuid of the network [string, UUID]>",
"device":"<uuid of the device [string, UUID]>",
"request":true
}]
}
- the network does not exist or the user has no permissions for the owner device of the network:
{
"error":"no_permissions"
}
Required parameters:
-
uuid
: uuid of the network [string, UUID]
Response:
- success:
{
"invitations":
[{
"uuid":"<uuid of the invitation [string, UUID]>",
"network":"<uuid of the network [string, UUID]>",
"device":"<uuid of the device [string, UUID]>",
"request":false
}]
}
- the network does not exist or the user has no permissions for the owner device of the network:
{
"error":"no_permissions"
}
Required parameters:
-
uuid
: uuid of the network [string, UUID] -
device
: uuid of the device [string, UUID]
Response:
- success:
{
"result":true
}
- the network does not exist or the user has no permissions for the owner device of the network:
{
"error":"no_permissions"
}
- the device is not a member of the network:
{
"result":false
}
- the device is the owner of the network:
{
"error":"cannot_kick_owner"
}
- the device is not online:
{
"error":"device_not_online"
}
Required parameters:
-
uuid
: uuid of the network [string, UUID]
Response:
- success:
{
"result":true
}
- the network does not exist or the user has no permissions for the owner device of the network:
{
"error":"network_not_found"
}
- the device is not online:
{
"error":"device_not_online"
}
Required parameters:
-
uuid
: uuid of the invitation [string, UUID]
Response:
- success:
{
"result":true
}
- the invitation does not exist:
{
"error":"invitation_not_found"
}
- the user has no permissions for the device of the invitation:
{
"error":"no_permissions"
}
- the device is not online:
{
"error":"device_not_online"
}
Required parameters:
-
source
: uuid of the source device [string, UUID] -
destination
: uuid of destination device [string, UUID]
Response:
- the two devices are in the same network:
{
"connected":true
}
- the two devices are not in the same network:
{
"connected":false
}
Required parameters:
-
user_uuid
: uuid of the user [string, UUID]
Response:
- success:
{}