This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
api-workplace-fabric [2018/07/16 15:40] hari |
api-workplace-fabric [2018/07/17 11:04] (current) hari [Server to client data stream] |
||
---|---|---|---|
Line 663: | Line 663: | ||
API call | API call | ||
<code> | <code> | ||
+ | POST https://apiserver/freespace/oauth/revoke | ||
+ | </code> | ||
+ | Headers | ||
+ | <code> | ||
+ | Authorization: Bearer access-token-for-melania | ||
</code> | </code> | ||
+ | Body: none | ||
+ | |||
+ | ==== What the server does between request and response ==== | ||
+ | |||
+ | The server looks up the bearer token in the database and deletes it, so that the token is invalid from the next time and the user is always redirected to the login page. The response always leads to a 204 response. | ||
+ | |||
+ | ==== Response ==== | ||
+ | |||
+ | Headers | ||
+ | <code> | ||
+ | HTTP/1.1 204 DONE | ||
+ | </code> | ||
+ | |||
+ | ===== Live occupancy update ===== | ||
+ | |||
+ | ==== Connection ==== | ||
+ | |||
+ | URL | ||
+ | <code> | ||
+ | ws://apiserver:8000/live-occupancy | ||
+ | </code> | ||
+ | |||
+ | ==== Client to server data stream ==== | ||
+ | |||
+ | None | ||
+ | |||
+ | ==== Server to client data stream ==== | ||
+ | |||
+ | <code> | ||
+ | { | ||
+ | "spaceId": "uuid-of-the-room/space-that-is-occupied-or-released", | ||
+ | "departmentId": "uuid-of-the-department-where-the-space-is", | ||
+ | "floorId": "uuid-of-the-floor-where-the-space-is", | ||
+ | "buildingId": "uuid-of-the-building-where-the-space-is", | ||
+ | "isOccupied": true if occupied, false if release | ||
+ | } | ||
+ | </code> |