# AATED BACKEND APIS ## Pre-Information: 1. DEV BASE URL: http://api.aated.smartlivestocksystem.com 2. All List APIs are paginated. You can pass limit by using "**page_size**=" and you can pass the page number by using "**page**=" in the url query parameters. ### 1. Get Batch List API ```json GET /api/v1/core/public/batches HTTP/1.1 Content-Type: application/json Response: status code: 200 { "success": true, "meta_data": { "count": 5, "page_size": 10, "next": null, "previous": null }, "data": [ { "id": 1, "name": "1st Batch", "batch_number": 1, "batch_session": null }, { "id": 2, "name": "2nd Batch", "batch_number": 2, "batch_session": null }, { "id": 3, "name": "9th Batch", "batch_number": 9, "batch_session": null }, { "id": 4, "name": "10 th Batch", "batch_number": 10, "batch_session": null }, { "id": 5, "name": "11th Batch", "batch_number": 11, "batch_session": null } ] } ``` ### 2. Sign Up API ```json POST /api/v1/users/sign-up/ HTTP/1.1 Content-Type: application/json Request Body: { "email": "shafik.te@gmail.com", "name": "MSI Shafik", "phone": "01740999768", "password": "shafik123", "batch": 4 [this is the **id** from the batch list API] } Response: status code: 200 { "success": true, "message": "OTP has been sent to your email", "data": null } ``` ### 3. Verify OTP API ```json POST /:8000/api/v1/users/sign-up/ HTTP/1.1 Content-Type: application/json Request Body: { "email": "shafik.te@gmail.com", "otp": 265796 } Response: status code: 200 { "success": true, "message": "Your OTP has been confirmed!", "data": null } ``` ### 4. Get Token API ```json POST /api/v1/users/token/ HTTP/1.1 Content-Type: application/json Request Body: { "username": "shafik.te@gmail.com", "password": "shafik123" } Response: status code: 200 { "success": true, "message": "Status OK", "data": { "refresh": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoicmVmcmVzaCIsImV4cCI6MTY4MDE4NzM0MSwiaWF0IjoxNjc3NTk1MzQxLCJqdGkiOiI4NjYwY2FmOTFmMjg0YWUxOTZhYjU2ZGUzMmQ2OWJmNCIsInVzZXJfaWQiOjIsIm5hbWUiOiJNU0kgU2hhZmlrIn0.RG-7AMuzeTAvwEUBDY2Dcw9yn3wE8cqbLuITwB3CYPk", "access": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNjc3NjMxMzQxLCJpYXQiOjE2Nzc1OTUzNDEsImp0aSI6IjNjZTcyMDU0NTk0NzQyZjU4NDA2MDFjYzZmMTUyMTBkIiwidXNlcl9pZCI6MiwibmFtZSI6Ik1TSSBTaGFmaWsifQ.yhbA-IvfL5JgNE1E-v6e9dZAN2d1L_iqC11qUabM4hA", "role": null | member| moderator| admin } } ``` ### 5. Forgot Password API ```json POST /api/v1/users/forgot-password/ HTTP/1.1 Content-Type: application/json Request Body: { "email": "shafik.te@gmail.com" } Response: status code: 200 { "success": true, "message": "OTP has been sent to your email", "data": null } ``` ### 6. Forgot Password OTP submit API By this API you need to set the new password with the OTP and email address. ```json POST /api/v1/users/forgot-password/ HTTP/1.1 Content-Type: application/json Request Body: { "email": "shafik.te@gmail.com", "otp": "108292", "password": "shafik1234" } Response: { "success": true, "message": "Your password has been reset!", "data": null } ``` ### 7. Attachment (Profile Pic/Photo/File ) upload API To upload any attachment, you need to call this API with multi-part form. - To upload profile pic you need to use "**profile_pic**" key - To upload any other photo, you need to use "**photo**" key - To upload any other file, you need to use "**file**" key ```json POST /api/v1/core/upload/ Response: { "success": true, "message": "Created", "data": { "attachment_url": "/media/images/88e1748f-f59a-4cad-91e0-59d811f40df0_htec.jpeg" } } ``` ### 8. Occupation Type List API ```json GET /api/v1/core/public/occupations/ HTTP/1.1 Content-Type: application/json Response: { "success": true, "meta_data": { "count": 6, "page_size": 10, "next": null, "previous": null }, "data": [ { "id": 1, "name": "Corporate Job" }, { "id": 2, "name": "Govt. Job" }, { "id": 3, "name": "Faculty Member" }, { "id": 4, "name": "Business" }, { "id": 5, "name": "Industry Job" }, { "id": 6, "name": "Others" } ] } ``` ### 9. Job Department List API ```json GET /api/v1/core/public/job-departments/ HTTP/1.1 Content-Type: application/json Response: { "success": true, "meta_data": { "count": 14, "page_size": 10, "next": 2, "previous": null }, "data": [ { "id": 1, "name": "Yarn" }, { "id": 2, "name": "Fabric (Woven)" }, { "id": 3, "name": "Knit Dyeing" }, { "id": 4, "name": "Finishing" }, { "id": 5, "name": "Fabric R&D" }, { "id": 6, "name": "Fabric Production" }, { "id": 7, "name": "IE" }, { "id": 8, "name": "Apparel Production" }, { "id": 9, "name": "Merchandising" }, { "id": 10, "name": "Fabric (Knit)" } ] } ``` # 10. Own Basic Profile API By this API user will get his basic information which needs to updated. [**Email can't be updated**] ```json GET /api/v1/profiles/personal/profile/ HTTP/1.1 Content-Type: application/json Authorization: Bearer <token> Response: { "success": true, "message": "Status OK", "data": { "id": 4, "name": "MSI Shafik", "email": "shafik.te@gmail.com", "phone": "01740999768", "batch": { "id": 1, "name": "1st Batch", "batch_number": 1 }, "profile_pic": null, "current_designation": null, "employment_status": null, "occupation_type": null, "unemployment_reasons": null, "student_id": null, "passing_year": null, "expertise_area": null, "contact_details": null } } ``` ### 11. Own Basic Profile Update API User can update any single field. So, pass those fields only which needs to be updated ```json POST /api/v1/profiles/personal/profile/ HTTP/1.1 Content-Type: application/json Authorization: Bearer <token> Request Body: { "name": "MSI Shafik 2", "phone": "01740999768", "batch": 1, "profile_pic": "/media/images/39d9591f-c58f-4603-8da3-6026ba43f786_htec.jpeg", "current_designation": "Sr. Software Engineer", "employment_status": "employed", "occupation_type": 1, "unemployment_reasons": null, "student_id": "135009", "passing_year": 2019, "expertise_area": "python, django, fastapi, go, javascript, docker, kubernetes, aws, nginx, elasticsearch", "contact_details": "Mirpur, Dhaka" } Response: { "success": true, "message": "Status OK", "data": { "id": 5, "name": "MSI Shafik 2", "email": "shafik.te@gmail.com", "phone": "01740999768", "batch": { "id": 1, "name": "1st", "batch_number": 1 }, "profile_pic": "http://localhost:8000/media/images/39d9591f-c58f-4603-8da3-6026ba43f786_htec.jpeg", "current_designation": "Sr. Software Engineer", "employment_status": "employed", "occupation_type": 1, "unemployment_reasons": null, "student_id": "135009", "passing_year": 2019, "expertise_area": "python, django, fastapi, go, javascript, docker, kubernetes, aws, nginx, elasticsearch", "contact_details": "Mirpur, Dhaka" } } ``` ### 12. Get Own Job Experiences API ```json GET /api/v1/profiles/personal/experiences/ HTTP/1.1 Content-Type: application/json Authorization: Bearer <token> Response: { "success": true, "meta_data": { "count": 2, "page_size": 10, "next": null, "previous": null }, "data": [ { "id": 2, "designation": "Manager GM", "company_name": "XYZ", "start": "2022-01-05", "end": null, "working_years": 1.0, "job_location": "Gulsan-1, Dhaka", "job_department": 1, "responsibilities": "Manage People, Manage product" }, { "id": 1, "designation": "Manager", "company_name": "XYZ", "start": "2020-01-05", "end": null, "working_years": 3.5, "job_location": "Gulsan-1, Dhaka", "job_department": 1, "responsibilities": "Manage People, Manage product" } ] } ``` ### 13. Create Work Exp. API ```json POST /api/v1/profiles/personal/experiences/ HTTP/1.1 Content-Type: application/json Authorization: Bearer <token> Requset Body: { "designation": "Manager GM", "company_name": "XYZ", "start": "2022-01-05", "working_years": 1, "job_location": "Gulsan-1, Dhaka", "job_department": 1, "responsibilities": "Manage People, Manage product" } # expecting rich text editor Response: { "success": true, "message": "Created", "data": { "id": 2, "is_active": true, "created_at": "2023-03-01T07:47:34.220478+06:00", "updated_at": "2023-03-01T07:47:34.220485+06:00", "created_by": {}, "updated_by": {}, "designation": "Manager GM", "company_name": "XYZ", "start": "2022-01-05", "end": null, "working_years": 1.0, "job_location": "Gulsan-1, Dhaka", "responsibilities": "Manage People, Manage product", "user": 5, "job_department": 1 } } ``` ### 14. Update Work Exp. API Just pass those fields which will be updated. ```json PATCH /api/v1/profiles/personal/experiences/1/ HTTP/1.1 Content-Type: application/json Authorization: Bearer <token> { "designation": "Manager", "company_name": "XYZ", "start": "2020-01-10", "working_years": 3.5, "job_location": "Gulsan-1, Dhaka", "job_department": 1, "responsibilities": "Manage People, Manage product" } Response: { "success": true, "message": "Status OK", "data": { "id": 1, "is_active": true, "created_at": "2023-03-01T07:39:16.459467+06:00", "updated_at": "2023-03-01T07:48:51.222186+06:00", "created_by": {}, "updated_by": {}, "designation": "Manager", "company_name": "XYZ", "start": "2020-01-10", "end": null, "working_years": 3.5, "job_location": "Gulsan-1, Dhaka", "responsibilities": "Manage People, Manage product", "user": 5, "job_department": 1 } } ``` N.B. To delete work exp. just pass {"is_active": false} with PATCH request.