Api introduction
This document will introduce restful api and socket requests.
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, click here
The introduction to requests and responses, click here
The introduction of web socket:
server use socket.io.
socket.io doc-server
socket.io doc-client
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
bloc
string
the unique flag for the company or organization. for example: bloc=361832720401
Query Parameters
type
string
type=1 , get positions list of the WC. type=2, get positions list of the meeting rooms.
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
position_id
string
the unique id from <The list of positions> api. for example: position_id=1
Api - The list of meeting rooms
GET
{api-host}/v1/lists/meetingrooms/:position_id
Get a list of all the meeting rooms which the position selected. A meeting room maybe includes more than one sensor.
Path Parameters
position_id
string
the unique id from <The list of positions> api. for example: position_id=2
Socket - Get the real-time status (cubicles or meeting rooms)
GET
{skt-api}/v1
Get real-time status which the position selected.
Path Parameters
rn
string
room name = position_id, for example: the (client demo)
client demo (nodejs)
If you have any questions, Please contact by the email to
kevin.yang@seeed.cc
Last updated
Was this helpful?