Repository navigation
Server API
AntonVonDelta edited this page Mar 13, 2021
·
20 revisions
-
Chunked transferof video feed data - Every scene command (
move,rotate,etc.) will be performed by a separateget request- The response of those request will hint about the state of the connection:
-
200Successmeans the connection is alive and the cookie has not expired -
404Not foundmeans the cookie id was no longer valid/found on the server. A new session is required
-
- The response of those request will hint about the state of the connection:
- The video feed will be provided by a back-channel for realtime. This connection will use chunked messages from the server. The images themselves can be chunked or they will be integrally sent.
- The requests made by the client are identified by the server based on a cookie. This cookie will expire after a period of inactivity.
Unless otherwise stated, all requests described will be available at the /api path.
-
/login- This is used by the client to receive a new cookie from the server and to initiate the graphics on the server side. Without this cookie no other request made by the client can succeed.
- The response given to this request will set the cookie on the browser and will be used as a realtime channel for the video feed. The data sent will be chunked in order to allow stremeable video.
- After a period of inactivity the cookie WILL expire on the server side. As a result this persistent connection will be closed. This will also invalidate any other new requests performed by the client. The client should acquire a new cookie by calling again
/login - Http code
200Successmeans the cookie has been succesfully allocated and video fees has started. - Http code
409Conflictmeans the server cannot produce a new cookie. In this situation the next request should be attempted after 3 seconds.
-
/move?direction={direction}&amount={amount}-
directionhas the following possible values:-
0-> pozitiveZ axis -
1-> negativeZ axis -
2-> positiveX Axis -
3-> negativeX Axis -
4-> positiveY Axis -
5-> negativeY Axis
-
-
amountspecifies the amount of units to move on the given axis
-
-
/rotate?direction={direction}&amount={amount}-
directionhas the following values and meanings:-
0-> rotation aroundY Axisaka to the left/right -
1-> rotation aroundX Axis
-
-
amountA positive value means a counter clockwise rotation around the given axis. In Degrees.
-
-
/loadwith body{data}-
datais of string type and contains the description of 3D object. The format of the object should be the same as of the.objfile format. Details here - Http code
200means success, the object is valid and loaded - Http code
422Unprocessable failuremeans the data is malformed. The body will contain the error which can be shown to the user.
-