Skip to content
Timenikhil edited this page Sep 11, 2024 · 16 revisions

API Endpoints Documentation

Implemented API Auto Documentaion

API Endpoints Documentation

/sign-up

POST
What I want:

{
  "data": {
    "user": {
      "id": "number",
      "email": "user email",
      "username": "user username",
      "firstName": "user first name",
      "lastName": "user last name"
    }
  }
}

What I will send:

{
  "firstName": "string",
  "lastName": "string",
  "username": "string",
  "email": "string",
  "password": "string"
}

/sign-in

POST
What I want:

{
  "data": {
    "user": {
      "id": "number",
      "email": "user email",
      "username": "user username",
      "firstName": "user first name",
      "lastName": "user last name"
    },
    "activeOrganisation": "name of active organisation"
  }
}

What I will send:

{
  "username or email": "string",
  "password": "string"
}

/logged-in

GET
What I want:

{
  "data": {
    "user": {
      "id": "number",
      "email": "user email",
      "username": "user username",
      "firstName": "user first name",
      "lastName": "user last name"
    },
    "activeOrganisation": "name of active organisation"
  }
}

/get-organisations

GET
What I want:

{
  "data": {
    "organisations": [
      {
        "id": "number",
        "name": "string"
      },
      {
        "id": "number",
        "name": "string"
      }
    ]
  }
}

/new-organisation

POST
What I want:

{
  "data": {
    "id": "number",
    "name": "organisation name"
  }
}

What I will send:

{
  "name": "organisation name"
}

/organisationpage

POST
What I want:

{
  "data": {
    "isPermitted": "boolean",
    "userRole": "owner/admin/user",
    "organisation": {
      "id": "number",
      "name": "organisation name",
      "owners": [
        {
          "id": "number",
          "email": "user email",
          "username": "user username",
          "firstName": "user first name",
          "lastName": "user last name"
        }
      ],
      "admins": [
        {
          "id": "number",
          "email": "user email",
          "username": "user username",
          "firstName": "user first name",
          "lastName": "user last name"
        }
      ],
      "users": [
        {
          "id": "number",
          "email": "user email",
          "username": "user username",
          "firstName": "user first name",
          "lastName": "user last name"
        }
      ],
      "teams": [
        {
          "id": "number",
          "name": "team name"
        }
      ],
      "pendingInvites": [
        {
          "id": "number",
          "email": "user email",
          "role": "user role"
        }
      ]
    }
  }
}

What I will send:

{
  "name": "organisation name"
}

/set-active-organisation

POST
What I will send:

{
  "name": "organisation name"
}

Important: if organisationName is null that means that the currentActive has to become set as unactive. so none of the organisation are actually active at this point


/teampage

POST
(for that user)

What I want:

{
  "data": {
    "isPermitted": "boolean",
    "userRole": "admin/user",
    "team": {
      "id": "number",
      "name": "team name",
      "admins": [
        {
          "id": "number",
          "email": "user email",
          "username": "user username",
          "firstName": "user first name",
          "lastName": "user last name"
        }
      ],
      "users": [
        {
          "id": "number",
          "email": "user email",
          "username": "user username",
          "firstName": "user first name",
          "lastName": "user last name"
        }
      ],
      "otherUsers": [
        {
          "id": "number",
          "email": "user email",
          "username": "user username",
          "firstName": "user first name",
          "lastName": "user last name"
        }
      ]
    }
  }
}

note: otherUsers are users in organisations but not in team

What I will send:

{
  "name": "team name",
  "organisation": "organisation name"
}

/upload-meeting

POST
What I will send:

{
  "file": "binary data of the file",
  "type": "organisation/team",
  "organisation": "organisation name",
  "team": "team name (null if organisation type)",
  "meetingName": "Your Meeting Name",
  "meetingDate": "dd-mm-yyyy HH:MM"
}

/new-team

POST
(for that user)

What I want:

{
  "data": {
    "id": "number",
    "name": "team name"
  }
}

What I will send:

{
  "name": "team name",
  "organisation": "organisation name"
}

/get-team-meetings

POST (the teams that user belongs to)

What I want:

{
  "data": {
    "teams": [
      {
        "id": "number",
        "title": "meeting name",
        "date": "meeting date"
      }
    ]
  }
}

What I will send:

{
  "name": "team name",
  "organisation": "organisation name"
}

/get-organisation-meetings

POST
What I want:

{
  "data": {
    "organisations": [
      {
        "id": "number",
        "title": "meeting name",
        "date": "meeting date"
      }
    ]
  }
}

What I will send:

{
  "name": "organisation name"
}

/get-organisation-teams

POST
What I want:

{
  "data": {
    "teams": [
      {
        "id": "number",
        "name": "team name"
      }
    ]
  }
}

What I will send:

{
  "name": "organisation name"
}

/add-team-user

POST
What I want:

{
  "data": {
    "user": {
      "id": "number",
      "email": "user email",
      "username": "user username",
      "firstName": "user first name",
      "lastName": "user last name"
    }
  }
}

What I will send:

{
  "teamName": "team name",
  "organisation": "organisation name",
  "userId": "number",
  "role": "role of the user in the team"
}

this is basically to add a user to the team. this user will already belong to the organisation


/invite-user

POST
What I want:

{
  "data": {
    "id": "number",
    "email": "user email",
    "role": "user role"
  }
}

What I will send:

{
  "email": "user email",
  "role": "user role in the organisation",
  "organisation": "organisation name"
}

Note: in the backend there should ideally be a table for pending invites if user exists already in the system (but not in that organisation): add to the organisation if does not exist in system, add to pending invites when a user signs up we should check if any email matches anyone in the pending invites section, and add to organisation with the appropriate role accordingly


/logout

GET
What I will send:
Credentials
On the backend, the cookie should be removed.


/get-admin-teams

POST
This is similar to /get-organisation-teams but returns only the teams where the current user is an admin.


/get-user-role

POST
What I want:

{
  "role": "user role in the organisation"
}

What I will send:

{
  "name": "organisation name"
}

/add-todo

POST
What I want:

{
  "id": "todo id",
  "details": "string",
  "deadline": "datetime",
  "assigner": "Person schema",
  "assignee": "Person schema",
  "isCompleted": "boolean"
}

What I will send:

{
  "meetingid": "number",
  "organisation": "organisation name",
  "details": "string",
  "deadline": "datetime",
  "assigner": "Person id",
  "assignee": "Person id",
  "isCompleted": "boolean"
}

/edit-todo

POST
What I want:

{
  "id": "todo id",
  "details": "string",
  "deadline": "datetime",
  "assigner": "Person schema",
  "assignee": "Person schema",
  "isCompleted": "boolean"
}

What I will send:

{
  "meetingid": "number",
  "organisation": "organisation name",
  "todoid": "number",
  "details": "string",
  "deadline": "datetime",
  "assigner": "Person id",
  "assignee": "Person id",
  "isCompleted": "boolean"
}

/delete-todo

POST
per meeting so ill send meeting id, org and team, todo id

What I will send:

{
  "meetingid": "number",
  "organisation": "organisation name",
  "todoid": "number"
}

/get-meeting-todos

POST
What I want:

{
  "todos": [
    {
      "id": "todo id",
      "details": "string",
      "deadline": "datetime",
      "assigner": "Person id",
      "assignee": "Person id",
      "isCompleted": "boolean"
    }
  ]
}

What I will send:

{
  "meetingid": "number",
  "organisation": "organisation name"
}

/get-user-todos

POST
What I want:

{
  "todos": {
    "assigner": [
      {
        "id": "todo id",
        "details": "string",
        "deadline": "datetime",
        "assigner": "Person schema",
        "assignee": "Person schema",
        "isCompleted": "boolean"
      }
    ],
    "assignee": [
      {
        "id": "todo id",
        "details": "string",
        "deadline": "datetime",
        "assigner": "Person schema",
        "assignee": "Person schema",
        "isCompleted": "boolean"
      }
    ]
  }
}

so assigner array is the list of all todos where user is the assinger assignee array is the list of all todos where user is the assignee

What I will send:

{
  "userId": "number",
  "meetingid": "number",
  "organisation": "organisation name"
}

basically get-meeting-todos but where sent user in post request is the assignee or assigner


/get-all-user-todos

POST
What I will send:

{
  "organisation": "organisation name"
}

/get-meeting-details

POST
What I want:

{
  "id": "meeting id",
  "title": "meeting name",
  "date": "meeting date",
  "type": "team/organisation",
  "team": "null or team name",
  "organisation": "organisation name",
  "transcriptionGenerated": "true/false"
}

What I will send:

{
  "meetingid": "number",
  "organisation": "organisation name"
}

/get-team-role

POST
What I want:

{
  "role": "admin/user"
}

What I will send:

{
  "team": "team name",
  "organisation": "organisation name"
}

/get-transcription

POST
What I want:

{
  "type": "ai/user",
  "transcription": "string",
  "uncommonWords": ["word1", "word2"]
}

What I will send:

{
  "meetingid": "number",
  "organisation": "organisation name"
}

/update-transcription

PUT
What I want:

{
  "type": "ai/user",
  "transcription": "string",
  "uncommonWords": ["word1", "word2"]
}

What I will send:

{
  "meetingid": "number",
  "organisation": "organisation name",
  "transcription": "new transcription"
}

/get-summary

POST
What I want:

{
  "summary": "string"
}

What I will send:

{
  "meetingid": "number",
  "organisation": "organisation name"
}

/delete-user

DELETE

/delete-org

DELETE

Frontend -> Backend

{
  "name": "organisation name"
}

/delete-meet

DELETE

Frontend -> Backend

{
  "meetingid": "number",
  "organisation": "organisation name"
}

/hard-delete-meet

DELETE

Deletes meet and associated todos

Frontend -> Backend

{
  "meetingid": "number",
  "organisation": "organisation name"
}

/health

HEAD

/update-name

POST

Updates username

Frontend -> Backend

{
  "name": "new name",
}

/update-password

POST

Updates Password

Frontend -> Backend

{
  "password": "new password",
}

/remove-user

DELETE

Removes user from the organisation

Frontend -> Backend

{
  "id" : "user id of user to be removed",
  "name" : "name of organisation from which to remove user"
}

/remove-user-team

DELETE

Removes user from the team

Frontend -> Backend

{
  "id" : "user id of user to be removed",
  "name" : "name of team from which to remove user",
  "organisation" " "name of organisation to remove user from"
}