Welcome to GNIST. This project is developed by Gruppe 208 for PROG2900 at NTNU.
The GNIST project is organized into two main components:
- FrontEnd/: Contains the React application that serves as the user interface.
- BackEnd/: Houses the Django application responsible for server-side operations, including API and database management.
Root directory files:
.gitignore
: Specifies intentionally untracked files to ignore.README.md
: Documentation that provides setup instructions and information.Gnist brukermanual.pdf
: User manual for the applicaiton.
To get started, you'll need to install:
- Node.js and npm (Node Package Manager)
- Python and pip (Python Package Manager)
- A preferred IDE, such as Visual Studio Code
-
Clone the Repository: Clone the repository to your local machine using the following command:
git clone https://gitlab.stud.idi.ntnu.no/ahmadmm/gnist.git
Navigate into the prog2900-gnistdigital folder
cd prog2900-gnistdigital
Navigate to the project directory:
cd gnist
-
FrontEnd Setup: Navigate to the FrontEnd directory:
cd FrontEnd
Install the necessary npm packages:
npm install
In FrontEnd directory create .env file in the root of the Frontend folder and add auth0 domain and clientId for your application:
REACT_APP_AUTH0_DOMAIN={your applications auth0 domain} REACT_APP_AUTH0_CLIENT_ID={your applications auth0 client id}
-
BackEnd Setup: Navigate to the BackEnd directory:
cd ../BackEnd
Set up a Python virtual environment:
python -m venv myenv
Navigate to myenv then activate the virtual environment: For Windows:
.\Scripts\activate
For macOS and Linux:
source myenv/bin/activate
Inside the BackEnd directory where is the requirements.txt located Install the required Python packages:
pip install -r requirements.txt
Navigate to gnist again and follow the Start the BackEnd instructions bellow.
In the terminal window ensure that you're in the Backend directory within the same folder as the manage.py file and the vitual environment is activated.
-
Create migrations
python manage.py makemigrations digital_medlemsordning
-
Apply migrations
python manage.py migrate
-
Start the FrontEnd: Inside the FrontEnd directory, start the React application:
npm start
Your default web browser will open to
http://localhost:3000
. -
Start the BackEnd: In a new terminal window, ensure you're in the BackEnd directory within the same folder as the manage.py file and the virtual environment is activated, then start the Django server:
python manage.py runserver
The Django API will be available at
http://localhost:8000
.
POST /digital_medlemsordning/create_activity/
Content-Type |
---|
application/multipart/form-data |
Parameter | Type | Description |
---|---|---|
title |
string |
Required. Ttile of activity |
description |
string |
Required. Description of activity |
image |
file |
Required. Image of activity |
date |
string |
Required. Date of activity |
limit |
string |
Optional. Member capacity of activity |
{
"title": "Football Night",
"description": "Manchester United vs Arsenal 21:00",
"image": "football_.jpg",
"date": "2024-08-19",
"limit": 40
}
Status Code | Content-Type |
---|---|
201 Created |
application/json |
{
"message": "Activity created successfully"
}
GET /digital_medlemsordning/get_future_activities/
Status Code | Content-Type |
---|---|
200 OK |
application/json |
[
{
"activityID": "81",
"title": "Football night",
"description": "Manchester United vs Liverpool 18:00",
"image": "/media/activity_pics/football_image3.png",
"date": "2025-05-29",
"limit": 40,
"signed_up_count": 2,
"signed_up_members": [
{
"first_name": "Soso",
"last_name": "Larote",
"auth0ID": "auth0|661e47baf4c703e30aaee8fc"
},
{
"first_name": "Howard",
"last_name": "Linus",
"auth0ID": "auth0|661a52a2cad534c6e30e3c37"
}
]
},
{
"activityID": 77,
"title": "Skydive",
"description": "Skydive lessons at 5 PM in Copenhagen.",
"image": "/media/activity_pics/skydive.jpeg",
"date": "2025-05-09",
"limit": null,
"signed_up_count": 2,
"signed_up_members": [
{
"first_name": "Soso",
"last_name": "Larote",
"auth0ID": "auth0|661e47baf4c703e30aaee8fc"
},
{
"first_name": "Howard",
"last_name": "Linus",
"auth0ID": "auth0|661a52a2cad534c6e30e3c37"
}
]
},
...
]
GET /digital_medlemsordning/get_past_activities/
Status Code | Content-Type |
---|---|
200 OK |
application/json |
[
{
"activityID": 77,
"title": "Skydive",
"description": "Skydive lessons at 5 PM in Copenhagen.",
"image": "/media/activity_pics/skydive.jpeg",
"date": "2024-05-09",
"limit": null,
"signed_up_count": 2,
"signed_up_members": [
{
"first_name": "Soso",
"last_name": "Larote",
"auth0ID": "auth0|661e47baf4c703e30aaee8fc"
},
{
"first_name": "Howard",
"last_name": "Linus",
"auth0ID": "auth0|661a52a2cad534c6e30e3c37"
}
]
},
{
"activityID": "81",
"title": "Football night",
"description": "Manchester United vs Liverpool 18:00",
"image": "/media/activity_pics/football_image3.png",
"date": "2023-05-29",
"limit": 40,
"signed_up_count": 2,
"signed_up_members": [
{
"first_name": "Soso",
"last_name": "Larote",
"auth0ID": "auth0|661e47baf4c703e30aaee8fc"
},
{
"first_name": "Howard",
"last_name": "Linus",
"auth0ID": "auth0|661a52a2cad534c6e30e3c37"
}
]
},
...
]
GET /digital_medlemsordning/get_activity_today/
Status Code | Content-Type |
---|---|
200 OK |
application/json |
[
{
"activityID": 77,
"title": "Skydive",
"description": "Skydive lessons at 5 PM in Copenhagen.",
"image": "/media/activity_pics/skydive.jpeg",
"date": "2024-05-10",
"limit": null,
"signed_up_count": 2,
"signed_up_members": [
{
"first_name": "Soso",
"last_name": "Larote",
"auth0ID": "auth0|661e47baf4c703e30aaee8fc"
},
{
"first_name": "Howard",
"last_name": "Linus",
"auth0ID": "auth0|661a52a2cad534c6e30e3c37"
}
]
},
{
"activityID": "81",
"title": "Football night",
"description": "Manchester United vs Liverpool 18:00",
"image": "/media/activity_pics/football_image3.png",
"date": "2024-05-10",
"limit": 40,
"signed_up_count": 2,
"signed_up_members": [
{
"first_name": "Soso",
"last_name": "Larote",
"auth0ID": "auth0|661e47baf4c703e30aaee8fc"
},
{
"first_name": "Howard",
"last_name": "Linus",
"auth0ID": "auth0|661a52a2cad534c6e30e3c37"
}
]
},
...
]
GET /digital_medlemsordning/get_all_activity/
Status Code | Content-Type |
---|---|
200 OK |
application/json |
[
{
"activityID": 55,
"title": "Yoga Retreat",
"description": "Enjoy the tranquility of yoga in a serene setting, focusing on breath control, flexibility, and strength. Ideal for all levels, this session promotes mental clarity and physical wellness.",
"image": "/media/activity_pics/YougaYogaSeaWall.jpg",
"date": "2025-05-09",
"limit": null,
"signed_up_count": 0,
"signed_up_members": []
},
{
"activityID": 75,
"title": "Hiking Adventure",
"description": "Hiking Adventure",
"image": "/media/activity_pics/Hiking_Adventure_zHouiE5.jpeg",
"date": "2024-03-12",
"limit": 20,
"signed_up_count": 1,
"signed_up_members": [
{
"first_name": "soso",
"last_name": "Larote",
"auth0ID": "auth0|661e47baf4c703e30aaee8fc"
}
]
},
...
]
GET /digital_medlemsordning/get_activity_details/{activityID}/
Parameter | Type | Description |
---|---|---|
activityID |
string |
Required. The Activity ID |
Status Code | Content-Type |
---|---|
200 OK |
application/json |
{
"activityID": 75,
"title": "Hiking Adventure",
"description": "Hiking Adventure",
"image": "/media/activity_pics/Hiking_Adventure_zHouiE5.jpeg",
"date": "2024-03-12",
"limit": 20,
"signed_up_count": 1,
"signed_up_members": [
{
"first_name": "soso",
"last_name": "Larote",
"auth0ID": "auth0|661e47baf4c703e30aaee8fc"
}
]
}
DELETE /digital_medlemsordning/delete_activity/{ID}/
Parameter | Type | Description |
---|---|---|
activityID |
string |
Required. The Activity ID |
Status Code | 204 No Content |
---|
{
"message": "Activity deleted successfully"
}
POST /digital_medlemsordning/sign_up_activity/
Parameter | Type | Description |
---|---|---|
auth0ID |
string |
Required. The Members Auth0ID |
activityID |
string |
Required. The Activity ID |
{
"auth0_id": "auth0|661a52a2cad534c6e30e3c37",
"activity_id": 75
}
Status Code | Content-Type |
---|---|
201 Created |
application/json |
{
"message": "User signed up for the activity successfully"
}
POST /digital_medlemsordning/undo_signup_activity/
Parameter | Type | Description |
---|---|---|
auth0ID |
string |
Required. The Members Auth0ID |
userID |
string |
Optional. The Members User ID |
activityID |
string |
Optional. The Activity ID |
- Either auth0ID or userID must be provided, but not both.
{
"auth0_id": "auth0|661a52a2cad534c6e30e3c37",
"activity_id": 75
}
{
"user_id": "45",
"activity_id": 75
}
Status Code | Content-Type |
---|---|
201 Created |
application/json |
{
"message": "Sign-up undone successfully"
}
GET /digital_medlemsordning/get_signed_up_members/{activityID}/
Parameter | Type | Description |
---|---|---|
activityID |
string |
Optional. The Activity ID |
Status Code | Content-Type |
---|---|
200 OK |
application/json |
{
"activity_id": 77,
"activity_title": "skydive",
"sign_up_members": [
{
"user_id": 299,
"first_name": "Miles",
"last_name": "Larote",
"birthdate": "2001-12-30",
"profile_pic": "/media/profile_pics/bevis.png"
},
{
"user_id": 289,
"first_name": "John",
"last_name": "Davies",
"birthdate": "2006-04-16",
"profile_pic": "/media/profile_pics/default_profile_picture.png"
},
...
]
}
GET /get_member_activites/{auth0ID}/
Parameter | Type | Description |
---|---|---|
auth0ID |
string |
Required. The Members Auth0ID |
Status Code | Content-Type |
---|---|
200 OK |
application/json |
[
{
"activityID": 77,
"title": "skydive",
"description": "skydive",
"image": "/media/activity_pics/skydive.jpeg",
"date": "2024-05-09",
"limit": null,
"signed_up_count": 2,
"signed_up_members": [
{
"first_name": "soso",
"last_name": "Larote",
"auth0ID": "auth0|661e47baf4c703e30aaee8fc"
},
{
"first_name": "Chris",
"last_name": "wfwfwf",
"auth0ID": "auth0|661a52a2cad534c6e30e3c37"
}
]
},
{
"activityID": 79,
"title": "Basketball",
"description": "Tournement in Oslo at 5 PM",
"image": "/media/activity_pics/basket.jpeg",
"date": "2024-05-09",
"limit": 20,
"signed_up_count": 1,
"signed_up_members": [
{
"first_name": "soso",
"last_name": "Larote",
"auth0ID": "auth0|661e47baf4c703e30aaee8fc"
}
]
},
...
]
POST /digital_medlemsordning/register_user/
Parameter | Type | Description |
---|---|---|
auth0id |
string |
Required. The Members Auth0ID |
first_name |
string |
Required. Members first name |
last_name |
string |
Required. Members last name |
birthdate |
string |
Required. Members birthdate |
gender |
string |
Required. Members gneder |
phone_number |
string |
Required. Members phone number |
email |
string |
Required. Members email |
guardian_name |
string |
Optional. Members guardian name |
guardian_phone |
string |
Optional. Members guardian phone |
- Gender options: gutt | jente | ikke-Binær | vil ikke si
{
"auth0id": "auth",
"first_name": "Samuel",
"last_name": "Samson",
"birthdate": "2002-09-05",
"phone_number": "12344321",
"gender": "gutt",
"email": "lol@hotmail.com"
}
{
"auth0id": "auth",
"first_name": "Samuel",
"last_name": "Samson",
"birthdate": "2002-09-05",
"phone_number": "12344321",
"gender": "gutt",
"email": "lol@hotmail.com",
"guardian_name": "Miles",
"guardian_phone": "987654321"
}
Status Code | Content-Type |
---|---|
201 Created |
application/json |
{
"message": "Added new user"
}
DELETE /digital_medlemsordning/delete_member/{auth0ID}/
Parameter | Type | Description |
---|---|---|
auth0ID |
string |
Required. The Members Auth0ID |
Status Code | 204 No Content |
---|
{
"message": "Member deleted successfully"
}
GET /digital_medlemsordning/get_member_attendance/?date={date}
Parameter | Type | Description | Default value |
---|---|---|---|
date |
string |
Optional. Date | Current Date |
Status Code | Content-Type |
---|---|
200 OK |
application/json |
{
"message": "Member attendance for 2024-04-06 retrieved successfully.",
"members_present": [
{
"name": "Rodger Smith",
"profile_pic": "/media/profile_pics/Default_Profile_Picture.jpg"
},
{
"name": "Lisa Stevens",
"profile_pic": "/media/profile_pics/Default_Profile_Picture.jpg"
},
{
"name": "John Conway",
"profile_pic": "/media/profile_pics/Default_Profile_Picture.jpg"
},
{
"name": "Norm Sandington",
"profile_pic": "/media/profile_pics/portofino_2464491k_qiVdymd.jpg"
},
{
"name": "Samantha Pilkington",
"profile_pic": "/media/profile_pics/81zm9tKLsxL._AC_SL1170__JIVQUhu.jpg"
}
]
}
GET /digital_medlemsordning/member_attendance_stats/?start_date={start_date}&end_date={end_date}
Parameter | Type | Description | Default value |
---|---|---|---|
start_date |
string |
Required. Starting date | Current Date |
end_date |
string |
Required. End date | Current Date |
Status Code | Content-Type |
---|---|
200 OK |
application/json |
{
"total_attendance": 19,
"attendance_by_gender": {
"vil ikke si": 3,
"jente": 6,
"gutt": 9,
"ikke-binær": 1
}
}
GET digital_medlemsordning/get_member/{auth0ID}/
Parameter | Type | Description |
---|---|---|
auth0ID |
string |
Required. Auth0ID of member |
Status Code | Content-Type |
---|---|
200 OK |
application/json |
{
"member": {
"first_name": "CHRIS",
"level": "Invincible",
"profile_color": "red",
"profile_pic": "/media/profile_pics/Default_Profile_Picture.jpg",
"banned_from": "2024-05-10",
"banned_until": "2024-05-12",
"role": "member"
}
}
GET digital_medlemsordning/get_all_members/
Status Code | Content-Type |
---|---|
200 OK |
application/json |
{
"date": "2024-05-11",
"members": [
{
"first_name": "JOHN",
"level": "Invincible",
"profile_color": "green",
"profile_pic": "/media/profile_pics/Default_Profile_Picture.jpg",
"banned_from": null,
"banned_until": null,
"role": "member"
},
{
"first_name": "SALLY",
"level": "Rookie",
"profile_color": "green",
"profile_pic": "/media/profile_pics/Default_Profile_Picture.jpg",
"banned_from": null,
"banned_until": null,
"role": "member"
},
...
]
}
GET /digital_medlemsordning/search_member/?name={name}
Parameter | Type | Description |
---|---|---|
name |
string |
Required. Name of member |
- Case insensitive.
- Retrievs any member whos first or last name contains the required string paramater.
Status Code | Content-Type |
---|---|
200 OK |
application/json |
[
{
"userID": 69,
"auth0ID": "auth0|65e06e072cc8113ba2d5cdea",
"first_name": "John",
"last_name": "Smith",
"birthdate": "2002-09-05",
"profile_pic": "/media/profile_pics/Default_Profile_Picture.jpg",
"gender": "gutt",
"points": 101,
"phone_number": "12345678",
"email": "testing@gmail.com",
"guardian_name": null,
"guardian_phone": null,
"verified": true,
"banned": true,
"banned_from": "2024-05-10",
"banned_until": "2024-05-12",
"info": "",
"role": "member"
},
{
"userID": 119,
"auth0ID": "auth0|65f9cb6b6b09e9bfdc447d30",
"first_name": "Larry",
"last_name": "Johnsen",
"birthdate": "2006-03-06",
"profile_pic": "/media/profile_pics/81zm9tKLsxL._AC_SL1170__JIVQUhu.jpg",
"gender": "gutt",
"points": 5,
"phone_number": "12345678",
"email": "chrisa2511@gmail.com",
"guardian_name": "",
"guardian_phone": "",
"verified": false,
"banned": false,
"banned_from": null,
"banned_until": null,
"info": "",
"role": "member"
},
...
]
GET /digital_medlemsordning/get_all_members_info/
Status Code | Content-Type |
---|---|
200 OK |
application/json |
[
{
"userID": 54,
"auth0ID": "auth0|65ef275a34065d2b94cc1d8d",
"first_name": "Mia",
"last_name": "Bird",
"birthdate": "2007-01-01",
"profile_pic": "/media/profile_pics/Default_Profile_Picture.jpg",
"gender": "jente",
"points": 5,
"phone_number": "43675543",
"email": "mia@gmail.com",
"guardian_name": "",
"guardian_phone": "",
"verified": true,
"banned": false,
"banned_from": null,
"banned_until": null,
"info": "nøkkel til klubbhus",
"role": "member"
},
{
"userID": 55,
"auth0ID": "auth0|65ef289190350a753bf985ae",
"first_name": "Michael",
"last_name": "Larson",
"birthdate": "2008-01-07",
"profile_pic": "/media/profile_pics/Default_Profile_Picture.jpg",
"gender": "gutt",
"points": 0,
"phone_number": "20122310",
"email": "larson54@gmail.com",
"guardian_name": "",
"guardian_phone": "",
"verified": true,
"banned": false,
"banned_from": null,
"banned_until": null,
"info": "",
"role": "member"
},
...
]
PUT /digital_medlemsordning/ban_member/{auth0ID}/
Parameter | Type | Description |
---|---|---|
auth0ID |
string |
Required. Auth0ID of member |
banned_from |
string |
Required. Start date of member ban |
banned_until |
string |
Required. End date of member ban |
{
"banned_from": "2024-05-11",
"banned_until": "2024-05-26"
}
Status Code | Content-Type |
---|---|
200 OK |
application/json |
{
"message": "Member banned successfully from 2024-05-11 until 2024-05-26"
}
PUT /digital_medlemsordning/unban_member/{auth0ID}/
Parameter | Type | Description |
---|---|---|
auth0ID |
string |
Required. Auth0ID of member |
Status Code | Content-Type |
---|---|
200 OK |
application/json |
{
"message": "Member unbanned successfully"
}
GET /digital_medlemsordning/get_banned_members/
Status Code | Content-Type |
---|---|
200 OK |
application/json |
{
"message": "Banned members retrieved successfully.",
"banned_members": [
{
"full_name": "John Smith",
"profile_picture": "/media/profile_pics/Default_Profile_Picture.jpg",
"banned_from": "2024-05-11",
"banned_until": "2024-05-26",
"auth0_id": "auth0|65f9cv6b6b0ee9bfdc447d25"
},
{
"full_name": "Lilly Hammond",
"profile_picture": "/media/profile_pics/Default_Profile_Picture.jpg",
"banned_from": "2024-05-07",
"banned_until": "2024-05-14",
"auth0_id": "auth0|65f9cb6b6b09e9bfdc447d30"
},
...
]
}
PUT /digital_medlemsordning/adjust_member_points_total/{auth0ID}/
Parameter | Type | Description |
---|---|---|
auth0ID |
string |
Required. Auth0ID of member |
points |
int |
Required. Number of points |
{
"points": 10
}
{
"points": -10
}
Status Code | Content-Type |
---|---|
201 Created |
application/json |
{
"message": "Member points altered"
}
PUT /digital_medlemsordning/add_member_info/{auth0ID}/
Parameter | Type | Description |
---|---|---|
auth0ID |
string |
Required. Auth0ID of member |
{
"info": "Ability to acces club on saturdays"
}
Status Code | Content-Type |
---|---|
200 OK |
application/json |
{
"auth0ID": "auth0|661a52a2cad534c6e30e3c37",
"info": "Ability to acces club on saturdays"
}
PUT /digital_medlemsordning/remove_member_info/{auth0ID}/
Parameter | Type | Description |
---|---|---|
auth0ID |
string |
Required. Auth0ID of member |
Status Code | Content-Type |
---|---|
200 OK |
application/json |
{
"auth0ID": "auth0|661a52a2cad534c6e30e3c37",
"info": ""
}
GET /digital_medlemsordning/get_members_with_info/
Status Code | Content-Type |
---|---|
200 OK |
application/json |
[
{
"auth0ID": "auth0|65ef275a34065d2b94cc1d8d",
"first_name": "John",
"last_name": "Pilkington",
"info": "Key to clubhouse"
},
{
"auth0ID": "auth0|661711a8bdf844868576402b",
"first_name": "Mia",
"last_name": "Davies",
"info": "Allowed to access clubhouse on saturdays"
},
...
]
GET /digital_medlemsordning/get_all_unverified_members/
Status Code | Content-Type |
---|---|
200 OK |
application/json |
[
{
"auth0ID": "auth0|65ef275a34065d2b94cc1d8d",
"birthdate": "2004-01-01",
"first_name": "James",
"last_name": " Kahn",
"guardian_name": "",
"guardian_phone": ""
},
{
"auth0ID": "auth0|65ef289190350a753bf985ae",
"birthdate": "2011-05-07",
"first_name": "Lisa",
"last_name": "Danilson",
"guardian_name": "Laila Danilson",
"guardian_phone": "43892312"
},
...
]
PUT /digital_medlemsordning/verify_member/{auth0ID}/
Parameter | Type | Description |
---|---|---|
auth0ID |
string |
Required. Auth0ID of member |
Status Code | Content-Type |
---|---|
200 OK |
application/json |
{
"message": "Member successfully verified"
}
POST /digital_medlemsordning/add_day/{auth0ID}/
Parameter | Type | Description |
---|---|---|
auth0ID |
string |
Required. Auth0ID of member |
Status Code | Content-Type |
---|---|
200 OK |
application/json |
{
"message": "Successfully registred members attendence"
}
PATCH /digital_medlemsordning/upload_profile_picture/{auth0ID}/
Content-Type |
---|
application/multipart/form-data |
Parameter | Type | Description |
---|---|---|
auth0ID |
string |
Required. Auth0ID of member |
profile_pic |
file |
Required. Profile picture |
{
"profile_pic": "profile_pic_.jpg"
}
Status Code | Content-Type |
---|---|
200 OK |
application/json |
{
"message": "Profile picture updated successfully"
}
POST /digital_medlemsordning/upload_member_certificates/{auth0ID}/
Content-Type |
---|
application/multipart/form-data |
Parameter | Type | Description |
---|---|---|
auth0ID |
string |
Required. Auth0ID of member |
certificate_image |
file |
Required. Certificate image |
certificate_name |
string |
Required. Certificate name |
{
"certificate_image": "dj_certificate_.jpg",
"certificate_name": "dj certificate"
}
Status Code | Content-Type |
---|---|
201 Created |
application/json |
{
"message": "Certificate uploaded successfully"
}
GET /digital_medlemsordning/get_member_certificates/{auth0ID}/
Status Code | Content-Type |
---|---|
200 OK |
application/json |
Parameter | Type | Description |
---|---|---|
auth0ID |
string |
Required. Auth0ID of member |
[
{
"certificateID": 16,
"certificate_image": "/media/certificates/New-York-Skyline-Big-Bus-Tours-Jan-2018_jaMkaEM.jpg",
"certificate_name": "test_certificate3"
},
{
"certificateID": 17,
"certificate_image": "/media/certificates/portofino_2464491k_fue2eAB.jpg",
"certificate_name": "test_certificate3"
},
...
]
DELETE /digital_medlemsordning/delete_member_certificate/{certificateID}/
Parameter | Type | Description |
---|---|---|
certificateID |
string |
Required. ID of a certificate |
Status Code | 204 No Content |
---|
{
"message": "Certificate deleted successfully"
}
POST /digital_medlemsordning/create_level/
Parameter | Type | Description |
---|---|---|
name |
string |
Required. Name of the level |
points |
string |
Required. Points of the level |
{
"name": "Invincible",
"points": 120
}
Status Code | Content-Type |
---|---|
201 Created |
application/json |
{
"message": "Level successfully created"
}
GET /digital_medlemsordning/get_all_levels/
Status Code | Content-Type |
---|---|
200 OK |
application/json |
[
{
"levelID": 49,
"name": "Legend",
"points": 100
},
{
"levelID": 50,
"name": "Pro",
"points": 80
},
{
"levelID": 51,
"name": "Intermediate",
"points": 60
},
{
"levelID": 52,
"name": "Rookie",
"points": 40
},
{
"levelID": 53,
"name": "Noob",
"points": 20
},
{
"levelID": 56,
"name": "Invincible",
"points": 120
},
...
]
PUT /digital_medlemsordning/edit_level/{levelID}/
Parameter | Type | Description |
---|---|---|
auth0ID |
string |
Required. Auth0ID of member |
levelID |
string |
Required. ID of a level |
{
"name": "Invincible",
"points": 110
}
Status Code | Content-Type |
---|---|
200 OK |
application/json |
{
"message": "Level updated successfully"
}
DELETE /digital_medlemsordning/delete_level/{levelID}/
Parameter | Type | Description |
---|---|---|
levelID |
string |
Required. ID of a level |
Status Code | 204 No Content |
---|
{
"message": "Level deleted successfully"
}
POST /digital_medlemsordning/create_suggestion/
Parameter | Type | Description |
---|---|---|
title |
string |
Required. Ttile of suggestion |
description |
string |
Required. Description of suggestion |
{
"title": "Trip to Tekninsk Museum",
"description": "It would be great if we could go and visit Teknisk museum during the summer"
}
Status Code | Content-Type |
---|---|
201 Created |
application/json |
{
"suggestionID": 56,
"title": "Trip to Tekninsk Museum",
"description": "It would be great if we could go and visit Teknisk museum during the summer"
}
GET /digital_medlemsordning/get_all_suggestions/
Status Code | Content-Type |
---|---|
200 OK |
application/json |
[
{
"suggestionID": 15,
"title": "Celebrate birthday",
"description": "Marcus has his birthay comming up. I want us to have a party for him."
},
{
"suggestionID": 56,
"title": "Trip to Tekninsk Museum",
"description": "It would be great if we could go and visit Teknisk museum during the summer."
}
...
]
DELETE /digital_medlemsordning/delete_suggestion/{suggestionID}/
Parameter | Type | Description |
---|---|---|
suggestionID |
string |
Required. The Suggestion ID |
Status Code | 204 No Content |
---|
{
"message": "Suggestion deleted successfully"
}
POST /digital_medlemsordning/create_question/
Parameter | Type | Description |
---|---|---|
question |
string |
Required. Questiion |
answers |
[string] |
Required. Answers to the question |
{
"question": "Which month",
"answers": [
{"answer": "January"},
{"answer": "February"},
{"answer": "March"},
{"answer": "April"},
{"answer": "May"}
]
}
Status Code | Content-Type |
---|---|
201 Created |
application/json |
{
"message": "Question and answers successfully created."
}
GET /digital_medlemsordning/get_all_questions/
Status Code | Content-Type |
---|---|
200 OK |
application/json |
{
"questions": [
{
"questionID": 37,
"question": "Who is the author of 'To Kill a Mockingbird'?",
"answers": [
{
"answer_id": 109,
"answer_text": "Harper Lee"
},
{
"answer_id": 110,
"answer_text": "J.K. Rowling"
},
{
"answer_id": 111,
"answer_text": "Stephen King"
}
]
},
{
"questionID": 42,
"question": "What is the capital city of Australia?",
"answers": [
{
"answer_id": 124,
"answer_text": "Sydney"
},
{
"answer_id": 125,
"answer_text": "Melbourne"
},
{
"answer_id": 126,
"answer_text": "Canberra"
},
{
"answer_id": 127,
"answer_text": "Perth"
},
{
"answer_id": 128,
"answer_text": "Brisbane"
}
]
},
...
]
}
POST /digital_medlemsordning/submit_response/{auth0ID}/
Parameter | Type | Description |
---|---|---|
auth0ID |
string |
Required. Auth0ID of member |
question |
string |
Required. ID of question |
answers |
[string] |
Required. ID of answer |
{
"question": "40",
"answer": "118"
}
Status Code | Content-Type |
---|---|
201 Created |
application/json |
{
"message": "User response submitted successfully."
}
GET /digital_medlemsordning/get_question_responses/{questionID}/
Parameter | Type | Description |
---|---|---|
questionID |
string |
Required. ID of question |
Status Code | Content-Type |
---|---|
200 OK |
application/json |
{
"message": "Answer counts retrieved successfully",
"question": "Which state is the largest in the US",
"answer_counts": {
"Texas": 15,
"Alaska": 18,
"Main": 0,
"New York": 12,
"California": 9
}
}
DELETE digital_medlemsordning/delete_question/{questionID}/
Parameter | Type | Description |
---|---|---|
questionD |
string |
Required. The Question ID |
Status Code | 204 No Content |
---|
{
"message": "Question deleted successfully"
}