Skip to content

shubhamnh/vas-chatbot-server

Repository files navigation

Virtual Assistant for Students (Chatbot) - Backend

A chatbot for students to get info related to exam results, time table, etc.

This is the server application.

The client app can be found here

Contents

Environment Variables

To run this project, you will need to add the following environment variables to your .env file. Sample present in .env_sample.

  • SECRET_KEY Generate the secret key by running the following from the command line:

python -c 'from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())'

  • DATABASE_URL

  • WP_PRIVATE_KEY

  • WP_CLAIMS_EMAIL

API Reference

Student

Admin / Professor

  • Post Group Notifications : POST /login/notif/
  • Post Personal Notifications : POST /login/personal/

Obtain Auth Tokens (Login)

URL : /api/token-auth/

Method : POST

Auth required : NO

Request body

{
    "username": "[valid username/rollnumber]",
    "password": "[password in plain text]"
}

Success Response

Code : 200 OK

Response body

{
  "refresh": "[refresh_token]",
  "access": "[access_token]"
}

Verify Auth Tokens

URL : /api/token-verify/

Method : POST

Auth required : NO

Request body

{
    "token": "[access token]",
}

Success Response

Code : 200 OK

Response body

{}

User Information

URL : /api/profile/

Methods : GET

Auth required : YES

Success Response

Code : 200 OK

Response body

{
  "rno": "[username/roll number]",
  "name": "[Name]",
  "batch": 3
}

Querying

URL : /api/query/

Method : POST

Auth required : YES

Request body

{
    "query": "[query in plain text]"
}

Success Response

Code : 200 OK

Response body

{
  "response": [
      {
          "text": "Hey! How you doin?"
      },
      {
          "image": "https://example.com/wave.jpg"
      },
      ...
  ]
}

Get Group Notifications

URL : /api/groupnotif/

Methods : GET

Auth required : YES

Success Response

Code : 200 OK

Response body

[
    {
        "teacher":"Prof. Sagan",
        "subject":"Voyager 1",
        "notice":"Pale Blue Dot",
        "interest":"Astrophysics",
        "creation_date":"2021-01-19"
    }
]

Get Personal Notifications

URL : /api/individualnotif/

Methods : GET

Auth required : YES

Success Response

Code : 200 OK

Response body

[
    {
        "teacher":"Prof. Feynman",
        "subject":"Fun to Imagine",
        "notice":"The Oxygen atoms snap in to the Carbon atoms to create a Catastrophe! 🔥",
        "creation_date":"2021-01-19"
    }
]

Support / Feedback

URL : /api/feedback/

Method : POST

Auth required : YES

Request body

{
  "subject": "[Subject]",
  "details": "[Feedback]"
}

Success Response

Code : 201 OK

Response body

{
  "subject": "[Subject]",
  "details": "[Feedback]",
}

TODO

  • API reference for Push Notifications and Admin side endpoints (POST Notifitions)

  • Installation, Features and screenshots

About

Virtual Assistant for Students (Chatbot) - Server. Get time table, results, etc. through chatbot. For college, university, school.

Topics

Resources

License

Stars

Watchers

Forks

Languages