Skip to content

hindusian-labs/presence-system-be

Repository files navigation

Presence System API


Online documentation, can be found in here.


Table of Contents


Health Check

Endpoint

GET /

Response

{
  "status": "success",
  "data": {
    "time": "2022-11-02T05:54:41.412Z"
  }
}

Generate API Key

Endpoint

POST /key

Response

{
  "status": "success",
  "data": {
    "key": "7aecca35-c410-4b12-9c92-7cea39cdc40c"
  }
}

User

Store User

Endpoint

POST /user

Header

X-API-Key: {{API-KEY}} => X:API-Key: "7aecca35-c410-4b12-9c92-7cea39cdc40c"

Body

{
  "id": "1R2EQ4W3",
  "name": "Joy"
}

Response

{
  "status": "success",
  "data": {
    "id": "1R2EQ4W3",
    "name": "Joy",
    "createdAt": "2022-11-06T04:02:40.370Z",
    "updatedAt": "2022-11-06T04:02:40.370Z"
  }
}

Fetch All Users

Endpoint

GET /user

Header

X-API-Key: {{API-KEY}} => X:API-Key: "7aecca35-c410-4b12-9c92-7cea39cdc40c"

Response

{
  "status": "success",
  "data": [
    {
      "id": "1R2EQ4W3",
      "name": "Joy",
      "createdAt": "2022-11-06T04:02:40.370Z",
      "updatedAt": "2022-11-06T04:02:40.370Z"
    }
  ]
}

Modify User

Endpoint

PUT /user/:id => PUT /user/1R2EQ4W3

Header

X-API-Key: {{API-KEY}} => X:API-Key: "7aecca35-c410-4b12-9c92-7cea39cdc40c"

Body

{
  "name": "Joyful"
}

Response

{
  "status": "success",
  "data": {
    "id": "1R2EQ4W3",
    "name": "Joyful",
    "createdAt": "2022-11-06T04:02:40.370Z",
    "updatedAt": "2022-11-06T04:11:08.193Z"
  }
}

Fetch User

Endpoint

GET /user/:id => GET /user/1R2EQ4W3

Header

X-API-Key: {{API-KEY}} => X:API-Key: "7aecca35-c410-4b12-9c92-7cea39cdc40c"

Response

{
  "status": "success",
  "data": {
    "id": "1R2EQ4W3",
    "name": "Joyful",
    "createdAt": "2022-11-06T04:02:40.370Z",
    "updatedAt": "2022-11-06T04:11:08.193Z"
  }
}

Delete User

Endpoint

DELETE /user/:id => DELETE /user/1R2EQ4W3

Header

X-API-Key: {{API-KEY}} => X:API-Key: "7aecca35-c410-4b12-9c92-7cea39cdc40c"

Response

{
  "status": "success",
  "data": {
    "id": "1R2EQ4W3",
    "name": "Joyful",
    "createdAt": "2022-11-06T04:02:40.370Z",
    "updatedAt": "2022-11-06T04:11:08.193Z"
  }
}

Check

Check In

Endpoint

POST /check/:id => POST /check/1R2EQ4W3

Header

X-API-Key: {{API-KEY}} => X:API-Key: "7aecca35-c410-4b12-9c92-7cea39cdc40c"

Response

{
  "status": "success",
  "data": {
    "userId": "1R2EQ4W3",
    "in": "01:42:32",
    "out": null,
    "date": "11/8/2022"
  }
}

Check Out

Endpoint

POST /check/:id => POST /check/1R2EQ4W3

Header

X-API-Key: {{API-KEY}} => X:API-Key: "7aecca35-c410-4b12-9c92-7cea39cdc40c"

Response

{
  "status": "success",
  "data": {
    "userId": "1R2EQ4W3",
    "in": "01:42:32",
    "out": "01:43:01",
    "date": "11/8/2022"
  }
}

Check Out Error

Response

{
  "status": "fail",
  "data": "User already checked out."
}

Fetch All Checkes

Endpoint

GET /check

Response

{
  "status": "success",
  "data": [
    {
      "userId": "1R2EQ4W3",
      "in": "01:42:32",
      "out": "01:43:01",
      "date": "11/8/2022"
    }
  ]
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages