Domain request model includes Api and socket(include WeChat socket)
Type
URL
RESTful Api (api-host)
Web Socket (skt-host)
WeChat applet socket (skt-host)
wss://ws-toilet.seeed.cc
The introduction of the RESTful,
The introduction to requests and responses,
The introduction of web socket:
server use socket.io.
socket.io
socket.io
The introduction of the API call relationship
Get all WC position data for your organization or company via the API - The list of position
Get all WC cubicles data by the position ID, via the API - The list of cubicles
Keep long connection for real-time data of the cubicles or meeting rooms via the Socket
Api - The list of positions
GET{api-host}/v1/lists/positions/:bloc
Get a list of all the toilet positions in a company or organization.
Path Parameters
Name
Type
Description
bloc
string
the unique flag for the company or organization.
for example: bloc=361832720401
Query Parameters
Name
Type
Description
type
string
type=1 , get positions list of the WC.
type=2, get positions list of the meeting rooms.
{
"code": "0",
"data": [
{
"id": "32", // position id, the unique id for the location of a toilet
"company": "Seeed", // the name of company or organization
"position": "国际E城G栋9楼" // the name of the toilet
}
]
}
Api - The list of cubicles
GET{api-host}/v1/lists/cubicles/:position_id
Get a list of all the toilet cubicles which the position selected.
Path Parameters
Name
Type
Description
position_id
string
the unique id from <The list of positions> api.
for example: position_id=1