Documentation
Xseed Academy V1.0
Introduction
- Created on: 07 July 2021
- Backend: Laravel 8.57(current) (start with (8.49) )
- Frontend: Angular
Http Code
- 200 - (OK) REST API successfully carried out
- 201 (Created) The request has been fulfilled and new resource being created.
- 202 (Accepted) It indicates that the request has been accepted for processing, but the processing has not been completed
- 204 (No Content) This code means that the server has successfully processed the request, but is not going to return any content.
- 400 (Bad Request) Errors can be like malformed request syntax, invalid request message parameters, or deceptive request routing etc.
- 401 (Unauthorized) Protected resource without providing the proper authorization
- 403 (Forbidden) User does not have the necessary permissions for the resource
- 404 (Not Found) REST API can’t map the client’s URI
- 405 (Method Not Allowed) The client tried to use an HTTP method that the resource does not allow
- 406 (Not Acceptable) API is not able to generate any of the client’s preferred media types, as indicated by the Accept request header. For example, a client request for data formatted as application/xml will receive a 406 response if the API is only willing to format data as application/json.
- 408 Request Timeout
- 422 Unprocessable Entity(Validation error)
- 500 Internal Server Error
Configuration
Step 1: Migrate tables to database
php artisan migrate --seed
OR
php artisan migrate:fresh --seed
Step 2: Install passport
php artisan passport:install
Only clear the cache: php artisan config:clear and php artisan cache:clear.
Header
- Bearer Token : (required after login)
- Accept : application/json
Apis
We've used the following apis as listed.Click on Api to copy.
| Process | Method | Api | Fields |
|---|---|---|---|
| Http code check | POST | https://api.testpal.com.au/api/v1/http/{code} | |
| Login user | POST | https://api.testpal.com.au/api/v1/login | username,password,role_id |
| Logout user | POST | https://api.testpal.com.au/api/v1/logout | |
| Create a category | POST | https://api.testpal.com.au/api/v1/category | category_name |
| Fetch all categories | GET | https://api.testpal.com.au/api/v1/category | |
| Fetch a category | GET | https://api.testpal.com.au/api/v1/category/{slug} | |
| Update a category | PUT | https://api.testpal.com.au/api/v1/category/{slug} | category_name,active |
| Delete a category | DELETE | https://api.testpal.com.au/api/v1/category/{slug} | |
| Create a subject | POST | https://api.testpal.com.au/api/v1/subject | category_id,subject_name,description |
| Fetch all subjects | GET | https://api.testpal.com.au/api/v1/subject | |
| Fetch a subject | GET | https://api.testpal.com.au/api/v1/subject/{slug} | |
| Update a subject | PUT | https://api.testpal.com.au/api/v1/subject | category_id,subject_name,description,active |
| Delete a subject | DELETE | https://api.testpal.com.au/api/v1/subject/{slug} | |
| Create a topic | POST | https://api.testpal.com.au/api/v1/topic | subject_id,label |
| Fetch all topic | GET | https://api.testpal.com.au/api/v1/topic | |
| Fetch a topic | GET | https://api.testpal.com.au/api/v1/topic/{slug} | |
| Update a topic | PUT | https://api.testpal.com.au/api/v1/topic/{slug} | subject_id,label,active |
| Delete a topic | DELETE | https://api.testpal.com.au/api/v1/topic/{slug} | |
| Create a sub topic | POST | https://api.testpal.com.au/api/v1/subtopic | topic_id,sub_topic |
| Fetch all sub topics | GET | https://api.testpal.com.au/api/v1/subtopic | |
| Fetch a sub topic | GET | https://api.testpal.com.au/api/v1/subtopic/{slug} | |
| Update a sub topic | PUT | https://api.testpal.com.au/api/v1/subtopic/{slug} | topic_id,sub_topic,active |
| Delete a sub topic | DELETE | https://api.testpal.com.au/api/v1/subtopic/{slug} | |
| Fetch all question type | GET | https://api.testpal.com.au/api/v1/question_type | |
| Create a test | POST | https://api.testpal.com.au/api/v1/test | title,description,subject_id, test_type_id,duration,right_answer_mark, wrong_answer_mark,unattempt_mark_answer,paid |
| Fetch all test | GET | https://api.testpal.com.au/api/v1/test | |
| Fetch a test | GET | https://api.testpal.com.au/api/v1/test/{slug} | |
| Delete a test | DELETE | https://api.testpal.com.au/api/v1/test/{slug} | |
| Update a test | POST | https://api.testpal.com.au/api/v1/test/{slug} | title,description,subject_id, test_type_id,duration,right_answer_mark, wrong_answer_mark,unattempt_mark_answer,paid,active |
| Fetch all product type | GET | https://api.testpal.com.au/api/v1/product_type | |
| Fetch all test type | GET | https://api.testpal.com.au/api/v1/test_type | |
| Fetch all test mode | GET | https://api.testpal.com.au/api/v1/test_mode | |
| Fetch all product mode | GET | https://api.testpal.com.au/api/v1/product_mode | |
| Create a product | POST | https://api.testpal.com.au/api/v1/product | title,description,duration,price,category_id, product_details['product_type_id','test_or_service_id'] |
| Fetch all product | GET | https://api.testpal.com.au/api/v1/product | |
| Update a product | PUT | https://api.testpal.com.au/api/v1/product/{slug} | title,description,duration,price,category_id, product_details['product_type_id','test_or_service_id'] |
| Fetch a product | GET | https://api.testpal.com.au/api/v1/product/{slug} | |
| Delete a product | DELETE | https://api.testpal.com.au/api/v1/product/{slug} | |
| Create passage | POST | https://api.testpal.com.au/api/v1/passage | passage |
| Fetch all passages | GET | https://api.testpal.com.au/api/v1/passage | |
| Fetch a passage | GET | https://api.testpal.com.au/api/v1/passage/{slug} | |
| Delete a passage | DELETE | https://api.testpal.com.au/api/v1/passage/{slug} | |
| Update a passage | PUT | https://api.testpal.com.au/api/v1/passage | passage |
| Create question | POST | https://api.testpal.com.au/api/v1/question | passage_status,passage_id,test_id, topic_id, sub_topic_id,question,complexity, options[option,option_image,is_answer,order], solution,reference,remarks,image,solution_image |
| Fetch all questions | GET | https://api.testpal.com.au/api/v1/question | |
| Fetch a question | GET | https://api.testpal.com.au/api/v1/question/{slug} | |
| Delete a question | DELETE | https://api.testpal.com.au/api/v1/question/{slug} | |
| Update a question | PUT | https://api.testpal.com.au/api/v1/question/{slug} | passage_status,passage_id,test_id, topic_id, sub_topic_id,question,complexity, solution,reference,remarks,image,solution_image |
| Fetch all question under test | GET | https://api.testpal.com.au/api/v1/question/test/{test_slug} | |
| Fetch all question with or without passage | GET | https://api.testpal.com.au/api/v1/question/passage/{yes|no} | |
| Update option Updated | POST | https://api.testpal.com.au/api/v1/update/option/{option_slug} | option,option_image(optional),order,is_answer |
| Update product order | POST | https://api.testpal.com.au/api/v1/product_order_change | products['slug','order'] |
| Upload question | POST | https://api.testpal.com.au/api/v1/upload/question | excel,image |
| Create option New | POST | https://api.testpal.com.au/api/v1/option | question_id,option,option_image(optional),order,is_answer |
| Delete option New | DELETE | https://api.testpal.com.au/api/v1/option/{slug} | |
| Update question | POST | https://api.testpal.com.au/api/v1/update/question/{slug} | passage_status,passage_id,test_id, topic_id, sub_topic_id,question,complexity, solution,reference,remarks,image,solution_image |
| Parent/teacher signup | POST | https://api.testpal.com.au/api/v1/parent/registration | email_verified,role_id,parent_name,mobile_number,email, parent_password,student_name,student_password, student_username,student_grade |
| Create news | POST | https://api.testpal.com.au/api/v1/news | title,image,content |
| Update news | POST | https://api.testpal.com.au/api/v1/news/{slug} | title,image,content |
| Fetch all news | GET | https://api.testpal.com.au/api/v1/news | |
| Delete news | DELETE | https://api.testpal.com.au/api/v1/news/{slug} | |
| Create and update about | POST | https://api.testpal.com.au/api/v1/about | title,content |
| Fetch about | GET | https://api.testpal.com.au/api/v1/about |
Front-End APIs
Demo admin
- username : admin@xseed.com
- password : admin@xseed.com