# DOT APIs
BASE URL (DEV): http://192.53.112.20
## Attachment API
Hint: By this API any user can upload any document (only pdf is allowed) and upload signature image
```json
POST /api/v1/applications/upload-attachment/ HTTP/1.1
Content-Type: multipart/form-data;
Authorization: jwt <token>
if document upload then the form key name will be "file"
if signature upload then the form key name will be "signature"
Response:
{
"success": true,
"message": "Created",
"data": {
"attachment_url": "/media/images/921abfe0-ff39-4274-9005-3dc7e9066c9c_sig-4.png"
}
}
```
## Authentication Related
### 1. Token/Login API
```json
POST /api/v1/users/token/ HTTP/1.1
Request Body:
{
"username": "admin_1",
"password": "admin_1"
}
Response:
status code: 200
{
"success": true,
"message": "Status OK",
"data": {
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjo0LCJ1c2VybmFtZSI6ImFkbWluXzEiLCJleHAiOjE2NTc5OTQ0ODgsImVtYWlsIjoiYWRtaW4xQGdtYWlsLmNvbSIsIm9yaWdfaWF0IjoxNjU3OTk0MTg4fQ.HFN9yVLMyVcm9Uw1BVpT4erZqkmeOpcjIrgtWXlQVJw"
"role": "admin"/ "staff" / "officer"
}
}
```
## End User Related API
### 1. Get Service List API
```json
GET /api/v1/applications/service/ HTTP/1.1
#Open API no need to add authorization token
Response:
{
"success": true,
"meta_data": {
"count": 2,
"page_size": 10,
"next": null,
"previous": null
},
"data": [
{
"id": 2,
"name": "Machine Approval Application",
"key": "machine_approval"
},
{
"id": 1,
"name": "Buying House Registration",
"key": "buying_house"
}
]
}
```
### 2. Create Application Form
```json
POST /api/v1/applications/user/application/ HTTP/1.1
Authorization: jwt <token>
Request Body:
{
"name": "GK Traders", # this name also be included inside application_form rich text
"service": 1,
"application_form": "<Rich Text Form Here>"
}
Response:
status code: 201
{
"success": true,
"message": "Created",
"data": {
"id": 5,
"name": "GK Traders",
"service": 1,
"application_form": "<Rich Text Form Here>",
"applied_by": 2
}
}
```
### 3. Get Own Application List
```json
GET /api/v1/applications/user/application/ HTTP/1.1
Authorization: jwt <token>
Response:
status code: 200
{
"success": true,
"meta_data": {
"count": 1,
"page_size": 10,
"next": null,
"previous": null
},
"data": [
{
"id": 3,
"name": "shafik",
"service": {
"id": 1,
"name": "Buying House Registration"
},
"application_form": "<Rich Text Form Here>",
"application_status": "pending",
"reject_reasons": null,
"issue_number": null,
"created_at": "2022-07-16T13:35:30.321102+06:00",
"approved_at": null
}
]
}
```
### 04. User Sign Up API
Hint: By this API user will sign up for the service
```json
POST /api/v1/users/sign-up/ HTTP/1.1
Request Body:
{
"name": "MSI Shafik",
"email": "shafik.te@gmail.com",
"password": "shafik",
"designation": "GM",
"phone": "01740999768"
}
Response:
status code = 201
{
"success": true,
"message": "OTP has been sent to your email"
}
```
### 05. User Sign Up confirmation with OTP
Hint: By this API user will confirm their email with OTP
```json
POST /api/v1/users/sign-up/ HTTP/1.1
Request Body:
{
"email": "shafik.te@gmail.com",
"otp": "161703"
}
Response:
status code : 200
{
"success": true,
"message": "Your OTP has been confirmed!",
"data": null
}
```
### 06. Forgot Password Request API
```json
POST /api/v1/users/forgot-password/ HTTP/1.1
Request Body:
{
"email": "shafik.te@gmail.com"
}
Response:
{
"success": true,
"message": "OTP has been sent to your email"
}
```
### 07. Forgot Password OTP confirmed API
```json
POST /api/v1/users/forgot-password/ HTTP/1.1
Request Body:
{
"email": "shafik.te@gmail.com",
"password": "shafik",
"otp": "065016"
}
Response:
{
"success": true,
"message": "Your password has been reset!",
"data": null
}
```
## Admin/Officer/Staff Related APIs
### 1. Use Create API
Hint: By this API admin will create new admin/staff/officer
```json
POST /api/v1/users/manage/ HTTP/1.1
Authorization: jwt <token>
Request Body:
{
"name": "MSI Shafik",
"name_bn": "এম এস আই শফিক",
"designation": "Deputy Director",
"designation_bn": "ডেপুটি ডিরেক্টর",
"email": "shafik.tx@gmail.com",
"phone": "01740999768",
"password": "123456789",
# permission related
"is_office_staff": false, # staff role
"is_admin": false, # admin role
"is_staff": true # officer role
"signature_url": "/media/images/760118a3-db22-4c05-9a5d-5a518bcbeb50_sig-4.png"
}
Response:
status code: 201
Response:
{
"success": true,
"message": "Created",
"data": {
"id": 4,
"username": "shafik.tx@gmail.com",
"name": "MSI Shafik",
"name_bn": "এম এস আই শফিক",
"email": "shafik.tx@gmail.com",
"phone": "01740999768",
"designation": "Deputy Director",
"designation_bn": "ডেপুটি ডিরেক্টর",
"signature_url": "/media/images/760118a3-db22-4c05-9a5d-5a518bcbeb50_sig-4.png",
"permitted_all_section": false,
"is_office_staff": false,
"is_admin": false,
"is_active": true
}
}
```
### 3. User information Update API
Hint: Admin can update user information
```json
PATCH /api/v1/users/manage/<id>/ HTTP/1.1
Authorization: jwt <token>
Request Body:
{
"name": "MSI Shafik 2" # any field can be updated
}
if need to deactive then use "is_active":"false"
Response:
status code: 200
{
"success": true,
"message": "Created",
"data": {
"id": 3,
"username": "shafikte@gmail.com",
"name": "MSI Shafik 2",
"name_bn": "এম এস আই শফিক",
"email": "shafikte@gmail.com",
"phone": "01740999768",
"designation": "Deputy Director",
"designation_bn": "ডেপুটি ডিরেক্টর",
"signature_url": "/media/images/760118a3-db22-4c05-9a5d-5a518bcbeb50_sig-4.png",
"permitted_all_section": false,
"is_office_staff": false,
"is_admin": false,
"is_active": true
}
}
```
### 3. User List API
Hint: By this API admin will get the all user list
```json
GET /api/v1/users/manage/ HTTP/1.1
Authorization: jwt <token>
Response:
{
"success": true,
"meta_data": {
"count": 3,
"page_size": 10,
"next": null,
"previous": null
},
"data": [
{
"id": 2,
"username": "shafik.te@gmail.com",
"name": "MSI Shafik",
"name_bn": "শফিকুল ইসলাম",
"email": "shafik.te@gmail.com",
"phone": "+8801740999768",
"designation": "Software Engineer",
"designation_bn": "সফ্টওয়্যার প্রকৌশলী",
"signature_url": "/media/images/f11d137f-49b1-406c-9335-31f67f9dd478_2021_22.jpeg",
"permitted_all_section": false,
"is_office_staff": false,
"is_active": true,
"is_admin": true
},
{
"id": 3,
"username": "shafikte@gmail.com",
"name": "MSI Shafik 2",
"name_bn": "এম এস আই শফিক",
"email": "shafikte@gmail.com",
"phone": "01740999768",
"designation": "Deputy Director",
"designation_bn": "ডেপুটি ডিরেক্টর",
"signature_url": "/media/images/760118a3-db22-4c05-9a5d-5a518bcbeb50_sig-4.png",
"permitted_all_section": false,
"is_office_staff": false,
"is_active": true,
"is_admin": false
},
{
"id": 4,
"username": "shafik.tx@gmail.com",
"name": "MSI Shafik",
"name_bn": "এম এস আই শফিক",
"email": "shafik.tx@gmail.com",
"phone": "01740999768",
"designation": "Deputy Director",
"designation_bn": "ডেপুটি ডিরেক্টর",
"signature_url": "/media/images/760118a3-db22-4c05-9a5d-5a518bcbeb50_sig-4.png",
"permitted_all_section": false,
"is_office_staff": false,
"is_active": true,
"is_admin": false
}
]
}
```
### 4. Section Create API
```json
POST /api/v1/users/section/ HTTP/1.1
Authorization: jwt <token>
Request Body:
{
"name": "Section B",
"section_head": 2 # user id
}
Response:
status code: 201
{
"success": true,
"message": "Created",
"data": {
"id": 2,
"uid": "0b706b31-d52a-46f6-a9ef-ad8b1840462a",
"created_at": "2022-07-16T15:15:55.745468+06:00",
"updated_at": "2022-07-16T15:15:55.745479+06:00",
"is_active": true,
"name": "Section B",
"section_head": 2
}
}
```
### 5. Section List API
```json
GET /api/v1/users/section/ HTTP/1.1
Authorization: jwt <token>
Query parameter:
?is_active=true
Response:
{
"success": true,
"meta_data": {
"count": 1,
"page_size": 10,
"next": null,
"previous": null
},
"data": [
{
"id": 1,
"name": "Section A",
"section_head": {
"id": 6,
"username": "officer_1",
"name": "Officer One",
"designation": "Deputy Director"
}
}
]
}
```
### 7. User Assign to Section API
Hint: By this API admin will assign user to the section
```json
POST /api/v1/users/section-user/ HTTP/1.1
Authorization: jwt <token>
Request Body:
{
"section": 1,
"user": 3
}
Response:
status code: 200
{
"success": true,
"message": "Action Success",
"data": null
}
```
### 8. User Unassign from Section API
Hint: By this API admin will unassign user from the section
```json
POST /api/v1/users/section-user/ HTTP/1.1
Authorization: jwt <token>
Request Body:
{
"section": 1,
"user": 3,
"is_active": false
}
Response:
status code: 200
{
"success": true,
"message": "Action Success",
"data": null
}
```
### 9. Section Wise User List
```json
GET /api/v1/users/section-user/?section=1 HTTP/1.1
Authorization: jwt <token>
Extra Query parameter:
is_active=true [this query parameter will be used for all portal except admin portal]
Response:
{
"success": true,
"meta_data": {
"count": 2,
"page_size": 10,
"next": null,
"previous": null
},
"data": [
{
"id": 2,
"username": "shafik.te@gmail.com",
"name": "MSI Shafik",
"designation": "Software Engineer",
"name_bn": "শফিকুল ইসলাম",
"designation_bn": "সফ্টওয়্যার প্রকৌশলী",
"is_active": true
},
{
"id": 3,
"username": "shafikte@gmail.com",
"name": "MSI Shafik 2",
"designation": "Deputy Director",
"name_bn": "এম এস আই শফিক",
"designation_bn": "ডেপুটি ডিরেক্টর",
"is_active": false
}
]
}
```
### 10. Application List API
Hint: for both admin and other officer/staff portal
```json
GET /api/v1/applications/admin/application/ HTTP/1.1
Authorization: jwt <token>
Query paramters:
?application_status=pending/processing/completed/rejected
?issue_number=20.34.433
Response:
{
"success": true,
"meta_data": {
"count": 3,
"page_size": 10,
"next": null,
"previous": null
},
"data": [
{
"id": 5,
"service": {
"id": 1,
"name": "Buying House Registration"
},
"note_signatures": [],
"letter_signature_url": null,
"assigned_section": null,
"current_assigned_user": null,
"approved_by": null,
"uid": "158ef8e6-90d6-40d7-9de6-80d7e48dc0cb",
"created_at": "2022-07-16T19:53:34.812482+06:00",
"updated_at": "2022-07-16T19:54:13.292410+06:00",
"is_active": true,
"name": "GK Traders",
"application_form": "<Rich Text Form Here>",
"section_assigned_at": null,
"assigned_at": null,
"application_status": "rejected",
"is_final_approval": false,
"approved_at": null,
"issue_number": null,
"reject_reasons": "test reasons",
"note": null,
"letter_top": null,
"letter_bottom": null,
"applied_by": 2
},
{
"id": 4,
"service": {
"id": 1,
"name": "Buying House Registration"
},
"note_signatures": [],
"letter_signature_url": null,
"assigned_section": {
"id": 1,
"name": "Section A"
},
"current_assigned_user": null,
"approved_by": null,
"uid": "f40b62a1-4c4c-4ac8-b1cd-2bf40516d1da",
"created_at": "2022-07-16T19:52:56.751583+06:00",
"updated_at": "2022-07-17T23:13:10.805606+06:00",
"is_active": true,
"name": "shafik",
"application_form": "<Rich Text Form Here>",
"section_assigned_at": "2022-07-17T23:13:10.787859+06:00",
"assigned_at": null,
"application_status": "processing",
"is_final_approval": false,
"approved_at": null,
"issue_number": null,
"reject_reasons": null,
"note": null,
"letter_top": null,
"letter_bottom": null,
"applied_by": 2
},
{
"id": 3,
"service": {
"id": 1,
"name": "Buying House Registration"
},
"note_signatures": [
"/media/images/f11d137f-49b1-406c-9335-31f67f9dd478_2021_22.jpeg",
"/media/images/f11d137f-49b1-406c-9335-31f67f9dd478_2021_22.jpeg",
"/media/images/f11d137f-49b1-406c-9335-31f67f9dd478_2021_22.jpeg",
"/media/images/f11d137f-49b1-406c-9335-31f67f9dd478_2021_22.jpeg"
],
"letter_signature_url": "/media/images/f11d137f-49b1-406c-9335-31f67f9dd478_2021_22.jpeg",
"assigned_section": {
"id": 1,
"name": "Section A"
},
"current_assigned_user": {
"id": 2,
"username": "shafik.te@gmail.com",
"name": "MSI Shafik",
"designation": "Software Engineer",
"name_bn": "শফিকুল ইসলাম",
"designation_bn": "সফ্টওয়্যার প্রকৌশলী"
},
"approved_by": {
"id": 2,
"username": "shafik.te@gmail.com",
"name": "MSI Shafik",
"designation": "Software Engineer",
"name_bn": "শফিকুল ইসলাম",
"designation_bn": "সফ্টওয়্যার প্রকৌশলী"
},
"uid": "bea47f8f-27ae-40a6-be5b-cf19c727996e",
"created_at": "2022-07-16T13:35:30.321102+06:00",
"updated_at": "2022-07-16T19:51:28.548785+06:00",
"is_active": true,
"name": "shafik",
"application_form": "<Rich Text Form Here>",
"section_assigned_at": "2022-07-16T19:38:58.929610+06:00",
"assigned_at": "2022-07-16T19:43:07.952856+06:00",
"application_status": "completed",
"is_final_approval": true,
"approved_at": "2022-07-16T19:51:28.547634+06:00",
"issue_number": "10.233.34.554.333",
"reject_reasons": null,
"note": "<rich text note>",
"letter_top": "<rich text letter top part>",
"letter_bottom": "<rich text letter bottom part>",
"applied_by": 2
}
]
}
```
### Application Details API
```json
GET /api/v1/applications/admin/application/5/ HTTP/1.1
Authorization: jwt <TOKEN>
Response:
{
"success": true,
"message": "Status OK",
"data": {
"id": 5,
"service": {
"id": 1,
"name": "Buying House Registration"
},
"note_signatures": [
"/media/images/f11d137f-49b1-406c-9335-31f67f9dd478_2021_22.jpeg"
],
"letter_signature_url": null,
"assigned_section": {
"id": 1,
"name": "Section A"
},
"current_assigned_user": {
"id": 2,
"username": "shafik.te@gmail.com",
"name": "MSI Shafik",
"designation": "Software Engineer",
"name_bn": "শফিকুল ইসলাম",
"designation_bn": "সফ্টওয়্যার প্রকৌশলী"
},
"approved_by": {
"id": 1,
"username": "admin",
"name": null,
"designation": null,
"name_bn": null,
"designation_bn": null
},
"uid": "158ef8e6-90d6-40d7-9de6-80d7e48dc0cb",
"created_at": "2022-07-16T19:53:34.812482+06:00",
"updated_at": "2022-07-17T23:30:23.450129+06:00",
"is_active": true,
"name": "GK Traders",
"application_form": "<Rich Text Form Here>",
"section_assigned_at": "2022-07-17T23:23:32.050332+06:00",
"assigned_at": "2022-07-17T23:23:43.394666+06:00",
"application_status": "completed",
"is_final_approval": true,
"approved_at": "2022-07-17T23:30:23.448924+06:00",
"issue_number": "10.233.34.554.333",
"reject_reasons": "test reasons",
"note": "<rich text note>",
"letter_top": "<rich text letter top part>",
"letter_bottom": "<rich text letter bottom part>",
"applied_by": 2
}
}
```
### 11. Application Assign to Section
Hint: By this API admin will assign section in the application
```json
PATCH /api/v1/applications/admin/application/3/ HTTP/1.1
Content-Type: application/json
Authorization: jwt <token>
{
"assigned_section": 1
}
Response:
status code: 200
{
"success": true,
"message": "Status OK",
"data": {
"id": 4,
"service": {
"id": 1,
"name": "Buying House Registration"
},
"note_signatures": [],
"letter_signature_url": null,
"assigned_section": {
"id": 1,
"name": "Section A"
},
"current_assigned_user": null,
"approved_by": null,
"uid": "f40b62a1-4c4c-4ac8-b1cd-2bf40516d1da",
"created_at": "2022-07-16T19:52:56.751583+06:00",
"updated_at": "2022-07-17T23:13:10.805606+06:00",
"is_active": true,
"name": "shafik",
"application_form": "<Rich Text Form Here>",
"section_assigned_at": "2022-07-17T23:13:10.787859+06:00",
"assigned_at": null,
"application_status": "processing",
"is_final_approval": false,
"approved_at": null,
"issue_number": null,
"reject_reasons": null,
"note": null,
"letter_top": null,
"letter_bottom": null,
"applied_by": 2
}
}
```
### 12. Application Reject API
Hint: Admin can reject the application
```json
PATCH /api/v1/applications/admin/application/5/ HTTP/1.1
Content-Type: application/json
Authorization: jwt <token>
{
"application_status": "rejected",
"reject_reasons": "test reasons"
}
Response:
status code: 200
{
"success": true,
"message": "Status OK",
"data": {
"id": 5,
"service": {
"id": 1,
"name": "Buying House Registration"
},
"note_signatures": [],
"letter_signature_url": null,
"assigned_section": null,
"current_assigned_user": null,
"approved_by": null,
"uid": "158ef8e6-90d6-40d7-9de6-80d7e48dc0cb",
"created_at": "2022-07-16T19:53:34.812482+06:00",
"updated_at": "2022-07-16T19:54:13.292410+06:00",
"is_active": true,
"name": "GK Traders",
"application_form": "<Rich Text Form Here>",
"section_assigned_at": null,
"assigned_at": null,
"application_status": "rejected",
"is_final_approval": false,
"approved_at": null,
"issue_number": null,
"reject_reasons": "test reasons",
"note": null,
"letter_top": null,
"letter_bottom": null,
"applied_by": 2
}
}
```
### 13. Application Send to Officer/staff
Hint: This API will be used from officer/staff portal to send the application to other user
```json
PATCH /api/v1/applications/admin/application/3/ HTTP/1.1
Content-Type: application/json
Authorization: jwt <token>
{
"current_assigned_user": 2 # user id
}
Response:
status code : 200
{
"success": true,
"message": "Status OK",
"data": {
"id": 3,
"service": {
"id": 1,
"name": "Buying House Registration"
},
"note_signatures": [
"/media/images/f11d137f-49b1-406c-9335-31f67f9dd478_2021_22.jpeg",
"/media/images/f11d137f-49b1-406c-9335-31f67f9dd478_2021_22.jpeg",
"/media/images/f11d137f-49b1-406c-9335-31f67f9dd478_2021_22.jpeg",
"/media/images/f11d137f-49b1-406c-9335-31f67f9dd478_2021_22.jpeg"
],
"letter_signature_url": null,
"assigned_section": {
"id": 1,
"name": "Section A"
},
"current_assigned_user": {
"id": 2,
"username": "shafik.te@gmail.com",
"name": "MSI Shafik",
"designation": "Software Engineer"
},
"uid": "bea47f8f-27ae-40a6-be5b-cf19c727996e",
"created_at": "2022-07-16T13:35:30.321102+06:00",
"updated_at": "2022-07-16T19:43:07.956918+06:00",
"is_active": true,
"name": "shafik",
"application_form": "<Rich Text Form Here>",
"section_assigned_at": "2022-07-16T19:38:58.929610+06:00",
"assigned_at": "2022-07-16T19:43:07.952856+06:00",
"application_status": "pending",
"is_final_approval": false,
"approved_at": null,
"issue_number": null,
"reject_reasons": null,
"note": null,
"letter_top": null,
"letter_bottom": null,
"applied_by": 2,
"approved_by": null
}
}
```
### 14. Add Note/Letter API
Hint: By this API note or letter or both will can be added
```json
PATCH /api/v1/applications/admin/application/3/ HTTP/1.1
Content-Type: application/json
Authorization: jwt <token>
{
"note": "<rich text note>",
"letter_top": "<rich text letter top part>",
"letter_bottom": "<rich text letter bottom part>",
"note_attachments": ["/media/documents/1.pdf"],
"letter_attachments": ["/media/documents/1.pdf"]
}
Response:
status: 200
{
"success": true,
"message": "Status OK",
"data": {
"id": 5,
"service": {
"id": 1,
"name": "Buying House Registration"
},
"note_signatures": [
"/media/images/f11d137f-49b1-406c-9335-31f67f9dd478_2021_22.jpeg"
],
"letter_signature_url": null,
"assigned_section": {
"id": 1,
"name": "Section A"
},
"current_assigned_user": {
"id": 2,
"username": "shafik.te@gmail.com",
"name": "MSI Shafik",
"designation": "Software Engineer",
"name_bn": "শফিকুল ইসলাম",
"designation_bn": "সফ্টওয়্যার প্রকৌশলী"
},
"approved_by": null,
"uid": "158ef8e6-90d6-40d7-9de6-80d7e48dc0cb",
"created_at": "2022-07-16T19:53:34.812482+06:00",
"updated_at": "2022-07-17T23:25:16.325295+06:00",
"is_active": true,
"name": "GK Traders",
"application_form": "<Rich Text Form Here>",
"section_assigned_at": "2022-07-17T23:23:32.050332+06:00",
"assigned_at": "2022-07-17T23:23:43.394666+06:00",
"application_status": "processing",
"is_final_approval": false,
"approved_at": null,
"issue_number": null,
"reject_reasons": "test reasons",
"note": "<rich text note>",
"letter_top": "<rich text letter top part>",
"letter_bottom": "<rich text letter bottom part>",
"applied_by": 2
}
}
```
### 15. Final Approval API
Hint: By this API staff or any officer can sent the application for final approval
```json
PATCH /api/v1/applications/admin/application/3/ HTTP/1.1
Content-Type: application/json
Authorization: jwt <token>
{
"is_final_approval": true,
"issue_number": "10.233.34.554.333",
"approved_by": 2 # user id
}
Response:
status code: 200
{
"success": true,
"message": "Status OK",
"data": {
"id": 5,
"service": {
"id": 1,
"name": "Buying House Registration"
},
"note_signatures": [
"/media/images/f11d137f-49b1-406c-9335-31f67f9dd478_2021_22.jpeg"
],
"letter_signature_url": "/media/images/f11d137f-49b1-406c-9335-31f67f9dd478_2021_22.jpeg",
"assigned_section": {
"id": 1,
"name": "Section A"
},
"current_assigned_user": {
"id": 2,
"username": "shafik.te@gmail.com",
"name": "MSI Shafik",
"designation": "Software Engineer",
"name_bn": "শফিকুল ইসলাম",
"designation_bn": "সফ্টওয়্যার প্রকৌশলী"
},
"approved_by": {
"id": 2,
"username": "shafik.te@gmail.com",
"name": "MSI Shafik",
"designation": "Software Engineer",
"name_bn": "শফিকুল ইসলাম",
"designation_bn": "সফ্টওয়্যার প্রকৌশলী"
},
"uid": "158ef8e6-90d6-40d7-9de6-80d7e48dc0cb",
"created_at": "2022-07-16T19:53:34.812482+06:00",
"updated_at": "2022-07-17T23:27:10.013856+06:00",
"is_active": true,
"name": "GK Traders",
"application_form": "<Rich Text Form Here>",
"section_assigned_at": "2022-07-17T23:23:32.050332+06:00",
"assigned_at": "2022-07-17T23:23:43.394666+06:00",
"application_status": "processing",
"is_final_approval": true,
"approved_at": null,
"issue_number": "10.233.34.554.333",
"reject_reasons": "test reasons",
"note": "<rich text note>",
"letter_top": "<rich text letter top part>",
"letter_bottom": "<rich text letter bottom part>",
"applied_by": 2
}
}
```
### 16. Final Publish/Approve API
Hint: By this API, letter will be published by the assigned final approval officer
```json
PATCH /api/v1/applications/admin/application/3/ HTTP/1.1
Content-Type: application/json
Authorization: jwt <token>
{
"application_status": "completed"
}
during final approval he can modify the application note or letter,
so "note", "letter_top", "letter_bottom" also can be added in the request body
Response:
status code: 200
{
"success": true,
"message": "Status OK",
"data": {
"id": 5,
"service": {
"id": 1,
"name": "Buying House Registration"
},
"note_signatures": [
"/media/images/f11d137f-49b1-406c-9335-31f67f9dd478_2021_22.jpeg"
],
"letter_signature_url": null,
"assigned_section": {
"id": 1,
"name": "Section A"
},
"current_assigned_user": {
"id": 2,
"username": "shafik.te@gmail.com",
"name": "MSI Shafik",
"designation": "Software Engineer",
"name_bn": "শফিকুল ইসলাম",
"designation_bn": "সফ্টওয়্যার প্রকৌশলী"
},
"approved_by": {
"id": 1,
"username": "admin",
"name": null,
"designation": null,
"name_bn": null,
"designation_bn": null
},
"uid": "158ef8e6-90d6-40d7-9de6-80d7e48dc0cb",
"created_at": "2022-07-16T19:53:34.812482+06:00",
"updated_at": "2022-07-17T23:30:23.450129+06:00",
"is_active": true,
"name": "GK Traders",
"application_form": "<Rich Text Form Here>",
"section_assigned_at": "2022-07-17T23:23:32.050332+06:00",
"assigned_at": "2022-07-17T23:23:43.394666+06:00",
"application_status": "completed",
"is_final_approval": true,
"approved_at": "2022-07-17T23:30:23.448924+06:00",
"issue_number": "10.233.34.554.333",
"reject_reasons": "test reasons",
"note": "<rich text note>",
"letter_top": "<rich text letter top part>",
"letter_bottom": "<rich text letter bottom part>",
"applied_by": 2
}
}
```
### 17. Add comment API
Hint: By this API admin/officer/staff will add comments
```json
POST /api/v1/applications/comment/ HTTP/1.1
Authorization: jwt <token>
Request Body:
{
"application": 5,
"comment": "Test Comment"
}
Response:
status code: 201
{
"success": true,
"message": "Created",
"data": {
"id": 2,
"uid": "b0e1dd3c-3ee9-47cd-8402-217c29f93747",
"created_at": "2022-07-24T21:04:51.548954+06:00",
"updated_at": "2022-07-24T21:04:51.548964+06:00",
"created_by": {
"id": 1,
"username": "admin",
"name": null,
"designation": null,
"name_bn": null,
"designation_bn": null
},
"updated_by": {},
"is_active": true,
"comment": "Test Comment",
"application": 5,
"comment_user": 1
}
}
```
### 18. Application Wise Comment List API
Hint: By this API application wise comments will be shown
```json
GET /api/v1/applications/comment/?application=5 HTTP/1.1
Authorization: jwt <token>
Response:
status code: 200
{
"success": true,
"meta_data": {
"count": 2,
"page_size": 10,
"next": null,
"previous": null
},
"data": [
{
"id": 2,
"comment": "Test Comment",
"comment_user": {
"id": 1,
"username": "admin",
"name": null,
"designation": null,
"name_bn": null,
"designation_bn": null
}
},
{
"id": 1,
"comment": "Test Comment",
"comment_user": {
"id": 1,
"username": "admin",
"name": null,
"designation": null,
"name_bn": null,
"designation_bn": null
}
}
]
}
```
### 19. Report API
```json
GET /api/v1/applications/report/ HTTP/1.1
Content-Type: application/json
Authorization: jwt <token>
Query Parameter:
?start_date=2022-07-01
?end_date=2022-07-10
Response:
{
"success": true,
"message": "Status OK",
"data": [
{
"section_name": "Section B",
"section_data": {
"total_assigned": 0,
"total_completed": 0,
"total_pending": 0,
"application_list": []
}
},
{
"section_name": "Section A",
"section_data": {
"total_assigned": 3,
"total_completed": 2,
"total_pending": 1,
"application_list": [
{
"name": "GK Traders",
"service": "Buying House Registration",
"applied_at": "2022-07-16T19:53:34.812482+06:00",
"completed_at": "2022-07-17T23:30:23.448924+06:00",
"assigned_section": "Section A",
"section_assigned_at": "2022-07-17T23:23:32.050332+06:00",
"application_status": "completed",
"issue_number": "10.233.34.554.333"
},
{
"name": "shafik",
"service": "Buying House Registration",
"applied_at": "2022-07-16T19:52:56.751583+06:00",
"completed_at": null,
"assigned_section": "Section A",
"section_assigned_at": "2022-07-17T23:13:10.787859+06:00",
"application_status": "processing",
"issue_number": null
},
{
"name": "shafik",
"service": "Buying House Registration",
"applied_at": "2022-07-16T13:35:30.321102+06:00",
"completed_at": "2022-07-16T19:51:28.547634+06:00",
"assigned_section": "Section A",
"section_assigned_at": "2022-07-16T19:38:58.929610+06:00",
"application_status": "completed",
"issue_number": "10.233.34.554.333"
}
]
}
}
]
}
```
## Get Own Profile API
```json
GET /api/v1/users/own-profile/ HTTP/1.1
Authorization: jwt <token>
Response:
{
"success": true,
"message": "Status OK",
"data": {
"id": 1,
"name": "MSI Shafik",
"name_bn": "শফিক",
"phone": "01740999768",
"designation": "software Engineer",
"designation_bn": "সফ্টওয়্যার প্রকৌশলী",
"signature_url": "/media/e.png"
}
}
```
## Own Profile Update API
```json
PATCH /api/v1/users/own-profile/update/ HTTP/1.1
Content-Type: application/json
Authorization: jwt <token>
Request Body:
## Can update any field from the below
{
"name": "MSI Shafik",
"name_bn": "শফিক",
"phone": "01740999768",
"password": "admin",
"designation": "software Engineer",
"designation_bn": "সফ্টওয়্যার প্রকৌশলী",
"signature_url": "/media/e.png"
}
Response:
{
"success": true,
"message": "Status OK",
"data": {
"id": 1,
"name": "MSI Shafik",
"name_bn": "শফিক",
"phone": "01740999768",
"designation": "software Engineer",
"designation_bn": "সফ্টওয়্যার প্রকৌশলী",
"signature_url": "/media/e.png"
}
}
```
## Public Issue Number Search API
By this API anyone can check the issue number is valid or not
```json
GET /api/v1/applications/search/?issue_number=10.233.34.554.333 HTTP/1.1
Response:
{
"success": true,
"message": "Issue number found!",
"id": 5,
"letter_top": "<rich text letter top part>",
"letter_bottom": "<rich text letter bottom part>",
"letter_signature_url": "/media/images/760118a3-db22-4c05-9a5d-5a518bcbeb50_sig-4.png",
"letter_signature_url_base64": "iVBORw"
```