-
Notifications
You must be signed in to change notification settings - Fork 3
API Endpoint Documentation
* BELOW YOU CAN FIND AS TEXT FORMAT, BUT FROM HERE A HTML FORMAT
Help on module rest_api.register.register in rest_api.register:
NAME rest_api.register.register - Created on MAY 16, 2020
DESCRIPTION
This script controls the registration api of PLATON_API, using django&mysql backend.
http://localhost:8000/api/register/
'GET':
Produces error
'POST':
Gets dictionary from body.
JSON Format : { 'name': "", string, Name parameter given by user
'surname': "", string, Surname parameter given by user
'password1': "", string, Password1 given by user
'password2':"", string, Password2 given by user to check whether Password1 is matched.
'e_mail':"", string, Email parameter given by user
'about_me':"", string, About me parameter given by user
'job_id':"", int, job id parameter chosen by user
'forget_password_ans':"", string, forget password answer parameter given by user
'field_of_study':"" } string, field of study parameter given by user
@author: Burak Omur, darktheorys
@company: Group7
FUNCTIONS
isValid(name, surname, password1, password2, email, about_me, job_id, forget_pw_ans, field_of_study)
where 'name': string, Name parameter given by user
where 'surname': string, Surname parameter given by user
where 'password1': string, Password1 given by user
where 'password2': string, Password2 given by user to check whether Password1 is matched.
where 'email': string, Email parameter given by user
where 'about_me': string, About me parameter given by user
where 'job_id': string, job id parameter chosen by user
where 'forget_pw_ans': string, forget password answer parameter given by user
where 'field_of_study': string, field of study parameter given by user
returns True if given values appropriate to insert in database, else False
This function takes input parameters and checks them if they are valid and return the boolean result.
register_api(response)
where 'response': HttpResponse, Name parameter given by user
returns Json object if 'GET' requested else nothing
This function takes Httpresponse object and if 'POST' request used, it inserts into database
register_form(response)
where 'response': HttpResponse, Name parameter given by user
returns redirection to another url, or renders a from page
This function takes Httpresponse object and if 'POST' request used, it sends the "post" request to a pre-known url to this given HttpResponse object
This module makes a search in the registered users of the platform. You can give a search string and filters about the job and field of study of the user that you want to find. Also, a sorting criteria can be given as parameter. It searches and finds a list of users according to your criteria.
This endpoint has no POST request. So if you send a post request it will give an error. The output is the following:
{
"detail": "Method \"POST\" not allowed."
}
GET request parameters:
{
token = "Your token will be here!!",
search_string = "The string that you want to search will be here",
filter = {"job" = "job_filter", "field_of_study" = "field_of_study_filter" },
sorting_criteria = "Sorting criteria will be here"
}
-
token
parameter is explained in the Authentication part. -
search_string
parameter can be any string that you want to search. To see all of the users give an empty string as the value of this parameter. You have to give the search_string parameter. -
filter
parameter is set of filters in the system.job
can be any job in our system.field_of_study
can be any string.filter
parameter and its subparameters are not obligatory parameters. If you don' give this as a parameter system makes a search without filtering. -
sorting_criteria
is the sorting criteria of the result list. If any parameter is given the default sorting is made according to the semantic points of the results. name_increasing, name_decreasing, surname_increasing, surname_decreasing can be given as a parameter. It sorts the result list according to the parameter given.
This module uses the tokens of the system for authentication. To use this endpoint, firstly register to the system with ../api/register/
endpoint and get a token using ../api/login/
endpoint. And give this token as an input to the request as:
{
token = "Your token will be here!!"
}
[
{
"name": "Test1",
"surname": "Test1",
"e-mail": "[email protected]",
"about_me": "I am a test user and I will be deleted when API is deployed!!",
"job": "Student",
"field_of_study": "Test Field1"
},
{
"name": "Test1",
"surname": "Test1",
"e-mail": "[email protected]",
"about_me": "I am a test user and I will be deleted when API is deployed!!",
"job": "Student",
"field_of_study": "Test Field1"
},
{
"name": "Test1",
"surname": "Test1",
"e-mail": "[email protected]",
"about_me": "I am a test user and I will be deleted when API is deployed!!",
"job": "Student",
"field_of_study": "Test Field1"
},
{
"name": "Test1",
"surname": "Test1",
"e-mail": "[email protected]",
"about_me": "I am a test user and I will be deleted when API is deployed!!",
"job": "Student",
"field_of_study": "Test Field1"
}
]
- Token Error:
GET http://127.0.0.1:8000/api/search/?search_string=trial&filter={"job":"student"}
"You have to give your token"
- 3rd Party API Error:
GET http://127.0.0.1:8000/api/search/?token=824514797890967718&search_string=trial
"There is a problem about an API. Please try again!!"
- Input Error:
GET http://127.0.0.1:8000/api/search/?token=824514797890967718&search_string=trial&filter={"job":"dent"}
"Wrong input. Please give an appropriate input!!"
- Requirements
- Workspace Creation Scenario
- Application to a Workspace Scenario
- Follow Mechanism Scenario
- Design Documents
- Plan Documents
- Milestone Reports
- API Documentation
- Manuals
- Burak Ömür
- Halil Umut Özdemir
- Hasan Ramazan Yurt
- Öykü Yılmaz (Communicator)
- Ahmet Dadak
- Ertuğrul Bülbül
- Alperen Divriklioğlu
- Burhan Can Akkuş
- Hüseyin Can Bölükbaş
- Hilal Demir
- Umutcan Uvut
- Orkan Akisu
- Frontend Meeting #7 (19.01.2021)
- Frontend Meeting #6 (12.01.2021)
- Android Meeting #5 (08.01.2021)
- Frontend Meeting #5 (05.01.2021)
- Backend Meeting #6 (30.12.2020)
- Meeting #26 (29.12.2020)
- Meeting #25 (28.12.2020)
- Backend Meeting #5 (23.12.2020)
- Frontend Meeting #4 (21.12.2020)
- Android Meeting #4 (18.12.2020)
- Backend Meeting #4 (16.12.2020)
- Meeting #24 (15.12.2020)
- Meeting #23 (09.12.2020)
- Frontend Meeting #3 (10.12.2020)
- Android Meeting #3 (09.12.2020)
- Backend Meeting #3 (09.12.2020)
- Frontend Meeting #2 (08.12.2020)
- Android Meeting #2 (07.12.2020)
- Frontend Meeting #1 (03.12.2020)
- Android Meeting #1 (02.12.2020)
- Backend Meeting #2 (02.12.2020)
- Meeting #22 (25.11.2020)
- Meeting #21 (21.11.2020)
- Backend Meeting #1 (18.11.2020)
- Meeting #20 (17.11.2020)
- Meeting #19 (10.11.2020)
- Meeting #18 (30.10.2020)
- Meeting #17 (27.10.2020)
- Meeting #16 (24.05.2020)
- Meeting #15 (13.05.2020)
- Meeting #14 (10.05.2020)
- Meeting #13 (07.05.2020)
- Meeting #12 (30.04.2020)
- Meeting #11 (23.04.2020)
- Meeting #10 (17.04.2020)
- Meeting #9 (16.04.2020)
- Meeting #8 (09.04.2020)
- Meeting #7 (22.03.2020)
- Meeting #6 (12.03.2020)
- Meeting #5 (05.03.2020)
- Meeting #4 (28.02.2020)
- Customer Meeting #1 (28.02.2020)
- Meeting #3 (27.02.2020)
- Meeting #2 (20.02.2020)
- Meeting #1 (13.02.2020)
- Meeting Notes Template