The default endpoint if you run this locally is http://localhost:3000
. For my demo, is https://api.mitscherlich.me/antigen
.
POST /user/signup
Sign up a brand new user.
Name | Type | Description |
---|---|---|
name |
String |
user name |
image |
String |
base64 encrypted image |
A UUID v4 token for user
e3e9e0ff-aae1-49f8-ade3-9a3af79984de
GET /user/:name/token
Get a user's token
Name | Type | Description |
---|---|---|
image |
String |
base64 encrypted image |
{
"success": true,
"token": "<uuid>",
"message": "ok"
}
POST /user/auth
It's quite similar to get user's token but in POST
method and no parameters in url.
And this methods has side effects that will save the image this time as user.last
for manual inspection.
Name | Type | Description |
---|---|---|
token |
String |
user token |
image |
String |
base64 encrypted image |
{
"success": true,
"token": "<uuid>",
"message": "ok"
}
GET /gates
[
{
"id": "<uuid>"
}
]
Returns gates' ID list. Gate's ID is also in UUID v4 format.
GET /gate/:id/open
Waring: for debug only. This will open a gate directly. Consider disable or remove it in production mode.
{
"success": true,
"message": "gate has been opened"
}
POST /gate/:id/auth
Name | Type | Description |
---|---|---|
token |
String |
user token |
image |
String |
base64 encrypted image |
{
"success": true,
"message": "gate has been open"
}
POST /gate/auth
This is quite similar to the same up but id
in the parameters and only return true
or false
for user authorization result. Currentlly used in mobile application and not recommend for new applications.
Name | Type | Description |
---|---|---|
id |
String |
gate id |
token |
String |
user token |
image |
String |
base64 encrypted image |
true
POST /api/face/detection
Name | Type | Description |
---|---|---|
image |
String |
base64 encrypted image |
{
"count": 1,
"faces": [
{
"x": 113,
"y": 66,
"width": 72,
"height": 86
}
]
}
POST /api/face/landmarks
Name | Type | Description |
---|---|---|
image |
String |
base64 encrypted image |
{
"count": 1,
"faces": [
{
"x": 113,
"y": 66,
"width": 72,
"height": 86,
"points": [
{ "x": 131.15, "y": 104.488 },
{ "x": 158.064, "y": 101.253 },
{ "x": 144.462, "y": 118.552 },
{ "x": 138.1, "y": 135.026 },
{ "x": 157.969, "y": 132.387 }
]
}
]
}
POST /api/face/identify
Name | Type | Description |
---|---|---|
image |
String |
base64 encrypted image |
{
"similars": [0.210629, 0.219952, 0.999999, 0.148808],
"count": 1,
"faces": [
{
"x": 113,
"y": 66,
"width": 72,
"height": 86,
"points": [
{ "x": 131.15, "y": 104.488 },
{ "x": 158.064, "y": 101.253 },
{ "x": 144.462, "y": 118.552 },
{ "x": 138.1, "y": 135.026 },
{ "x": 157.969, "y": 132.387 }
]
}
]
}
If no user in the database, this will faceback to Face landmarks.
A very simple way to generate a qr code with provided content.
GET /qrcode
Name | Type | Description |
---|---|---|
content |
String |
qr code content |
data:image/png;base64,...
QR code image will return in base64 format.