Share
Explore

Shardz - A Collective Storage Platform

Developed by: Team X3cutioners
Team members:
Aadarsh Kumar Singh
Abhishek Verma
Aman Sharma

Backend of Shardz


Shardz API Endpoints

Home

GET /
Response:
Welcome to Shardz API

User Authentication

POST /login
Payload:
{
"email": "something@gmail.com",
"password": "MyStrongPassword"
}
Response:
200
{
"access_token": "some_access_token",
"message": "Login Successful"
}
401
{
"message": "Some Error Message"
}

Register

POST /register
Payload:
{
"name": "Abhishek Verma",
"email": "abhishek@verma.com",
"password": "SomePasswordOfYourAccount"
}
Response:
200
{
"message": "Registration Successful. Verify your email"
}
401
{
"message": "Registration Unsuccessful. Some error message"
}

Verify Email

POST /verify
Payload:
{
"token": "SomeVerificationTokenFoundInVerificationLink"
}
Response:
200
{
"access_token": "SomeVerificationTokenSentByServerAfterSuccessfulEmailVerification"
}

Update Profile

POST /update-profile
Payload:
{
"name": "Abhishek Verma",
"email": "newemail@verma.com",
"file": "profile_picture"
}
Response:
200
{
"message": "Profile updated successfully."
}
401
{
"message": "Profile update unsuccessful. Some error message"
}

Update Password

POST /update-password
Payload:
{
"password": "SomeStrongPassword"
}
Response:
200
{
"message": "Password updated successfully."
}
401
{
"message": "Password update unsuccessful. Some error message"
}

Forgot Password

POST /forgot-password
Payload:
{
"email": "abhishek@verma.com"
}
Response:
200
{
"message": "Password reset email sent."
}
401
{
"message": "Password reset email can't be sent. Some error message"
}
Now, after this verification mail sent, the endpoint will be used to verify account and get the access token. After obtaining the access token, let user update the password and use the endpoint. After update password, do not logout user, keep the user logged in by using the new access token that was generated by verification API endpoint.

User Profile

GET /profile
Response:
200
{
"name": "Abhishek Verma",
"email": "hello@abhishek.com",
"profile_picture": "url of profile picture from some CDN"
}
401
{
"message": "User not authenticated"
}

Dashboard

GET /dashboard
Response:
{
"name": "Abhishek Verma",
"profile_picture": "Picture CDN URL",
"email": "abhishek@verma.com",
"recent_files": [
{"name": "AbhishekVerma.png", "id": "123", "timestamp": "Some Date", "size": "2 MB"},
{"name": "AbhishekVerma.png", "id": "123", "timestamp": "Some Date", "size": "2 MB"},
{"name": "AbhishekVerma.png", "id": "123", "timestamp": "Some Date", "size": "2 MB"}
],
"drives": [
{"id": "2", "name": "Google Drive", "icon": "../gdrive.png", "used": "2000GB", "total": "4000GB"},
{"id": "2", "name": "Google Drive", "icon": "../gdrive.png", "used": "2000GB", "total": "4000GB"},
{"id": "2", "name": "Google Drive", "icon": "../gdrive.png", "used": "2000GB", "total": "4000GB"},
{"id": "2", "name": "Google Drive", "icon": "../gdrive.png", "used": "2000GB", "total": "4000GB"}
],
"storage": {
"used": "30000 GB",
"total": "500000 GB"
}
}

Files

GET /files
Response:
{
"name": "Abhishek Verma",
"profile_picture": "Picture CDN URL",
"email": "abhishek@verma.com",
"files": [
{"name": "AbhishekVerma.png", "type": "file", "src": [{"name": "AbhishekVerma.png.part1", "drive": "2", "src_id": "1WCzNNr55rVWCsm_wIfsEGr4R1n1tZGaq"}], "size": "20MB"},
{"name": "AbhishekVerma.png", "type": "file", "src": [{"name": "AbhishekVerma.png.part1", "drive": "2", "src_id": "1WCzNNr55rVWCsm_wIfsEGr4R1n1tZGaq"}], "size": "20MB"},
{"name": "AbhishekVerma.png", "type": "file", "src": [{"name": "AbhishekVerma.png.part1", "drive": "2", "src_id": "1WCzNNr55rVWCsm_wIfsEGr4R1n1tZGaq"}], "size": "20MB"}
]
}

Upload File

POST /upload
Payload:
{
"file": "AbhishekVerma.png",
"folder_id": "27",
}
Response:
200
{
"file_id": "20837"
}
401
{
"message": "File Upload failed. Some error message"
}

Delete File

POST /delete-file


Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.