These are all the endpoints that will be included in this backend project.
The endpoints are divided into 5 categories:
- Auth Endpoints ('/')
- User Endpoints ('/user')
- Project Endpoints ('/project')
- Form Endpoints ('/form')
- Form Submission Endpoints ('/main')
A successful response from the server will look like this:
{
"status": "Ok",
"message": "Message for the developer",
"data": {
"All the data from server will be here"
}
}
An error response from the server will look like this:
{
"status": "error",
"error": "Error Message for the developer",
}
The following properties of every endpoint will be descibed in this file:
- Method: GET | POST | PATCH | DELETE
- Authorized: (Authentication is required or not for this route) True | False
- Verified: (Account with Email verified is required or not for this route) True | False
- Request Parameters: (Requet-Body to be sent along with the request, for POST | PATCH | DELETE methods)
- Query Parameters: (Query Parameters available in GET requests to manipulate the response from the server)
- Success Status Code: (Status Code of a successful response) 2xx
- Response Data: (The format of data which is expected from the server with a successful response)
Base URI:
/
- Method: POST
- Authorized: False
- Verified: False
- Request Parameters:
{
"email": "test@test.com",
"password": "mY-pAsSwOrD",
"recaptcha_token": "Google Recaptcha Token recieved from Google"
}
- Success Status Code: 200
- Response Data:
{
"name": "User Name",
"email": "test@test.com",
"verfied": true,
"secret": "JWT Token"
}
- Method: POST
- Authorized: False
- Verified: False
- Request Parameters:
{
"name": "User Name"
"email": "test@test.com",
"password": "mY-pAsSwOrD",
"recaptcha_token": "Google Recaptcha Token recieved from Google"
}
- Success Status Code: 201
- Response Data:
{
"name": "User Name",
"email": "test@test.com",
"verfied": false,
"secret": "JWT Token"
}
- Method: GET
- Authorized: False
- Verified: False
- Success Status Code: 200
- Response Data:
{
"url": "Google OAuth URL"
}
- Method: POST
- Authorized: False
- Verified: False
- Request Parameters:
{
"token": "Google Auth Token recieved from Google"
}
- Success Status Code: 200/201
- Response Data:
{
"name": "User Name",
"email": "test@test.com",
"verfied": true,
"secret": "JWT Token"
}
Base URI:
/user
- Method: GET
- Authorized: True
- Verified: False
- Success Status Code: 200
- Response Data:
Null
- Method: GET
- Authorized: False
- Verified: False
- Success Status Code: 200
- Response Data:
Null
- Method: PATCH
- Authorized: True
- Verified: True
- Request Parameters:
{
"name": "User Name",
"email": "test@test.com",
"password": "older One",
"recaptcha_token": "Google Recaptcha Token recieved from Google"
}
- Success Status Code: 200
- Response Data:
{
"name": "User Name",
"email": "test@test.com"
}
- Method: PATCH
- Authorized: True
- Verified: False
- Request Parameters:
{
"oldPassword": "older One",
"newPassword": "newer One",
"recaptcha_token": "Google Recaptcha Token recieved from Google"
}
- Success Status Code: 200
- Response Data:
Null
- Method: GET
- Authorized: True
- Verified: True
- Success Status Code: 200
- Response Data:
{
"name": "User's name",
"email": "test@test.com",
"verified": true,
"project_count": 2,
"projects":[
{
"id": "Project Id"
"name": "Project Name",
"form_count": 5,
"allowed_origins": ["http://localhost", "https://savemyform.in.net"],
"date_created": "date-of-creation"
}
]
}
- Method: GET
- Authorized: True
- Verified: False
- Success Status Code: 200
- Response Data:
{
"name": "User's name",
"email": "test@test.com",
"verified": true
}
Base URI:
/project
- Method: POST
- Authorized: True
- Verified: True
- Request Parameters:
{
"name": "Project Name",
"hasRecaptcha": true,
"recaptchaKey": "User's project Recaptcha Key",
"recaptchaSecret": "User's project Recaptcha Secret",
"allowedOrigins": ["http://localhost", "https://savemyform.in.net"],
"collaborators": ["test1@test.com", "test2@test.com"],
"recaptcha_token": "Google Recaptcha Token recieved from Google"
}
- Success Status Code: 201
- Response Data:
{
"id": "project's id",
"name": "project's name"
}
- Method: GET
- Authorized: True
- Verified: True
- Success Status Code: 200
- Response Data:
{
"id": "Project ID",
"name": "Project's name",
"is_owner": true,
"owner":{
"name": "Owner Name",
"email": "owner@test.com"
},
"collaborators": [
{
"name": "Collab 1",
"email": "test1@test.com"
}
],
"hasRecaptcha": true,
"recaptchaKey": "User's project Recaptcha Key",
"recaptchaSecret": "User's project Recaptcha Secret",
"allowedOrigins": ["http://localhost", "https://savemyform.in.net"],
"form_count": 2,
"forms":[
{
"name": "Form Name",
"submission_count": 5,
"last_updated": "date-of-last-submission",
"date_created": "date-of-creation"
}
]
}
- Method: PATCH
- Authorized: True
- Verified: True
- Request Parameters:
{
"name": "Project Name",
"hasRecaptcha": true,
"recaptchaKey": "User's project Recaptcha Key",
"recaptchaSecret": "User's project Recaptcha Secret",
"allowedOrigins": ["http://localhost", "https://savemyform.in.net"],
"collaborators": ["test1@test.com", "test2@test.com"],
"recaptcha_token": "Google Recaptcha Token recieved from Google",
"password": "user's password"
}
- Success Status Code: 200
- Response Data:
{
"id": "Project ID"
"name": "Project's name",
"is_owner": true,
"owner":{
"name": "Owner Name",
"email": "owner@test.com"
},
"collaborators": [
{
"name": "Collab 1",
"email": "test1@test.com"
}
],
"hasRecaptcha": true,
"recaptchaKey": "User's project Recaptcha Key",
"recaptchaSecret": "User's project Recaptcha Secret",
"allowedOrigins": ["http://localhost", "https://savemyform.in.net"],
}
- Method: DELETE
- Authorized: True
- Verified: True
- Request Parameters:
{
"recaptcha_token": "Google Recaptcha Token recieved from Google",
"password": "user's password"
}
- Success Status Code: 200
- Response Data:
Null
Base URI:
/form
- Method: POST
- Authorized: True
- Verified: True
- Request Parameters:
{
"name": "Form Name",
"hasRecaptcha": true,
"hasFileField": false,
"schema": {"schema": "object"}
"recaptcha_token": "Google Recaptcha Token recieved from Google"
}
- Success Status Code: 201
- Response Data:
{
"id": "form's id",
"name": "form's name"
}
- Method: GET
- Authorized: True
- Verified: True
- Query Parameters:
{
"sort": "ascending/descending",
"page": 5,
"perpage": 10
}
- Success Status Code: 200
- Response Data:
{
"id": "Form's ID"
"name": "Form's name",
"is_owner": true,
"owner":{
"name": "Owner Name",
"email": "owner@test.com"
},
"hasRecaptcha": true,
"submissions":{
"total": 999,
"page": 2,
"per_page": 10,
"has_next_page": true,
"has_prev_page": true,
"total_pages": 100,
"data":[
{
"id": "Submission ID",
"data": {"submitted": "data"},
"file": "link to file",
"date_created": "date-of-creation"
}
]
}
}
- Method: PATCH
- Authorized: True
- Verified: True
- Request Parameters:
{
"name": "Form Name",
"hasRecaptcha": true,
"hasFileField": false,
"schema": {"schema": "object"}
"password": "user's password",
"recaptcha_token": "Google Recaptcha Token recieved from Google"
}
- Success Status Code: 200
- Response Data:
{
"id": "Form's Id"
"name": "Form's name",
"is_owner": true,
"owner":{
"name": "Owner Name",
"email": "owner@test.com"
},
"hasRecaptcha": true
}
- Method: DELETE
- Authorized: True
- Verified: True
- Request Parameters:
{
"recaptcha_token": "Google Recaptcha Token recieved from Google",
"password": "user's password"
}
- Success Status Code: 200
- Response Data:
Null