Mobile API
| Verification | Expired |
|---|---|
| Tags | |
| Last edited | |
| Last edited time | |
| Owner | |
| Person |
Mobile API documentation
Leave
Fetch leaves
GET /api/v1/mobile/officer/{{officer id}}/leaves
Params
| fromDate | timestamp(seconds) |
| toDate | timestamp |
| sort | id,a |
| status | REQUESTED || APPROVED || REJECTED |
Response
| totalItems | number | total items present in db |
| items | array of objects | items fetched |
| totalPages | number | total pages available with respect to page size |
| currentPage | number | current page number |
{
"totalItems": 2,
"items": [
{
"id": "2c9f96ae7ae6c0d0017aeca02cb60043",
"startDateTime": "2021-08-29T10:20:00Z",
"endDateTime": "2021-09-03T10:20:00Z",
"reason": "Test",
"description": "Test",
"status": "REQUESTED"
},
{
"id": "2c9f96ae7d98d298017e281c28bd566b",
"startDateTime": "2022-01-07T00:30:00Z",
"endDateTime": "2022-01-08T00:30:00Z",
"reason": "someting",
"description": "some desdrtiption",
"status": "REQUESTED"
}
],
"totalPages": 1,
"currentPage": 0
}Fetch leaves by id
GET /api/v1/mobile/officer/{{officer id}}/leaves/{{leave id}}
Response
{
"id": "2c9f96ae7d98d298017e281c28bd566b",
"startDateTime": "2022-01-07T00:30:00Z",
"endDateTime": "2022-01-08T00:30:00Z",
"reason": "someting",
"description": "some desdrtiption",
"status": "REQUESTED"
}Create leave
POST /api/v1/mobile/officer/{{officer id}}/leaves
Body
{
"startDateTime":"2020-08-05T12:20:27.437260Z",
"endDateTime":"2020-08-13T12:20:27.437260Z",
"reason":"text",
"description":"text description"
}Response
Status: 201
{
"isSuccessful": true,
"responseText": "Successfully Created"
}Update leave by id
PUT /api/v1/mobile/officer/{{officer id}}/leaves/{{leave id}}
Body
{
"startDateTime":"2020-08-05T12:20:27.437260Z",
"endDateTime":"2020-08-13T12:20:27.437260Z",
"reason":"text",
"description":"text description"
}Response
status: 200
{
"isSuccessful": true,
"responseText": "Successfully Updated"
}Delete leave by id
PUT /api/v1/mobile/officer/{{officer id}}/leaves/{{leave id}}
Response
{
"isSuccessful": true,
"responseText": "Successfully Deleted"
}Shift
Fetch shifts
GET api/v1/mobile/officers/{{officer id}}/shifts
Params
| pageNumber | 0 | page number in pagination |
| group | true | |
| status | STARTED || COMPLETED || PUBLISHED || UNPUBLISHED | filter by status of shifts |
| sort | shiftStartDateTime, a | sort by shift start date time in ascending order |
| fromDate | timestamp | |
| toDate | timestamp | |
| pageSize | 5 | page size in pagination |
Response
By default per page items are 3. In the response it says totalItems as 24, totalPages as 8 and currenPage 0. Total items present in the db are 24 but we are getting only 3 at the client side.
{
"totalItems": 24,
"items": [
{
"id": "2c9f96ae7ab49230017ab49cbb3b000d",
"name": "akrs nagar 2021-07-17",
"description": null,
"officer": {
"id": "14c85653757e5bab01757e717bba0000",
"employeeId": "employee_7",
"firstName": "Vijay",
"lastName": "Reddyy"
},
"client": {
"id": "14c85653757a4def01757d87c791005c",
"name": "Swayaan Office",
"avatarUrl": "https://report-media-storage-bucket.s3.us-east-2.amazonaws.com/3bhta.png",
"location_id": null,
"location_name": "Akrs nagar",
"client_name": "Swayaan"
},
"clientLocation": {
"id": "14c85653757a4def01757dfce9fd0073",
"name": "Akrs nagar",
"lat": 12.897666830342596,
"lng": 77.68257694442747,
"fencing": [
{
"id": "14c856537656fbf901765fd51d650066",
"sequenceId": 0,
"lat": 12.89784232443504,
"lng": 77.68249466444564
},
{
"id": "14c856537656fbf901765fd51d650067",
"sequenceId": 1,
"lat": 12.897824022683698,
"lng": 77.6826502325685
},
{
"id": "14c856537656fbf901765fd51d650068",
"sequenceId": 2,
"lat": 12.897586099794404,
"lng": 77.68262341047836
},
{
"id": "14c856537656fbf901765fd51d650069",
"sequenceId": 3,
"lat": 12.897622703330558,
"lng": 77.68246247793746
}
]
},
"shiftTemplate": {
"id": "2c9f96ae7ab49230017ab49cbb3b000e",
"name": null
},
"eventTypes": [
{
"id": "2c9f96ae7ab49230017ab49cbb3c000f",
"name": "shift_start",
"description": "Shift start",
"duration": 0,
"dateTimeStamp": "2021-07-17T13:00:00Z",
"isDelete": false
},
{
"id": "2c9f96ae7ab49230017ab49cbb3c0010",
"name": "shift_end",
"description": "Shift End",
"duration": 0,
"dateTimeStamp": "2021-07-17T13:30:00Z",
"isDelete": false
}
],
"startDateTime": "2021-07-17T13:00:00Z",
"endDateTime": "2021-07-17T13:30:00Z",
"status": "COMPLETED",
"statusMessage": null,
"lunch_break_duration": 0,
"tea_break_duration": 0
},
{
"id": "2c9f96ae7ab49230017ab4ab822d001d",
"name": "akrs nagar 2021-07-17",
"description": "test media upload load timings",
"officer": {
"id": "14c85653757e5bab01757e717bba0000",
"employeeId": "employee_7",
"firstName": "Vijay",
"lastName": "Reddyy"
},
"client": {
"id": "14c85653757a4def01757d87c791005c",
"name": "Swayaan Office",
"avatarUrl": "https://report-media-storage-bucket.s3.us-east-2.amazonaws.com/3bhta.png",
"location_id": null,
"location_name": "Akrs nagar",
"client_name": "Swayaan"
},
"clientLocation": {
"id": "14c85653757a4def01757dfce9fd0073",
"name": "Akrs nagar",
"lat": 12.897666830342596,
"lng": 77.68257694442747,
"fencing": [
{
"id": "14c856537656fbf901765fd51d650066",
"sequenceId": 0,
"lat": 12.89784232443504,
"lng": 77.68249466444564
},
{
"id": "14c856537656fbf901765fd51d650067",
"sequenceId": 1,
"lat": 12.897824022683698,
"lng": 77.6826502325685
},
{
"id": "14c856537656fbf901765fd51d650068",
"sequenceId": 2,
"lat": 12.897586099794404,
"lng": 77.68262341047836
},
{
"id": "14c856537656fbf901765fd51d650069",
"sequenceId": 3,
"lat": 12.897622703330558,
"lng": 77.68246247793746
}
]
},
"shiftTemplate": {
"id": "2c9f96ae7ab49230017ab4ad27f50022",
"name": null
},
"eventTypes": [
{
"id": "2c9f96ae7ab49230017ab4ab822d001f",
"name": "shift_start",
"description": "Shift start",
"duration": 0,
"dateTimeStamp": "2021-07-17T13:35:00Z",
"isDelete": false
},
{
"id": "2c9f96ae7ab49230017ab4ab822d0020",
"name": "shift_end",
"description": "Shift End",
"duration": 0,
"dateTimeStamp": "2021-07-17T13:50:00Z",
"isDelete": false
}
],
"startDateTime": "2021-07-17T13:35:00Z",
"endDateTime": "2021-07-17T13:50:00Z",
"status": "COMPLETED",
"statusMessage": null,
"lunch_break_duration": 30,
"tea_break_duration": 15
},
{
"id": "2c9f96ae7ab9ec36017abcb594870000",
"name": "Swayaan Office 2021-07-19",
"description": "Email issue check",
"officer": {
"id": "14c85653757e5bab01757e717bba0000",
"employeeId": "employee_7",
"firstName": "Vijay",
"lastName": "Reddyy"
},
"client": {
"id": "14c85653757a4def01757d87c791005c",
"name": "Swayaan Office",
"avatarUrl": "https://report-media-storage-bucket.s3.us-east-2.amazonaws.com/3bhta.png",
"location_id": null,
"location_name": "Swayaan Office",
"client_name": "Swayaan"
},
"clientLocation": {
"id": "14c85653757a4def01757d8bff94005f",
"name": "Swayaan Office",
"lat": 12.971994469292845,
"lng": 77.6538785889723,
"fencing": [
{
"id": "14c85653758ebbe60175a1dc767b001f",
"sequenceId": 0,
"lat": 12.972074379367454,
"lng": 77.65374712227218
},
{
"id": "14c85653758ebbe60175a1dc767b0020",
"sequenceId": 1,
"lat": 12.972044974588922,
"lng": 77.65391073702209
},
{
"id": "14c85653758ebbe60175a1dc767b0021",
"sequenceId": 2,
"lat": 12.971946305195525,
"lng": 77.65391073702209
},
{
"id": "14c85653758ebbe60175a1dc767b0022",
"sequenceId": 3,
"lat": 12.971952186153848,
"lng": 77.65374175785415
}
]
},
"shiftTemplate": {
"id": "2c9f96ae7ab9ec36017abcb5948e0001",
"name": null
},
"eventTypes": [
{
"id": "2c9f96ae7ab9ec36017abcb594920002",
"name": "shift_start",
"description": "Shift start",
"duration": 0,
"dateTimeStamp": "2021-07-18T10:09:49.555153Z",
"isDelete": false
},
{
"id": "2c9f96ae7ab9ec36017abcb594920003",
"name": "lunch_break_start",
"description": "Lunch Break Start",
"duration": 0,
"dateTimeStamp": "2021-07-18T13:09:49.555153Z",
"isDelete": false
},
{
"id": "2c9f96ae7ab9ec36017abcb594920004",
"name": "lunch_break_end",
"description": "Lunch Break End",
"duration": 0,
"dateTimeStamp": "2021-07-18T14:09:49.555153Z",
"isDelete": false
},
{
"id": "2c9f96ae7ab9ec36017abcb594920005",
"name": "tea_break_start",
"description": "Tea Break Start",
"duration": 0,
"dateTimeStamp": "2021-07-18T17:09:49.555153Z",
"isDelete": false
},
{
"id": "2c9f96ae7ab9ec36017abcb594920006",
"name": "tea_break_end",
"description": "Tea Break End",
"duration": 0,
"dateTimeStamp": "2021-07-18T17:30:49.555153Z",
"isDelete": false
},
{
"id": "2c9f96ae7ab9ec36017abcb594920007",
"name": "shift_end",
"description": "Shift End",
"duration": 0,
"dateTimeStamp": "2021-07-18T20:09:49.555153Z",
"isDelete": false
}
],
"startDateTime": "2021-07-18T10:09:49.555153Z",
"endDateTime": "2021-07-18T20:09:49.555153Z",
"status": "PUBLISHED",
"statusMessage": null,
"lunch_break_duration": 0,
"tea_break_duration": 0
}
],
"totalPages": 8,
"currentPage": 0
}Shift actions
POST api/v1/mobile/officers/{{officer id}}/shifts/{{shift id}}/action
Based on what name we pass, backend creates appropriate action.
| shift_end | ends the shift |
| shift_start | starts the shift |
| lunch_break_start | start lunch break time |
| lunch_break_end | stop lunch break |
| tea_break_start | start tea break |
| tea_break_end | stop_tea_break |
Body
{
"lat": 12.972442,
"lng": 77.580643,
"distance":500,
"eventType": {
"name": "shift_end",
"description": "Shift end",
"duration": 0,
"dateTimeStamp": "2021-08-14T07:23:08.784Z"
}
}Response
{
"isSuccessful": true,
"responseText": "Action Successfully Created"
}User
Get Access token
POST /api/v1/oauth2/token
Headers
| Authorization | Basic c3NvLWNsaWVudDpzZWNyZXQta2V5 |
| Content-Type | application/x-www-form-urlencoded |
Body
x-www-form-urlencoded
| username | |
| grant_type | password |
| password | text |
Response
{
"accessToken": "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ2aWpheUBzd2F5YWFuLmNvbSIsIm9mZmljZXJJZCI6IjE0Yzg1NjUzNzU3ZTViYWIwMTc1N2U3MTdiYmEwMDAwIiwiYXV0aCI6W3siYXV0aG9yaXR5IjoiUk9MRV9PRkZJQ0VSIn1dLCJpYXQiOjE2NDI0NzU3NjIsImV4cCI6MTY0MjQ3OTM2Mn0.F-6tlmuXCGQTOOli2B8XUotKfyLaUT0rjYBRa6I4pag",
"refreshToken": "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ2aWpheUBzd2F5YWFuLmNvbSIsIm9mZmljZXJJZCI6IjE0Yzg1NjUzNzU3ZTViYWIwMTc1N2U3MTdiYmEwMDAwIiwiYXV0aCI6W3siYXV0aG9yaXR5IjoiUk9MRV9PRkZJQ0VSIn1dLCJpYXQiOjE2NDI0NzU3NjIsImV4cCI6MTY0MjU2MjE2Mn0.zUmSsd4So2Fk5NS_9hQHYIru1xzK_Cew7gJoUXboTTo"
}access token consists of below payload. Use jwt.io debugger to check a jwt token
{
"sub": "vijay@swayaan.com",
"officerId": "14c85653757e5bab01757e717bba0000",
"auth": [
{
"authority": "ROLE_OFFICER"
}
],
"iat": 1642475762,
"exp": 1642479362
}Reset password
POST /api/v1/oauth2/resetpassword?emailid={{email}}&password={{password}}
Headers
| Authorization | Bearer {{token} |
Params
| emailId | |
| password | password |
Forgot password
POST /api/v1/oauth2/forgotpassword?emailid={{email}}
Params
This will send password reset link to registered email
| emailId |
Officer
Fetch officer by id
GET /api/v1/mobile/officers/{{officer id}}
Authorization : Bearer token
Response
{
"id": "14c85653757e5bab01757e717bba0000",
"employeeId": "employee_7",
"emailId": "vijay@swayaan.com",
"firstName": "Vijay",
"userName": "vijay@swayaan.com",
"lastName": "Reddyy",
"avatar": "https://report-media-storage-bucket.s3.amazonaws.com/1e3f4c86-40f3-4845-9cf7-d0b99144a147.png",
"dob": "1963-02-09T00:00:00Z",
"roles": [
"ROLE_OFFICER"
],
"contacts": [
{
"id": "14c8565375b808550175c129873a0047",
"emailId": "Emp",
"name": "Emp",
"phone": {
"id": "14c8565375b808550175c129873a0048",
"type": "MOBILE",
"number": "6985475869"
},
"address": null,
"postalcode": "98789",
"relation": "OTHERS",
"type": "PRIMARY",
"status": "ACTIVE"
},
{
"id": "14c8565376f0d0550176f169ef890011",
"emailId": "info@swayaan.com",
"name": "test",
"phone": {
"id": "14c8565376f0d0550176f169ef890012",
"type": "MOBILE",
"number": "1111111111"
},
"address": null,
"postalcode": "85121",
"relation": "OFFICER",
"type": "EMERGENCY",
"status": "ACTIVE"
},
{
"id": "14c8565376f0d0550176f16b0ea50013",
"emailId": "info@swayaan.com",
"name": "test 2",
"phone": {
"id": "14c8565376f0d0550176f16b0ea50014",
"type": "MOBILE",
"number": "2222222222"
},
"address": null,
"postalcode": "85121",
"relation": "OFFICER",
"type": "PRIMARY",
"status": "ACTIVE"
}
],
"documents": [
{
"id": "2c9f96ae7abd3080017abde2b2400042",
"fileDetail": {
"id": "2c9f96ae7abd3080017abde2a4700041",
"name": "1e3f4c86-40f3-4845-9cf7-d0b99144a147.png",
"size": 29784,
"url": "https://report-media-storage-bucket.s3.amazonaws.com/1e3f4c86-40f3-4845-9cf7-d0b99144a147.png",
"format": "image/png"
},
"description": "My Profile Image",
"type": {
"id": "2c9f96ae7abd3080017abde2b2400043",
"name": "avatar",
"description": "My Profile Image",
"status": "Active"
},
"doctypeOthers": "None",
"generic": false
},
{
"id": "2c9f96ae7abd3080017abde2b24c0044",
"fileDetail": {
"id": "2c9f96ae7abd3080017abde2a4700041",
"name": "1e3f4c86-40f3-4845-9cf7-d0b99144a147.png",
"size": 29784,
"url": "https://report-media-storage-bucket.s3.amazonaws.com/1e3f4c86-40f3-4845-9cf7-d0b99144a147.png",
"format": "image/png"
},
"description": "My Profile Image",
"type": {
"id": "2c9f96ae7abd3080017abde2b24c0045",
"name": "avatar",
"description": "My Profile Image",
"status": "Active"
},
"doctypeOthers": "None",
"generic": false
}
],
"status": "ACTIVE",
"payRate": {
"id": "14c85653757e5bab01757e717bba0001",
"type": "HOURLY",
"hourlyRate": 120000.0,
"weekendRate": 1400.0,
"holidayRate": 1400.0,
"overtimeRate": 700.0,
"annual": 123.0,
"annualHourlyRate": 123.0
}
}Update officer by id
PUT /api/v1/mobile/officers/{{officer id}}
Body
{
"id": "2c927a3775250dee0175251401b30002",
"employeeId": "hope@gmail.com",
"emailId": "hope@gmail.com",
"firstName": "Hope Update",
"userName": "hope@gmail.com",
"lastName": "cmdr Update",
"avatar": "",
"dob": "2020-08-03T10:03:59+05:30",
"roles": [
"ROLE_OFFICER"
],
"status": "ACTIVE",
"payRate": {
"id": "2c927a3775250dee0175251401b40003",
"type": "ANNUAL",
"hourlyRate": null,
"weekendRate": null,
"holidayRate": null,
"overtimeRate": null,
"annual": 123445,
"annualHourlyRate": 90
}
}Response
{
"isSuccessful": true,
"responseText": "Successfully Updated"
}Timesheet
Fetch timesheets
GET /api/v1/mobile/officers/{{officer id}}/timesheets
Params
| pageNumber | number |
| sort | id,a |
| group | true |
| fromDate | timestamp |
| toDate | timestamp |
| pageSize | number |
Response
{
"totalItems": 19,
"items": [
{
"id": "2c9f96ae7abd3080017ae67c83ef0058",
"name": "Akrs nagar 2021-07-27T05:42:11.765Z[UTC]",
"description": "Description Akrs nagar 2021-07-27T05:42:11.765Z[UTC]",
"startDateTime": "2021-07-27T05:42:11.765Z",
"endDateTime": "2021-07-27T06:04:21.971Z",
"shift": {
"id": "2c9f96ae7abd3080017ae67b17540050",
"name": "Akrs nagar 2021-07-27T05:42:11.765Z[UTC]",
"startDateTime": "2021-07-27T05:30:00Z",
"endDateTime": "2021-07-27T06:00:00Z",
"client": {
"id": "14c85653757a4def01757d87c791005c",
"name": "Swayaan Office",
"avatarUrl": "https://report-media-storage-bucket.s3.us-east-2.amazonaws.com/3bhta.png",
"location_id": "14c85653757a4def01757dfce9fd0073",
"location_name": "Akrs nagar",
"client_name": "Swayaan"
},
"officer": {
"id": "14c85653757e5bab01757e717bba0000",
"employeeId": "employee_7",
"firstName": "Vijay",
"lastName": "Reddy"
},
"status": "COMPLETED"
},
"location": {
"id": "14c85653757a4def01757dfce9fd0073",
"name": "Akrs nagar",
"lat": 12.897666830342596,
"lng": 77.68257694442747,
"fencing": [
{
"id": "14c856537656fbf901765fd51d650066",
"sequenceId": 0,
"lat": 12.89784232443504,
"lng": 77.68249466444564
},
{
"id": "14c856537656fbf901765fd51d650067",
"sequenceId": 1,
"lat": 12.897824022683698,
"lng": 77.6826502325685
},
{
"id": "14c856537656fbf901765fd51d650068",
"sequenceId": 2,
"lat": 12.897586099794404,
"lng": 77.68262341047836
},
{
"id": "14c856537656fbf901765fd51d650069",
"sequenceId": 3,
"lat": 12.897622703330558,
"lng": 77.68246247793746
}
]
},
"eventTypes": [
{
"id": "2c9f96ae7abd3080017ae67c83f00059",
"name": "shift_start",
"description": "Shift Start",
"duration": 0,
"dateTimeStamp": "2021-07-27T05:42:11.765Z",
"isDelete": false
},
{
"id": "2c9f96ae7abd3080017ae67cbb8a0066",
"name": "lunch_break_start",
"description": "Lunch Break Start",
"duration": 0,
"dateTimeStamp": "2021-07-27T05:42:50.582Z",
"isDelete": false
},
{
"id": "2c9f96ae7ae68cae017ae6905c8c0000",
"name": "lunch_break_end",
"description": "Lunch Break End",
"duration": 0,
"dateTimeStamp": "2021-07-27T06:04:17.214Z",
"isDelete": false
},
{
"id": "2c9f96ae7ae68cae017ae6906ebb0001",
"name": "shift_end",
"description": "Shift End",
"duration": 0,
"dateTimeStamp": "2021-07-27T06:04:21.971Z",
"isDelete": false
}
],
"shiftDuration": "0:0:43",
"status": "PENDING",
"shiftLateStartReason": null
},
{
"id": "2c9f96ae7ae6c0d0017ae6d4585d0012",
"name": "Akrs nagar 2021-07-27T07:16:42.551Z[UTC]",
"description": "Description Akrs nagar 2021-07-27T07:16:42.551Z[UTC]",
"startDateTime": "2021-07-27T07:16:42.551Z",
"endDateTime": "2021-07-27T07:30:20.777Z",
"shift": {
"id": "2c9f96ae7ae6c0d0017ae6c3821a0000",
"name": "Akrs nagar 2021-07-27T07:16:42.551Z[UTC]",
"startDateTime": "2021-07-27T07:10:00Z",
"endDateTime": "2021-07-27T07:30:00Z",
"client": {
"id": "14c85653757a4def01757d87c791005c",
"name": "Swayaan Office",
"avatarUrl": "https://report-media-storage-bucket.s3.us-east-2.amazonaws.com/3bhta.png",
"location_id": "14c85653757a4def01757dfce9fd0073",
"location_name": "Akrs nagar",
"client_name": "Swayaan"
},
"officer": {
"id": "14c85653757e5bab01757e717bba0000",
"employeeId": "employee_7",
"firstName": "Vijay",
"lastName": "Reddy"
},
"status": "COMPLETED"
},
"location": {
"id": "14c85653757a4def01757dfce9fd0073",
"name": "Akrs nagar",
"lat": 12.897666830342596,
"lng": 77.68257694442747,
"fencing": [
{
"id": "14c856537656fbf901765fd51d650066",
"sequenceId": 0,
"lat": 12.89784232443504,
"lng": 77.68249466444564
},
{
"id": "14c856537656fbf901765fd51d650067",
"sequenceId": 1,
"lat": 12.897824022683698,
"lng": 77.6826502325685
},
{
"id": "14c856537656fbf901765fd51d650068",
"sequenceId": 2,
"lat": 12.897586099794404,
"lng": 77.68262341047836
},
{
"id": "14c856537656fbf901765fd51d650069",
"sequenceId": 3,
"lat": 12.897622703330558,
"lng": 77.68246247793746
}
]
},
"eventTypes": [
{
"id": "2c9f96ae7ae6c0d0017ae6d4585d0013",
"name": "shift_start",
"description": "Shift Start",
"duration": 0,
"dateTimeStamp": "2021-07-27T07:16:42.551Z",
"isDelete": false
},
{
"id": "2c9f96ae7ae6c0d0017ae6df2677001d",
"name": "shift_end",
"description": "Shift End",
"duration": 0,
"dateTimeStamp": "2021-07-27T07:30:20.777Z",
"isDelete": false
}
],
"shiftDuration": "0:13:38",
"status": "PENDING",
"shiftLateStartReason": null
},
{
"id": "2c9f96ae7ae6c0d0017ae6ea89d0002b",
"name": "Akrs nagar 2021-07-27T07:40:56.775Z[UTC]",
"description": "Description Akrs nagar 2021-07-27T07:40:56.775Z[UTC]",
"startDateTime": "2021-07-27T07:40:56.775Z",
"endDateTime": "2021-07-27T07:44:48.305Z",
"shift": {
"id": "2c9f96ae7ae6c0d0017ae6e78f860025",
"name": "Akrs nagar 2021-07-27T07:40:56.775Z[UTC]",
"startDateTime": "2021-07-27T07:40:00Z",
"endDateTime": "2021-07-27T07:50:00Z",
"client": {
"id": "14c85653757a4def01757d87c791005c",
"name": "Swayaan Office",
"avatarUrl": "https://report-media-storage-bucket.s3.us-east-2.amazonaws.com/3bhta.png",
"location_id": "14c85653757a4def01757dfce9fd0073",
"location_name": "Akrs nagar",
"client_name": "Swayaan"
},
"officer": {
"id": "14c85653757e5bab01757e717bba0000",
"employeeId": "employee_7",
"firstName": "Vijay",
"lastName": "Reddy"
},
"status": "COMPLETED"
},
"location": {
"id": "14c85653757a4def01757dfce9fd0073",
"name": "Akrs nagar",
"lat": 12.897666830342596,
"lng": 77.68257694442747,
"fencing": [
{
"id": "14c856537656fbf901765fd51d650066",
"sequenceId": 0,
"lat": 12.89784232443504,
"lng": 77.68249466444564
},
{
"id": "14c856537656fbf901765fd51d650067",
"sequenceId": 1,
"lat": 12.897824022683698,
"lng": 77.6826502325685
},
{
"id": "14c856537656fbf901765fd51d650068",
"sequenceId": 2,
"lat": 12.897586099794404,
"lng": 77.68262341047836
},
{
"id": "14c856537656fbf901765fd51d650069",
"sequenceId": 3,
"lat": 12.897622703330558,
"lng": 77.68246247793746
}
]
},
"eventTypes": [
{
"id": "2c9f96ae7ae6c0d0017ae6ea89d0002c",
"name": "shift_start",
"description": "Shift Start",
"duration": 0,
"dateTimeStamp": "2021-07-27T07:40:56.775Z",
"isDelete": false
},
{
"id": "2c9f96ae7ae6c0d0017ae6ec64990033",
"name": "shift_end",
"description": "Shift End",
"duration": 0,
"dateTimeStamp": "2021-07-27T07:44:48.305Z",
"isDelete": false
}
],
"shiftDuration": "0:3:51",
"status": "PENDING",
"shiftLateStartReason": null
}
],
"totalPages": 7,
"currentPage": 0
}Fetch timesheet by id
GET api/v1/mobile/officers/{{officer}}/timesheets/{{timesheet id}}
Authorization: Bearer token
Response
{
"id": "2c9f96ae7abd3080017ae67c83ef0058",
"name": "Akrs nagar 2021-07-27T05:42:11.765Z[UTC]",
"description": "Description Akrs nagar 2021-07-27T05:42:11.765Z[UTC]",
"startDateTime": "2021-07-27T05:42:11.765Z",
"endDateTime": "2021-07-27T06:04:21.971Z",
"shift": {
"id": "2c9f96ae7abd3080017ae67b17540050",
"name": "Akrs nagar 2021-07-27T05:42:11.765Z[UTC]",
"startDateTime": "2021-07-27T05:30:00Z",
"endDateTime": "2021-07-27T06:00:00Z",
"client": {
"id": "14c85653757a4def01757d87c791005c",
"name": "Swayaan Office",
"avatarUrl": "https://report-media-storage-bucket.s3.us-east-2.amazonaws.com/3bhta.png",
"location_id": "14c85653757a4def01757dfce9fd0073",
"location_name": "Akrs nagar",
"client_name": "Swayaan"
},
"officer": {
"id": "14c85653757e5bab01757e717bba0000",
"employeeId": "employee_7",
"firstName": "Vijay",
"lastName": "Reddy"
},
"status": "COMPLETED"
},
"location": {
"id": "14c85653757a4def01757dfce9fd0073",
"name": "Akrs nagar",
"lat": 12.897666830342596,
"lng": 77.68257694442747,
"fencing": [
{
"id": "14c856537656fbf901765fd51d650066",
"sequenceId": 0,
"lat": 12.89784232443504,
"lng": 77.68249466444564
},
{
"id": "14c856537656fbf901765fd51d650067",
"sequenceId": 1,
"lat": 12.897824022683698,
"lng": 77.6826502325685
},
{
"id": "14c856537656fbf901765fd51d650068",
"sequenceId": 2,
"lat": 12.897586099794404,
"lng": 77.68262341047836
},
{
"id": "14c856537656fbf901765fd51d650069",
"sequenceId": 3,
"lat": 12.897622703330558,
"lng": 77.68246247793746
}
]
},
"eventTypes": [
{
"id": "2c9f96ae7abd3080017ae67c83f00059",
"name": "shift_start",
"description": "Shift Start",
"duration": 0,
"dateTimeStamp": "2021-07-27T05:42:11.765Z",
"isDelete": false
},
{
"id": "2c9f96ae7abd3080017ae67cbb8a0066",
"name": "lunch_break_start",
"description": "Lunch Break Start",
"duration": 0,
"dateTimeStamp": "2021-07-27T05:42:50.582Z",
"isDelete": false
},
{
"id": "2c9f96ae7ae68cae017ae6905c8c0000",
"name": "lunch_break_end",
"description": "Lunch Break End",
"duration": 0,
"dateTimeStamp": "2021-07-27T06:04:17.214Z",
"isDelete": false
},
{
"id": "2c9f96ae7ae68cae017ae6906ebb0001",
"name": "shift_end",
"description": "Shift End",
"duration": 0,
"dateTimeStamp": "2021-07-27T06:04:21.971Z",
"isDelete": false
}
],
"shiftDuration": "0:0:43",
"status": "PENDING",
"shiftLateStartReason": null
}Update timesheet by id
PUT /api/v1/mobile/officers/{{offcer}}/timesheets/{{timesheet}}
Authorization: Bearer token
eventTypes is an array of object of different event types
event types are shift_start, shift_end, lunch_break_start, lunch_break_end, tea_break_start, tea_break_end
{
"id": "2c9f98e479ea2e650179ef472109009d",
"description": "Description akrs nagar 2021-06-09T05:38:03.899Z[UTC]",
"eventTypes": [
{
"id": "2c9f98e479ea2e650179ef47210a009e",
"name": "shift_start",
"description": "Shift Start",
"duration": 0,
"dateTimeStamp": "2021-06-09T05:38:03.899Z",
"isDelete": false
}
],
"shiftLateStartReason": "text"
}Response
{
"isSuccessful": true,
"responseText": "Successfully Updated"
}Update timesheet status by id
POST /api/v1/mobile/officers/{{officer}}/timesheets/{{timesheet id}}
Params
| status | PENDING |
Response
{
"isSuccessful": true,
"responseText": "Status Successfully Updated"
}Courtesy report
Fetch courtesy reports
GET /api/v1/mobile/officers/{{officer}}/courtesyreports
Authorization: Bearer token
Params
| pageNumber | number |
| sort | id,a |
| group | true |
| fromDate | timestamp |
| toDate | timestamp |
| pageSize | number |
Response
{
"totalItems": 2,
"items": [
{
"id": "2c9f96ae7d98d298017e28170c925615",
"name": "Akrs nagar 5th Jan 2022",
"description": "courtesy checklisgt done",
"dateTime": "2022-01-05T02:35:06.121343Z",
"courtesyFields": [
{
"id": "2c9f96ae7d98d298017e28170c945616",
"courtesyField": {
"id": "14c85653760ea81901761950df1b0010",
"name": "sky lounge",
"status": "ACTIVE"
},
"value": "YES"
},
{
"id": "2c9f96ae7d98d298017e28170c945617",
"courtesyField": {
"id": "14c85653760ea81901760eaa8d190004",
"name": "Access control devices fully functional",
"status": "ACTIVE"
},
"value": "NO"
},
{
"id": "2c9f96ae7d98d298017e28170c945618",
"courtesyField": {
"id": "14c85653760e8a1901760ea38f530001",
"name": "Club room secure",
"status": "ACTIVE"
},
"value": "NA"
},
{
"id": "2c9f96ae7d98d298017e28170c945619",
"courtesyField": {
"id": "14c85653760e8a1901760ea3236a0000",
"name": "Pool area secure",
"status": "ACTIVE"
},
"value": "NO"
}
],
"status": "PUBLISH",
"shift": {
"id": "2c9f96ae7d98d298017e28071a1a55dd",
"name": "Akrs nagar 2022-01-05",
"startDateTime": "2022-01-05T02:30:00.005Z",
"endDateTime": "2022-01-05T03:30:00Z",
"client": {
"id": "14c85653757a4def01757d87c791005c",
"name": "Swayaan Office",
"avatarUrl": "https://report-media-storage-bucket.s3.us-east-2.amazonaws.com/3bhta.png",
"location_id": "14c85653757a4def01757dfce9fd0073",
"location_name": "Akrs nagar",
"client_name": "Swayaan"
},
"officer": {
"id": "14c85653757e5bab01757e717bba0000",
"employeeId": "employee_7",
"firstName": "Vijay",
"lastName": "Reddy"
},
"status": "COMPLETED"
},
"templateId": "2c9f96ae7d98d298017e2816dae55614"
},
{
"id": "2c9f96ae7e33b1d8017e4365d8be07fc",
"name": "Akrs nagar 10th Jan 2022",
"description": "descrioption",
"dateTime": "2022-01-10T09:50:55.13068Z",
"courtesyFields": [
{
"id": "2c9f96ae7e33b1d8017e4365d8be07fd",
"courtesyField": {
"id": "14c85653760ea81901761950df1b0010",
"name": "sky lounge",
"status": "ACTIVE"
},
"value": "YES"
},
{
"id": "2c9f96ae7e33b1d8017e4365d8be07fe",
"courtesyField": {
"id": "14c85653760ea81901760eaa8d190004",
"name": "Access control devices fully functional",
"status": "ACTIVE"
},
"value": "NO"
},
{
"id": "2c9f96ae7e33b1d8017e4365d8be07ff",
"courtesyField": {
"id": "14c85653760e8a1901760ea38f530001",
"name": "Club room secure",
"status": "ACTIVE"
},
"value": "NO"
},
{
"id": "2c9f96ae7e33b1d8017e4365d8be0800",
"courtesyField": {
"id": "14c85653760e8a1901760ea3236a0000",
"name": "Pool area secure",
"status": "ACTIVE"
},
"value": "NO"
}
],
"status": "PUBLISH",
"shift": {
"id": "2c9f96ae7e33b1d8017e435b0dda07c3",
"name": "Akrs nagar 2022-01-10",
"startDateTime": "2022-01-10T09:30:00Z",
"endDateTime": "2022-01-10T10:00:00Z",
"client": {
"id": "14c85653757a4def01757d87c791005c",
"name": "Swayaan Office",
"avatarUrl": "https://report-media-storage-bucket.s3.us-east-2.amazonaws.com/3bhta.png",
"location_id": "14c85653757a4def01757dfce9fd0073",
"location_name": "Akrs nagar",
"client_name": "Swayaan"
},
"officer": {
"id": "14c85653757e5bab01757e717bba0000",
"employeeId": "employee_7",
"firstName": "Vijay",
"lastName": "Reddy"
},
"status": "COMPLETED"
},
"templateId": "2c9f96ae7d98d298017e2816dae55614"
}
],
"totalPages": 1,
"currentPage": 0
}Fetch courtesy reports by id
GET /api/v1/mobile/officers/{{officer id}}/courtesyreports/{{courtesy report id}}
Authorization: Bearer token
Response
{
"id": "2c9f96ae7d98d298017e28170c925615",
"name": "Akrs nagar 5th Jan 2022",
"description": "courtesy checklisgt done",
"dateTime": "2022-01-05T02:35:06.121343Z",
"courtesyFields": [
{
"id": "2c9f96ae7d98d298017e28170c945616",
"courtesyField": {
"id": "14c85653760ea81901761950df1b0010",
"name": "sky lounge",
"status": "ACTIVE"
},
"value": "YES"
},
{
"id": "2c9f96ae7d98d298017e28170c945617",
"courtesyField": {
"id": "14c85653760ea81901760eaa8d190004",
"name": "Access control devices fully functional",
"status": "ACTIVE"
},
"value": "NO"
},
{
"id": "2c9f96ae7d98d298017e28170c945618",
"courtesyField": {
"id": "14c85653760e8a1901760ea38f530001",
"name": "Club room secure",
"status": "ACTIVE"
},
"value": "NA"
},
{
"id": "2c9f96ae7d98d298017e28170c945619",
"courtesyField": {
"id": "14c85653760e8a1901760ea3236a0000",
"name": "Pool area secure",
"status": "ACTIVE"
},
"value": "NO"
}
],
"status": "PUBLISH",
"shift": {
"id": "2c9f96ae7d98d298017e28071a1a55dd",
"name": "Akrs nagar 2022-01-05",
"startDateTime": "2022-01-05T02:30:00.005Z",
"endDateTime": "2022-01-05T03:30:00Z",
"client": {
"id": "14c85653757a4def01757d87c791005c",
"name": "Swayaan Office",
"avatarUrl": "https://report-media-storage-bucket.s3.us-east-2.amazonaws.com/3bhta.png",
"location_id": "14c85653757a4def01757dfce9fd0073",
"location_name": "Akrs nagar",
"client_name": "Swayaan"
},
"officer": {
"id": "14c85653757e5bab01757e717bba0000",
"employeeId": "employee_7",
"firstName": "Vijay",
"lastName": "Reddy"
},
"status": "COMPLETED"
},
"templateId": "2c9f96ae7d98d298017e2816dae55614"
}create courtesy report
POST /api/v1/mobile/officers/{{officer id}}/shifts/{{shift id}}/courtesyreports
Authorization: Bearer token
Required items(chaining of api calls): templateId, courtesyFieldId
Body
{
"name":"Courtesy Report from Mobile",
"templateId":"402880eb75d4e4310175d5193610000f",
"description":"Courtesy Description Testing now",
"dateTime":"2020-08-25T16:09:49.5551528Z",
"courtesyFields":[
{
"courtesyFieldId":"402880eb75d4bae30175d4bbd82c0000",
"value":"YES"
},
{
"courtesyFieldId":"402880eb75d4bae30175d4bc0cc10001",
"value":"NO"
}
]
}Response
{
"isSuccessful": true,
"responseText": "Successfully Created"
}update courtesy report
PUT /api/v1/mobile/officers/{{officer}}/shifts/{{shift id}}/courtesyreports/{{courtesy report id}}
Authorization: Bearer token
Required items(chaining of api calls): templateId, courtesyFieldId
Body
{
"name":"Courtesy Report from Mobile Update",
"templateId":"402880eb75d4e4310175d5193610000f",
"description":"Courtesy Description Testing now Update",
"dateTime":"2020-08-25T16:09:49.5551528Z",
"courtesyFields":[
{
"courtesyFieldId":"402880eb75d4bae30175d4bbd82c0000",
"value":"YES"
},
{
"courtesyFieldId":"402880eb75d4bae30175d4bc0cc10001",
"value":"YES"
}
]
}Response
{
"isSuccessful": true,
"responseText": "Successfully Updated"
}publish courtesy report
POST /api/v1/mobile/officers/{{officer id}}/courtesyreports/{{courtesy report id}}/publish
Response
{
"isSuccessful": true,
"responseText": "Successfully Published"
}delete courtesy report
DELETE /api/v1/mobile/officers/{{officer id}}/courtesyreports/{{courtesy report id}}
Response
{
"isSuccessful": true,
"responseText": "Successfully Deleted"
}Incident report
Fetch incident reports
GET /api/v1/mobile/officers/{{officer}}/incidentreports
Authorization: Bearer token
Params
| pageNumber | number |
| sort | id,a |
| group | true |
| fromDate | timestamp |
| toDate | timestamp |
| pageSize | number |
Response
{
"totalItems": 13,
"items": [
{
"id": "2c9f96ae7ab49230017ab4b7c7c60049",
"shift": {
"id": "2c9f96ae7ab49230017ab4ab822d001d",
"name": "akrs nagar 2021-07-17",
"startDateTime": "2021-07-17T13:35:00Z",
"endDateTime": "2021-07-17T13:50:00Z",
"client": {
"id": "14c85653757a4def01757d87c791005c",
"name": "Swayaan Office",
"avatarUrl": "https://report-media-storage-bucket.s3.us-east-2.amazonaws.com/3bhta.png",
"location_id": "14c85653757a4def01757dfce9fd0073",
"location_name": "Akrs nagar",
"client_name": "Swayaan"
},
"officer": null,
"status": "COMPLETED"
},
"name": "akrs nagar 17th Jul 2021",
"description": "report desc",
"status": "PUBLISH",
"dateTime": "2021-07-17T13:46:20.986463Z",
"documents": [
{
"id": "2c9f96ae7ab49230017ab4b7cc0a004a",
"fileDetail": {
"id": "2c9f96ae7ab49230017ab4b7c53d0046",
"name": "3eba349f-4040-4732-8f9a-1f6a1752948a.jpeg",
"size": 9009,
"url": "https://report-media-storage-bucket.s3.us-east-2.amazonaws.com/3eba349f-4040-4732-8f9a-1f6a1752948a.jpeg",
"format": "image/jpeg"
},
"description": "Incident Report Document",
"type": {
"id": "2c9f96ae7ab49230017ab4b7cc0a004b",
"name": "Incident Report Document",
"description": "Incident Report Document",
"status": "Valid"
},
"doctypeOthers": "None",
"generic": false
},
{
"id": "2c9f96ae7ab49230017ab4b7cd4f004c",
"fileDetail": {
"id": "2c9f96ae7ab49230017ab4b7c5490047",
"name": "383bc770-73e4-43ce-9108-8eb4a468a754.jpeg",
"size": 15482,
"url": "https://report-media-storage-bucket.s3.us-east-2.amazonaws.com/383bc770-73e4-43ce-9108-8eb4a468a754.jpeg",
"format": "image/jpeg"
},
"description": "Incident Report Document",
"type": {
"id": "2c9f96ae7ab49230017ab4b7cd4f004d",
"name": "Incident Report Document",
"description": "Incident Report Document",
"status": "Valid"
},
"doctypeOthers": "None",
"generic": false
},
{
"id": "2c9f96ae7ab49230017ab4b7cd89004e",
"fileDetail": {
"id": "2c9f96ae7ab49230017ab4b7c5550048",
"name": "fbb9c448-5bbb-49aa-939e-61a7c312e31a.jpeg",
"size": 297016,
"url": "https://report-media-storage-bucket.s3.us-east-2.amazonaws.com/fbb9c448-5bbb-49aa-939e-61a7c312e31a.jpeg",
"format": "image/jpeg"
},
"description": "Incident Report Document",
"type": {
"id": "2c9f96ae7ab49230017ab4b7cd89004f",
"name": "Incident Report Document",
"description": "Incident Report Document",
"status": "Valid"
},
"doctypeOthers": "None",
"generic": false
}
]
},
{
"id": "2c9f96ae7abd3080017abd3a7206001b",
"shift": {
"id": "2c9f96ae7abd3080017abd36bb1a0001",
"name": "Akrs nagar 2021-07-19",
"startDateTime": "2021-07-19T05:00:00Z",
"endDateTime": "2021-07-19T05:30:00Z",
"client": {
"id": "14c85653757a4def01757d87c791005c",
"name": "Swayaan Office",
"avatarUrl": "https://report-media-storage-bucket.s3.us-east-2.amazonaws.com/3bhta.png",
"location_id": "14c85653757a4def01757dfce9fd0073",
"location_name": "Akrs nagar",
"client_name": "Swayaan"
},
"officer": null,
"status": "STARTED"
},
"name": "Akrs nagar 19th Jul 2021",
"description": "incident report emial test",
"status": "PUBLISH",
"dateTime": "2021-07-19T05:26:28.864482Z",
"documents": []
},
{
"id": "2c9f96ae7abd3080017ae680955d0077",
"shift": {
"id": "2c9f96ae7abd3080017ae67b17540050",
"name": "Akrs nagar 2021-07-27",
"startDateTime": "2021-07-27T05:30:00Z",
"endDateTime": "2021-07-27T06:00:00Z",
"client": {
"id": "14c85653757a4def01757d87c791005c",
"name": "Swayaan Office",
"avatarUrl": "https://report-media-storage-bucket.s3.us-east-2.amazonaws.com/3bhta.png",
"location_id": "14c85653757a4def01757dfce9fd0073",
"location_name": "Akrs nagar",
"client_name": "Swayaan"
},
"officer": null,
"status": "COMPLETED"
},
"name": "Akrs nagar 27th Jul 2021",
"description": "incident reprot ",
"status": "PUBLISH",
"dateTime": "2021-07-27T05:47:16.559034Z",
"documents": [
{
"id": "2c9f96ae7abd3080017ae68099080078",
"fileDetail": {
"id": "2c9f96ae7abd3080017ae68092cb0076",
"name": "4c29028a-2b34-4dea-9fcc-9ffd20c6cd7a.pdf",
"size": 3028,
"url": "https://report-media-storage-bucket.s3.us-east-2.amazonaws.com/4c29028a-2b34-4dea-9fcc-9ffd20c6cd7a.pdf",
"format": "application/pdf"
},
"description": "Incident Report Document",
"type": {
"id": "2c9f96ae7abd3080017ae68099080079",
"name": "Incident Report Document",
"description": "Incident Report Document",
"status": "Valid"
},
"doctypeOthers": "None",
"generic": false
}
]
}
],
"totalPages": 5,
"currentPage": 0
}Fetch incident reports by id
GET /api/v1/mobile/officers/{{officer}}/incidentreports/{{incident report id}}
Authorization: Bearer token
Response
{
"id": "2c9f96ae7ab49230017ab4b7c7c60049",
"shift": {
"id": "2c9f96ae7ab49230017ab4ab822d001d",
"name": "akrs nagar 2021-07-17",
"startDateTime": "2021-07-17T13:35:00Z",
"endDateTime": "2021-07-17T13:50:00Z",
"client": {
"id": "14c85653757a4def01757d87c791005c",
"name": "Swayaan Office",
"avatarUrl": "https://report-media-storage-bucket.s3.us-east-2.amazonaws.com/3bhta.png",
"location_id": "14c85653757a4def01757dfce9fd0073",
"location_name": "Akrs nagar",
"client_name": "Swayaan"
},
"officer": null,
"status": "COMPLETED"
},
"name": "akrs nagar 17th Jul 2021",
"description": "report desc",
"status": "PUBLISH",
"dateTime": "2021-07-17T13:46:20.986463Z",
"documents": [
{
"id": "2c9f96ae7ab49230017ab4b7cc0a004a",
"fileDetail": {
"id": "2c9f96ae7ab49230017ab4b7c53d0046",
"name": "3eba349f-4040-4732-8f9a-1f6a1752948a.jpeg",
"size": 9009,
"url": "https://report-media-storage-bucket.s3.us-east-2.amazonaws.com/3eba349f-4040-4732-8f9a-1f6a1752948a.jpeg",
"format": "image/jpeg"
},
"description": "Incident Report Document",
"type": {
"id": "2c9f96ae7ab49230017ab4b7cc0a004b",
"name": "Incident Report Document",
"description": "Incident Report Document",
"status": "Valid"
},
"doctypeOthers": "None",
"generic": false
},
{
"id": "2c9f96ae7ab49230017ab4b7cd4f004c",
"fileDetail": {
"id": "2c9f96ae7ab49230017ab4b7c5490047",
"name": "383bc770-73e4-43ce-9108-8eb4a468a754.jpeg",
"size": 15482,
"url": "https://report-media-storage-bucket.s3.us-east-2.amazonaws.com/383bc770-73e4-43ce-9108-8eb4a468a754.jpeg",
"format": "image/jpeg"
},
"description": "Incident Report Document",
"type": {
"id": "2c9f96ae7ab49230017ab4b7cd4f004d",
"name": "Incident Report Document",
"description": "Incident Report Document",
"status": "Valid"
},
"doctypeOthers": "None",
"generic": false
},
{
"id": "2c9f96ae7ab49230017ab4b7cd89004e",
"fileDetail": {
"id": "2c9f96ae7ab49230017ab4b7c5550048",
"name": "fbb9c448-5bbb-49aa-939e-61a7c312e31a.jpeg",
"size": 297016,
"url": "https://report-media-storage-bucket.s3.us-east-2.amazonaws.com/fbb9c448-5bbb-49aa-939e-61a7c312e31a.jpeg",
"format": "image/jpeg"
},
"description": "Incident Report Document",
"type": {
"id": "2c9f96ae7ab49230017ab4b7cd89004f",
"name": "Incident Report Document",
"description": "Incident Report Document",
"status": "Valid"
},
"doctypeOthers": "None",
"generic": false
}
]
}create incident report
POST /api/v1/mobile/officers/{{officer id}}/shifts/{{shift id}}/incidentreports
Authorization: Bearer token
For adding media to this report, we need to make api call to file upload api first and then create an incident report document
Body
{
"name":"Shift Incident Report 3",
"description":"Shift Incident Report 3"
}Response
{
"isSuccessful": true,
"responseText": "Successfully Created"
}update incident report
PUT /api/v1/mobile/officers/{{officer}}/shifts/{{shift id}}/incidentreports/{{incident report id}}
Authorization: Bearer token
Body
{
"name":"Shift Incident Report name Update",
"description":"Shift Incident Report Description Update"
}Response
{
"isSuccessful": true,
"responseText": "Successfully Updated"
}publish incident report
POST /api/v1/mobile/officers/{{officer id}}/incidentreports/{{incident report id}}/publish
Response
{
"isSuccessful": true,
"responseText": "Successfully Published"
}delete incident report
DELETE /api/v1/mobile/officers/{{officer id}}/incidentreports/{{incident report id}}
Response
{
"isSuccessful": true,
"responseText": "Successfully Deleted"
}Daily report
Fetch dar reports
GET /api/v1/mobile/officers/{{officer}}/dailyreports
Authorization: Bearer token
Params
| pageNumber | number |
| sort | id,a |
| group | true |
| fromDate | timestamp |
| toDate | timestamp |
| pageSize | number |
Response
{
"totalItems": 14,
"items": [
{
"id": "2c9f96ae7ab49230017ab4b3096a002d",
"shift": {
"id": "2c9f96ae7ab49230017ab4ab822d001d",
"name": "akrs nagar 2021-07-17",
"startDateTime": "2021-07-17T13:35:00Z",
"endDateTime": "2021-07-17T13:50:00Z",
"client": {
"id": "14c85653757a4def01757d87c791005c",
"name": "Swayaan Office",
"avatarUrl": "https://report-media-storage-bucket.s3.us-east-2.amazonaws.com/3bhta.png",
"location_id": "14c85653757a4def01757dfce9fd0073",
"location_name": "Akrs nagar",
"client_name": "Swayaan"
},
"officer": null,
"status": "COMPLETED"
},
"name": "akrs nagar 17th Jul 2021",
"description": "dar desc",
"status": "PUBLISH",
"dateTime": "2021-07-17T13:45:43.683303Z",
"dailyReportInfos": [
{
"id": "2c9f96ae7ab49230017ab4b5ab320031",
"text": "Entry 1",
"description": "entry 1",
"dateTime": "2021-07-17T13:45:08.705408Z",
"documents": [
{
"id": "2c9f96ae7ab49230017ab4b5b2500032",
"fileDetail": {
"id": "2c9f96ae7ab49230017ab4b5a86c002e",
"name": "7d4a9938-71b3-4136-9d9d-8b69e2ff8782.jpeg",
"size": 9009,
"url": "https://report-media-storage-bucket.s3.us-east-2.amazonaws.com/7d4a9938-71b3-4136-9d9d-8b69e2ff8782.jpeg",
"format": "image/jpeg"
},
"description": "Daily Report Entry Document",
"type": {
"id": "2c9f96ae7ab49230017ab4b5b2510033",
"name": "Daily Report Entry Document",
"description": "Daily Report Entry Document",
"status": "Valid"
},
"doctypeOthers": "None",
"generic": false
},
{
"id": "2c9f96ae7ab49230017ab4b5b41e0034",
"fileDetail": {
"id": "2c9f96ae7ab49230017ab4b5a87c002f",
"name": "6ba50ada-5389-443a-a3f6-76734802d9c6.jpeg",
"size": 15482,
"url": "https://report-media-storage-bucket.s3.us-east-2.amazonaws.com/6ba50ada-5389-443a-a3f6-76734802d9c6.jpeg",
"format": "image/jpeg"
},
"description": "Daily Report Entry Document",
"type": {
"id": "2c9f96ae7ab49230017ab4b5b41e0035",
"name": "Daily Report Entry Document",
"description": "Daily Report Entry Document",
"status": "Valid"
},
"doctypeOthers": "None",
"generic": false
},
{
"id": "2c9f96ae7ab49230017ab4b5b4500036",
"fileDetail": {
"id": "2c9f96ae7ab49230017ab4b5a88c0030",
"name": "6adbdaa2-a43d-4523-9e2b-06048f7a7cd8.jpeg",
"size": 297016,
"url": "https://report-media-storage-bucket.s3.us-east-2.amazonaws.com/6adbdaa2-a43d-4523-9e2b-06048f7a7cd8.jpeg",
"format": "image/jpeg"
},
"description": "Daily Report Entry Document",
"type": {
"id": "2c9f96ae7ab49230017ab4b5b4500037",
"name": "Daily Report Entry Document",
"description": "Daily Report Entry Document",
"status": "Valid"
},
"doctypeOthers": "None",
"generic": false
},
{
"id": "2c9f96ae7ab49230017ab4b61d1c0039",
"fileDetail": {
"id": "2c9f96ae7ab49230017ab4b6197e0038",
"name": "526bb1b9-fdf3-484b-9693-7d1317691c53.mp4",
"size": 1570024,
"url": "https://report-media-storage-bucket.s3.us-east-2.amazonaws.com/526bb1b9-fdf3-484b-9693-7d1317691c53.mp4",
"format": "video/mp4"
},
"description": "Daily Report Entry Document",
"type": {
"id": "2c9f96ae7ab49230017ab4b61d1c003a",
"name": "Daily Report Entry Document",
"description": "Daily Report Entry Document",
"status": "Valid"
},
"doctypeOthers": "None",
"generic": false
},
{
"id": "2c9f96ae7ab49230017ab4b6574b003c",
"fileDetail": {
"id": "2c9f96ae7ab49230017ab4b65371003b",
"name": "31e3c3cb-d239-47b9-b35b-63f905c6b2e0.mp3",
"size": 764176,
"url": "https://report-media-storage-bucket.s3.us-east-2.amazonaws.com/31e3c3cb-d239-47b9-b35b-63f905c6b2e0.mp3",
"format": "audio/mpeg"
},
"description": "Daily Report Entry Document",
"type": {
"id": "2c9f96ae7ab49230017ab4b6574d003d",
"name": "Daily Report Entry Document",
"description": "Daily Report Entry Document",
"status": "Valid"
},
"doctypeOthers": "None",
"generic": false
},
{
"id": "2c9f96ae7ab49230017ab4b67fb1003f",
"fileDetail": {
"id": "2c9f96ae7ab49230017ab4b67b53003e",
"name": "e46bbf69-4f1d-4900-9de7-f17c1cd8fc02.pdf",
"size": 3028,
"url": "https://report-media-storage-bucket.s3.us-east-2.amazonaws.com/e46bbf69-4f1d-4900-9de7-f17c1cd8fc02.pdf",
"format": "application/pdf"
},
"description": "Daily Report Entry Document",
"type": {
"id": "2c9f96ae7ab49230017ab4b67fb10040",
"name": "Daily Report Entry Document",
"description": "Daily Report Entry Document",
"status": "Valid"
},
"doctypeOthers": "None",
"generic": false
}
]
},
{
"id": "2c9f96ae7ab49230017ab4b713260043",
"text": "Entry 2",
"description": "entry 2",
"dateTime": "2021-07-17T13:45:39.387512Z",
"documents": [
{
"id": "2c9f96ae7ab49230017ab4b716350044",
"fileDetail": {
"id": "2c9f96ae7ab49230017ab4b7105e0042",
"name": "a7c98488-ddc8-4597-955e-82c3ecf2297b.pdf",
"size": 3028,
"url": "https://report-media-storage-bucket.s3.us-east-2.amazonaws.com/a7c98488-ddc8-4597-955e-82c3ecf2297b.pdf",
"format": "application/pdf"
},
"description": "Daily Report Entry Document",
"type": {
"id": "2c9f96ae7ab49230017ab4b716350045",
"name": "Daily Report Entry Document",
"description": "Daily Report Entry Document",
"status": "Valid"
},
"doctypeOthers": "None",
"generic": false
}
]
}
]
},
{
"id": "2c9f96ae7abd3080017abd3e2aa90025",
"shift": {
"id": "2c9f96ae7abd3080017abd36bb1a0001",
"name": "Akrs nagar 2021-07-19",
"startDateTime": "2021-07-19T05:00:00Z",
"endDateTime": "2021-07-19T05:30:00Z",
"client": {
"id": "14c85653757a4def01757d87c791005c",
"name": "Swayaan Office",
"avatarUrl": "https://report-media-storage-bucket.s3.us-east-2.amazonaws.com/3bhta.png",
"location_id": "14c85653757a4def01757dfce9fd0073",
"location_name": "Akrs nagar",
"client_name": "Swayaan"
},
"officer": null,
"status": "STARTED"
},
"name": "Akrs nagar 19th Jul 2021",
"description": "dar descp",
"status": "PUBLISH",
"dateTime": "2021-07-19T05:31:38.18058Z",
"dailyReportInfos": [
{
"id": "2c9f96ae7abd3080017abd3e79ce0028",
"text": "Entry 1",
"description": "entry 1",
"dateTime": "2021-07-19T05:30:49.96835Z",
"documents": [
{
"id": "2c9f96ae7abd3080017abd3e7ec90029",
"fileDetail": {
"id": "2c9f96ae7abd3080017abd3e76450026",
"name": "6d70b593-605b-427a-b3d3-0d7e0c24aa4b.jpeg",
"size": 9009,
"url": "https://report-media-storage-bucket.s3.us-east-2.amazonaws.com/6d70b593-605b-427a-b3d3-0d7e0c24aa4b.jpeg",
"format": "image/jpeg"
},
"description": "Daily Report Entry Document",
"type": {
"id": "2c9f96ae7abd3080017abd3e7eca002a",
"name": "Daily Report Entry Document",
"description": "Daily Report Entry Document",
"status": "Valid"
},
"doctypeOthers": "None",
"generic": false
},
{
"id": "2c9f96ae7abd3080017abd3e8078002b",
"fileDetail": {
"id": "2c9f96ae7abd3080017abd3e76520027",
"name": "8862013d-9420-4164-b115-52f3100fd3dd.jpeg",
"size": 15482,
"url": "https://report-media-storage-bucket.s3.us-east-2.amazonaws.com/8862013d-9420-4164-b115-52f3100fd3dd.jpeg",
"format": "image/jpeg"
},
"description": "Daily Report Entry Document",
"type": {
"id": "2c9f96ae7abd3080017abd3e8078002c",
"name": "Daily Report Entry Document",
"description": "Daily Report Entry Document",
"status": "Valid"
},
"doctypeOthers": "None",
"generic": false
}
]
},
{
"id": "2c9f96ae7abd3080017abd3f1fae002e",
"text": "Entry 2",
"description": "entry 2",
"dateTime": "2021-07-19T05:31:14.476574Z",
"documents": [
{
"id": "2c9f96ae7abd3080017abd3f22be002f",
"fileDetail": {
"id": "2c9f96ae7abd3080017abd3f1cb4002d",
"name": "a163b88d-c8f9-413c-9907-57aa666503ad.pdf",
"size": 3028,
"url": "https://report-media-storage-bucket.s3.us-east-2.amazonaws.com/a163b88d-c8f9-413c-9907-57aa666503ad.pdf",
"format": "application/pdf"
},
"description": "Daily Report Entry Document",
"type": {
"id": "2c9f96ae7abd3080017abd3f22be0030",
"name": "Daily Report Entry Document",
"description": "Daily Report Entry Document",
"status": "Valid"
},
"doctypeOthers": "None",
"generic": false
}
]
},
{
"id": "2c9f96ae7abd3080017abd3f709d0031",
"text": "Entry 3",
"description": "entry 3",
"dateTime": "2021-07-19T05:31:29.306392Z",
"documents": []
}
]
},
{
"id": "2c9f96ae7abd3080017ae67de58a0067",
"shift": {
"id": "2c9f96ae7abd3080017ae67b17540050",
"name": "Akrs nagar 2021-07-27",
"startDateTime": "2021-07-27T05:30:00Z",
"endDateTime": "2021-07-27T06:00:00Z",
"client": {
"id": "14c85653757a4def01757d87c791005c",
"name": "Swayaan Office",
"avatarUrl": "https://report-media-storage-bucket.s3.us-east-2.amazonaws.com/3bhta.png",
"location_id": "14c85653757a4def01757dfce9fd0073",
"location_name": "Akrs nagar",
"client_name": "Swayaan"
},
"officer": null,
"status": "COMPLETED"
},
"name": "Akrs nagar 27th Jul 2021",
"description": "dar report 1",
"status": "PUBLISH",
"dateTime": "2021-07-27T05:46:24.421445Z",
"dailyReportInfos": [
{
"id": "2c9f96ae7abd3080017ae67e32d4006b",
"text": "Entry 1",
"description": "entry 1",
"dateTime": "2021-07-27T05:45:56.96345Z",
"documents": [
{
"id": "2c9f96ae7abd3080017ae67e3a92006c",
"fileDetail": {
"id": "2c9f96ae7abd3080017ae67e30190068",
"name": "3382a4c0-bd10-40b8-aa8e-9b7411a3f754.jpeg",
"size": 9009,
"url": "https://report-media-storage-bucket.s3.us-east-2.amazonaws.com/3382a4c0-bd10-40b8-aa8e-9b7411a3f754.jpeg",
"format": "image/jpeg"
},
"description": "Daily Report Entry Document",
"type": {
"id": "2c9f96ae7abd3080017ae67e3a92006d",
"name": "Daily Report Entry Document",
"description": "Daily Report Entry Document",
"status": "Valid"
},
"doctypeOthers": "None",
"generic": false
},
{
"id": "2c9f96ae7abd3080017ae67e3bcb006e",
"fileDetail": {
"id": "2c9f96ae7abd3080017ae67e302e0069",
"name": "c0eb8d4d-01be-451c-9ebe-7a98d73901b3.jpeg",
"size": 15482,
"url": "https://report-media-storage-bucket.s3.us-east-2.amazonaws.com/c0eb8d4d-01be-451c-9ebe-7a98d73901b3.jpeg",
"format": "image/jpeg"
},
"description": "Daily Report Entry Document",
"type": {
"id": "2c9f96ae7abd3080017ae67e3bcb006f",
"name": "Daily Report Entry Document",
"description": "Daily Report Entry Document",
"status": "Valid"
},
"doctypeOthers": "None",
"generic": false
},
{
"id": "2c9f96ae7abd3080017ae67e3bf20070",
"fileDetail": {
"id": "2c9f96ae7abd3080017ae67e303f006a",
"name": "fe663f95-f1fa-40ab-b2fb-c129cf96baf6.jpeg",
"size": 297016,
"url": "https://report-media-storage-bucket.s3.us-east-2.amazonaws.com/fe663f95-f1fa-40ab-b2fb-c129cf96baf6.jpeg",
"format": "image/jpeg"
},
"description": "Daily Report Entry Document",
"type": {
"id": "2c9f96ae7abd3080017ae67e3bf30071",
"name": "Daily Report Entry Document",
"description": "Daily Report Entry Document",
"status": "Valid"
},
"doctypeOthers": "None",
"generic": false
},
{
"id": "2c9f96ae7abd3080017ae67e97070073",
"fileDetail": {
"id": "2c9f96ae7abd3080017ae67e92df0072",
"name": "3d8bf68e-d079-420e-a711-d34079dd1aca.mp4",
"size": 1570024,
"url": "https://report-media-storage-bucket.s3.us-east-2.amazonaws.com/3d8bf68e-d079-420e-a711-d34079dd1aca.mp4",
"format": "video/mp4"
},
"description": "Daily Report Entry Document",
"type": {
"id": "2c9f96ae7abd3080017ae67e97070074",
"name": "Daily Report Entry Document",
"description": "Daily Report Entry Document",
"status": "Valid"
},
"doctypeOthers": "None",
"generic": false
}
]
},
{
"id": "2c9f96ae7abd3080017ae67fe45e0075",
"text": "Entry 2",
"description": "entry 2",
"dateTime": "2021-07-27T05:46:19.099298Z",
"documents": []
}
]
}
],
"totalPages": 5,
"currentPage": 0
}Fetch dar reports by id
GET /api/v1/mobile/officers/{{officer}}/dailyreports/{{daily report id}}
Authorization: Bearer token
Response
{
"id": "2c9f96ae7ab49230017ab4b3096a002d",
"shift": {
"id": "2c9f96ae7ab49230017ab4ab822d001d",
"name": "akrs nagar 2021-07-17",
"startDateTime": "2021-07-17T13:35:00Z",
"endDateTime": "2021-07-17T13:50:00Z",
"client": {
"id": "14c85653757a4def01757d87c791005c",
"name": "Swayaan Office",
"avatarUrl": "https://report-media-storage-bucket.s3.us-east-2.amazonaws.com/3bhta.png",
"location_id": "14c85653757a4def01757dfce9fd0073",
"location_name": "Akrs nagar",
"client_name": "Swayaan"
},
"officer": null,
"status": "COMPLETED"
},
"name": "akrs nagar 17th Jul 2021",
"description": "dar desc",
"status": "PUBLISH",
"dateTime": "2021-07-17T13:45:43.683303Z",
"dailyReportInfos": [
{
"id": "2c9f96ae7ab49230017ab4b5ab320031",
"text": "Entry 1",
"description": "entry 1",
"dateTime": "2021-07-17T13:45:08.705408Z",
"documents": [
{
"id": "2c9f96ae7ab49230017ab4b5b2500032",
"fileDetail": {
"id": "2c9f96ae7ab49230017ab4b5a86c002e",
"name": "7d4a9938-71b3-4136-9d9d-8b69e2ff8782.jpeg",
"size": 9009,
"url": "https://report-media-storage-bucket.s3.us-east-2.amazonaws.com/7d4a9938-71b3-4136-9d9d-8b69e2ff8782.jpeg",
"format": "image/jpeg"
},
"description": "Daily Report Entry Document",
"type": {
"id": "2c9f96ae7ab49230017ab4b5b2510033",
"name": "Daily Report Entry Document",
"description": "Daily Report Entry Document",
"status": "Valid"
},
"doctypeOthers": "None",
"generic": false
},
{
"id": "2c9f96ae7ab49230017ab4b5b41e0034",
"fileDetail": {
"id": "2c9f96ae7ab49230017ab4b5a87c002f",
"name": "6ba50ada-5389-443a-a3f6-76734802d9c6.jpeg",
"size": 15482,
"url": "https://report-media-storage-bucket.s3.us-east-2.amazonaws.com/6ba50ada-5389-443a-a3f6-76734802d9c6.jpeg",
"format": "image/jpeg"
},
"description": "Daily Report Entry Document",
"type": {
"id": "2c9f96ae7ab49230017ab4b5b41e0035",
"name": "Daily Report Entry Document",
"description": "Daily Report Entry Document",
"status": "Valid"
},
"doctypeOthers": "None",
"generic": false
},
{
"id": "2c9f96ae7ab49230017ab4b5b4500036",
"fileDetail": {
"id": "2c9f96ae7ab49230017ab4b5a88c0030",
"name": "6adbdaa2-a43d-4523-9e2b-06048f7a7cd8.jpeg",
"size": 297016,
"url": "https://report-media-storage-bucket.s3.us-east-2.amazonaws.com/6adbdaa2-a43d-4523-9e2b-06048f7a7cd8.jpeg",
"format": "image/jpeg"
},
"description": "Daily Report Entry Document",
"type": {
"id": "2c9f96ae7ab49230017ab4b5b4500037",
"name": "Daily Report Entry Document",
"description": "Daily Report Entry Document",
"status": "Valid"
},
"doctypeOthers": "None",
"generic": false
},
{
"id": "2c9f96ae7ab49230017ab4b61d1c0039",
"fileDetail": {
"id": "2c9f96ae7ab49230017ab4b6197e0038",
"name": "526bb1b9-fdf3-484b-9693-7d1317691c53.mp4",
"size": 1570024,
"url": "https://report-media-storage-bucket.s3.us-east-2.amazonaws.com/526bb1b9-fdf3-484b-9693-7d1317691c53.mp4",
"format": "video/mp4"
},
"description": "Daily Report Entry Document",
"type": {
"id": "2c9f96ae7ab49230017ab4b61d1c003a",
"name": "Daily Report Entry Document",
"description": "Daily Report Entry Document",
"status": "Valid"
},
"doctypeOthers": "None",
"generic": false
},
{
"id": "2c9f96ae7ab49230017ab4b6574b003c",
"fileDetail": {
"id": "2c9f96ae7ab49230017ab4b65371003b",
"name": "31e3c3cb-d239-47b9-b35b-63f905c6b2e0.mp3",
"size": 764176,
"url": "https://report-media-storage-bucket.s3.us-east-2.amazonaws.com/31e3c3cb-d239-47b9-b35b-63f905c6b2e0.mp3",
"format": "audio/mpeg"
},
"description": "Daily Report Entry Document",
"type": {
"id": "2c9f96ae7ab49230017ab4b6574d003d",
"name": "Daily Report Entry Document",
"description": "Daily Report Entry Document",
"status": "Valid"
},
"doctypeOthers": "None",
"generic": false
},
{
"id": "2c9f96ae7ab49230017ab4b67fb1003f",
"fileDetail": {
"id": "2c9f96ae7ab49230017ab4b67b53003e",
"name": "e46bbf69-4f1d-4900-9de7-f17c1cd8fc02.pdf",
"size": 3028,
"url": "https://report-media-storage-bucket.s3.us-east-2.amazonaws.com/e46bbf69-4f1d-4900-9de7-f17c1cd8fc02.pdf",
"format": "application/pdf"
},
"description": "Daily Report Entry Document",
"type": {
"id": "2c9f96ae7ab49230017ab4b67fb10040",
"name": "Daily Report Entry Document",
"description": "Daily Report Entry Document",
"status": "Valid"
},
"doctypeOthers": "None",
"generic": false
}
]
},
{
"id": "2c9f96ae7ab49230017ab4b713260043",
"text": "Entry 2",
"description": "entry 2",
"dateTime": "2021-07-17T13:45:39.387512Z",
"documents": [
{
"id": "2c9f96ae7ab49230017ab4b716350044",
"fileDetail": {
"id": "2c9f96ae7ab49230017ab4b7105e0042",
"name": "a7c98488-ddc8-4597-955e-82c3ecf2297b.pdf",
"size": 3028,
"url": "https://report-media-storage-bucket.s3.us-east-2.amazonaws.com/a7c98488-ddc8-4597-955e-82c3ecf2297b.pdf",
"format": "application/pdf"
},
"description": "Daily Report Entry Document",
"type": {
"id": "2c9f96ae7ab49230017ab4b716350045",
"name": "Daily Report Entry Document",
"description": "Daily Report Entry Document",
"status": "Valid"
},
"doctypeOthers": "None",
"generic": false
}
]
}
]
}create dar report
POST /api/v1/mobile/officers/{{officer id}}/shifts/{{shift id}}/dailyreports
Authorization: Bearer token
For adding entries to daily report, we need to make api call to daily report entries api and for adding media to each daily report entry we need to first upload using file upload api and then create an daily report entry document
Body
{
"name":"Shift Daily Report name",
"description":"Shift Daily Report Description"
}Response
{
"isSuccessful": true,
"responseText": "Successfully Created"
}update dar report
PUT /api/v1/mobile/officers/{{officer}}/shifts/{{shift id}}/dailyreports/{{daily report id}}
Authorization: Bearer token
Body
{
"name":"Shift Daily Report name",
"description":"Shift Daily Report Description"
}Response
{
"isSuccessful": true,
"responseText": "Successfully Created"
}publish dar report
POST /api/v1/mobile/officers/{{officer id}}/dailyreports/{{daily report id}}/publish
Response
{
"isSuccessful": true,
"responseText": "Successfully Published"
}delete dar report
DELETE /api/v1/mobile/officers/{{officer id}}/dailyreports/{{daily report id}}
Response
{
"isSuccessful": true,
"responseText": "Successfully Deleted"
}Daily report entry
Fetch dar entries
GET /api/v1/mobile/dailyreports/{{daily report id}/dailyreportinfos
We can fetch entries of a daily report only
Authorization: Bearer token
Response
{
"totalItems": 2,
"items": [
{
"id": "2c9f96ae7ab49230017ab4b5ab320031",
"text": "Entry 1",
"description": "entry 1",
"dateTime": "2021-07-17T13:45:08.705408Z",
"documents": [
{
"id": "2c9f96ae7ab49230017ab4b5b2500032",
"fileDetail": {
"id": "2c9f96ae7ab49230017ab4b5a86c002e",
"name": "7d4a9938-71b3-4136-9d9d-8b69e2ff8782.jpeg",
"size": 9009,
"url": "https://report-media-storage-bucket.s3.us-east-2.amazonaws.com/7d4a9938-71b3-4136-9d9d-8b69e2ff8782.jpeg",
"format": "image/jpeg"
},
"description": "Daily Report Entry Document",
"type": {
"id": "2c9f96ae7ab49230017ab4b5b2510033",
"name": "Daily Report Entry Document",
"description": "Daily Report Entry Document",
"status": "Valid"
},
"doctypeOthers": "None",
"generic": false
},
{
"id": "2c9f96ae7ab49230017ab4b5b41e0034",
"fileDetail": {
"id": "2c9f96ae7ab49230017ab4b5a87c002f",
"name": "6ba50ada-5389-443a-a3f6-76734802d9c6.jpeg",
"size": 15482,
"url": "https://report-media-storage-bucket.s3.us-east-2.amazonaws.com/6ba50ada-5389-443a-a3f6-76734802d9c6.jpeg",
"format": "image/jpeg"
},
"description": "Daily Report Entry Document",
"type": {
"id": "2c9f96ae7ab49230017ab4b5b41e0035",
"name": "Daily Report Entry Document",
"description": "Daily Report Entry Document",
"status": "Valid"
},
"doctypeOthers": "None",
"generic": false
},
{
"id": "2c9f96ae7ab49230017ab4b5b4500036",
"fileDetail": {
"id": "2c9f96ae7ab49230017ab4b5a88c0030",
"name": "6adbdaa2-a43d-4523-9e2b-06048f7a7cd8.jpeg",
"size": 297016,
"url": "https://report-media-storage-bucket.s3.us-east-2.amazonaws.com/6adbdaa2-a43d-4523-9e2b-06048f7a7cd8.jpeg",
"format": "image/jpeg"
},
"description": "Daily Report Entry Document",
"type": {
"id": "2c9f96ae7ab49230017ab4b5b4500037",
"name": "Daily Report Entry Document",
"description": "Daily Report Entry Document",
"status": "Valid"
},
"doctypeOthers": "None",
"generic": false
},
{
"id": "2c9f96ae7ab49230017ab4b61d1c0039",
"fileDetail": {
"id": "2c9f96ae7ab49230017ab4b6197e0038",
"name": "526bb1b9-fdf3-484b-9693-7d1317691c53.mp4",
"size": 1570024,
"url": "https://report-media-storage-bucket.s3.us-east-2.amazonaws.com/526bb1b9-fdf3-484b-9693-7d1317691c53.mp4",
"format": "video/mp4"
},
"description": "Daily Report Entry Document",
"type": {
"id": "2c9f96ae7ab49230017ab4b61d1c003a",
"name": "Daily Report Entry Document",
"description": "Daily Report Entry Document",
"status": "Valid"
},
"doctypeOthers": "None",
"generic": false
},
{
"id": "2c9f96ae7ab49230017ab4b6574b003c",
"fileDetail": {
"id": "2c9f96ae7ab49230017ab4b65371003b",
"name": "31e3c3cb-d239-47b9-b35b-63f905c6b2e0.mp3",
"size": 764176,
"url": "https://report-media-storage-bucket.s3.us-east-2.amazonaws.com/31e3c3cb-d239-47b9-b35b-63f905c6b2e0.mp3",
"format": "audio/mpeg"
},
"description": "Daily Report Entry Document",
"type": {
"id": "2c9f96ae7ab49230017ab4b6574d003d",
"name": "Daily Report Entry Document",
"description": "Daily Report Entry Document",
"status": "Valid"
},
"doctypeOthers": "None",
"generic": false
},
{
"id": "2c9f96ae7ab49230017ab4b67fb1003f",
"fileDetail": {
"id": "2c9f96ae7ab49230017ab4b67b53003e",
"name": "e46bbf69-4f1d-4900-9de7-f17c1cd8fc02.pdf",
"size": 3028,
"url": "https://report-media-storage-bucket.s3.us-east-2.amazonaws.com/e46bbf69-4f1d-4900-9de7-f17c1cd8fc02.pdf",
"format": "application/pdf"
},
"description": "Daily Report Entry Document",
"type": {
"id": "2c9f96ae7ab49230017ab4b67fb10040",
"name": "Daily Report Entry Document",
"description": "Daily Report Entry Document",
"status": "Valid"
},
"doctypeOthers": "None",
"generic": false
}
],
"dailyReport": {
"id": null,
"shiftId": "2c9f96ae7ab49230017ab4ab822d001d",
"name": "akrs nagar 17th Jul 2021",
"description": "dar desc"
}
},
{
"id": "2c9f96ae7ab49230017ab4b713260043",
"text": "Entry 2",
"description": "entry 2",
"dateTime": "2021-07-17T13:45:39.387512Z",
"documents": [
{
"id": "2c9f96ae7ab49230017ab4b716350044",
"fileDetail": {
"id": "2c9f96ae7ab49230017ab4b7105e0042",
"name": "a7c98488-ddc8-4597-955e-82c3ecf2297b.pdf",
"size": 3028,
"url": "https://report-media-storage-bucket.s3.us-east-2.amazonaws.com/a7c98488-ddc8-4597-955e-82c3ecf2297b.pdf",
"format": "application/pdf"
},
"description": "Daily Report Entry Document",
"type": {
"id": "2c9f96ae7ab49230017ab4b716350045",
"name": "Daily Report Entry Document",
"description": "Daily Report Entry Document",
"status": "Valid"
},
"doctypeOthers": "None",
"generic": false
}
],
"dailyReport": {
"id": null,
"shiftId": "2c9f96ae7ab49230017ab4ab822d001d",
"name": "akrs nagar 17th Jul 2021",
"description": "dar desc"
}
}
],
"totalPages": 1,
"currentPage": 0
}Fetch dar entries by id
GET /api/v1/mobile/dailyreports/{{daily report id}}/dailyreportinfos/{{daily report entry id}}
Authorization: Bearer token
Response
{
"id": "2c9f96ae7ab49230017ab4b5ab320031",
"text": "Entry 1",
"description": "entry 1",
"dateTime": "2021-07-17T13:45:08.705408Z",
"documents": [
{
"id": "2c9f96ae7ab49230017ab4b5b2500032",
"fileDetail": {
"id": "2c9f96ae7ab49230017ab4b5a86c002e",
"name": "7d4a9938-71b3-4136-9d9d-8b69e2ff8782.jpeg",
"size": 9009,
"url": "https://report-media-storage-bucket.s3.us-east-2.amazonaws.com/7d4a9938-71b3-4136-9d9d-8b69e2ff8782.jpeg",
"format": "image/jpeg"
},
"description": "Daily Report Entry Document",
"type": {
"id": "2c9f96ae7ab49230017ab4b5b2510033",
"name": "Daily Report Entry Document",
"description": "Daily Report Entry Document",
"status": "Valid"
},
"doctypeOthers": "None",
"generic": false
},
{
"id": "2c9f96ae7ab49230017ab4b5b41e0034",
"fileDetail": {
"id": "2c9f96ae7ab49230017ab4b5a87c002f",
"name": "6ba50ada-5389-443a-a3f6-76734802d9c6.jpeg",
"size": 15482,
"url": "https://report-media-storage-bucket.s3.us-east-2.amazonaws.com/6ba50ada-5389-443a-a3f6-76734802d9c6.jpeg",
"format": "image/jpeg"
},
"description": "Daily Report Entry Document",
"type": {
"id": "2c9f96ae7ab49230017ab4b5b41e0035",
"name": "Daily Report Entry Document",
"description": "Daily Report Entry Document",
"status": "Valid"
},
"doctypeOthers": "None",
"generic": false
},
{
"id": "2c9f96ae7ab49230017ab4b5b4500036",
"fileDetail": {
"id": "2c9f96ae7ab49230017ab4b5a88c0030",
"name": "6adbdaa2-a43d-4523-9e2b-06048f7a7cd8.jpeg",
"size": 297016,
"url": "https://report-media-storage-bucket.s3.us-east-2.amazonaws.com/6adbdaa2-a43d-4523-9e2b-06048f7a7cd8.jpeg",
"format": "image/jpeg"
},
"description": "Daily Report Entry Document",
"type": {
"id": "2c9f96ae7ab49230017ab4b5b4500037",
"name": "Daily Report Entry Document",
"description": "Daily Report Entry Document",
"status": "Valid"
},
"doctypeOthers": "None",
"generic": false
},
{
"id": "2c9f96ae7ab49230017ab4b61d1c0039",
"fileDetail": {
"id": "2c9f96ae7ab49230017ab4b6197e0038",
"name": "526bb1b9-fdf3-484b-9693-7d1317691c53.mp4",
"size": 1570024,
"url": "https://report-media-storage-bucket.s3.us-east-2.amazonaws.com/526bb1b9-fdf3-484b-9693-7d1317691c53.mp4",
"format": "video/mp4"
},
"description": "Daily Report Entry Document",
"type": {
"id": "2c9f96ae7ab49230017ab4b61d1c003a",
"name": "Daily Report Entry Document",
"description": "Daily Report Entry Document",
"status": "Valid"
},
"doctypeOthers": "None",
"generic": false
},
{
"id": "2c9f96ae7ab49230017ab4b6574b003c",
"fileDetail": {
"id": "2c9f96ae7ab49230017ab4b65371003b",
"name": "31e3c3cb-d239-47b9-b35b-63f905c6b2e0.mp3",
"size": 764176,
"url": "https://report-media-storage-bucket.s3.us-east-2.amazonaws.com/31e3c3cb-d239-47b9-b35b-63f905c6b2e0.mp3",
"format": "audio/mpeg"
},
"description": "Daily Report Entry Document",
"type": {
"id": "2c9f96ae7ab49230017ab4b6574d003d",
"name": "Daily Report Entry Document",
"description": "Daily Report Entry Document",
"status": "Valid"
},
"doctypeOthers": "None",
"generic": false
},
{
"id": "2c9f96ae7ab49230017ab4b67fb1003f",
"fileDetail": {
"id": "2c9f96ae7ab49230017ab4b67b53003e",
"name": "e46bbf69-4f1d-4900-9de7-f17c1cd8fc02.pdf",
"size": 3028,
"url": "https://report-media-storage-bucket.s3.us-east-2.amazonaws.com/e46bbf69-4f1d-4900-9de7-f17c1cd8fc02.pdf",
"format": "application/pdf"
},
"description": "Daily Report Entry Document",
"type": {
"id": "2c9f96ae7ab49230017ab4b67fb10040",
"name": "Daily Report Entry Document",
"description": "Daily Report Entry Document",
"status": "Valid"
},
"doctypeOthers": "None",
"generic": false
}
],
"dailyReport": {
"id": null,
"shiftId": "2c9f96ae7ab49230017ab4ab822d001d",
"name": "akrs nagar 17th Jul 2021",
"description": "dar desc"
}
}create dar entry
POST /api/v1/mobile/dailyreports/{{daily report id}/dailyreportinfos
Authorization: Bearer token
For adding media to each daily report entry we need to first upload media using file upload api and then create a daily report entry document
Body
{
"text":"DailyReportEntry Text",
"description":"DailyReportEntry Description"
}Response
{
"isSuccessful": true,
"responseText": "Successfully Created"
}update dar entry
PUT /api/v1/mobile/dailyreports/{{daily report id}}/dailyreportinfos/{{daily report entry id}}
Authorization: Bearer token
Body
{
"text":"DailyReportEntry Text",
"description":"DailyReportEntry Description"
}Response
{
"isSuccessful": true,
"responseText": "Successfully Updated"
}delete dar entry
DELETE /api/v1/mobile/dailyreports/{{daily report id}/dailyreportinfos/{{daily report entry id}}
Response
{
"isSuccessful": true,
"responseText": "Successfully Deleted"
}Daily report document
Fetch dar documents
GET //api/v1/mobile/dailyreportdocuments
Authorization: Bearer token
Response
{
"totalItems": 13173,
"items": [
{
"id": "2c9f96ae7ab49230017ab4b5b2500032",
"fileDetail": {
"id": "2c9f96ae7ab49230017ab4b5a86c002e",
"name": "7d4a9938-71b3-4136-9d9d-8b69e2ff8782.jpeg",
"size": 9009,
"url": "https://report-media-storage-bucket.s3.us-east-2.amazonaws.com/7d4a9938-71b3-4136-9d9d-8b69e2ff8782.jpeg",
"format": "image/jpeg"
},
"description": "Daily Report Entry Document",
"type": {
"id": "2c9f96ae7ab49230017ab4b5b2510033",
"name": "Daily Report Entry Document",
"description": "Daily Report Entry Document",
"status": "Valid"
},
"doctypeOthers": "None",
"dailyReportInfoId": "2c9f96ae7ab49230017ab4b5ab320031",
"generic": false
},
{
"id": "2c9f96ae7ab49230017ab4b5b41e0034",
"fileDetail": {
"id": "2c9f96ae7ab49230017ab4b5a87c002f",
"name": "6ba50ada-5389-443a-a3f6-76734802d9c6.jpeg",
"size": 15482,
"url": "https://report-media-storage-bucket.s3.us-east-2.amazonaws.com/6ba50ada-5389-443a-a3f6-76734802d9c6.jpeg",
"format": "image/jpeg"
},
"description": "Daily Report Entry Document",
"type": {
"id": "2c9f96ae7ab49230017ab4b5b41e0035",
"name": "Daily Report Entry Document",
"description": "Daily Report Entry Document",
"status": "Valid"
},
"doctypeOthers": "None",
"dailyReportInfoId": "2c9f96ae7ab49230017ab4b5ab320031",
"generic": false
},
{
"id": "2c9f96ae7ab49230017ab4b5b4500036",
"fileDetail": {
"id": "2c9f96ae7ab49230017ab4b5a88c0030",
"name": "6adbdaa2-a43d-4523-9e2b-06048f7a7cd8.jpeg",
"size": 297016,
"url": "https://report-media-storage-bucket.s3.us-east-2.amazonaws.com/6adbdaa2-a43d-4523-9e2b-06048f7a7cd8.jpeg",
"format": "image/jpeg"
},
"description": "Daily Report Entry Document",
"type": {
"id": "2c9f96ae7ab49230017ab4b5b4500037",
"name": "Daily Report Entry Document",
"description": "Daily Report Entry Document",
"status": "Valid"
},
"doctypeOthers": "None",
"dailyReportInfoId": "2c9f96ae7ab49230017ab4b5ab320031",
"generic": false
}
],
"totalPages": 4391,
"currentPage": 0
}Fetch dar documents by id
GET /api/v1/mobile/dailyreportdocuments/{{daily report document id}}
Authorization: Bearer token
Response
{
"id": "2c9f96ae7ab49230017ab4b5b2500032",
"fileDetail": {
"id": "2c9f96ae7ab49230017ab4b5a86c002e",
"name": "7d4a9938-71b3-4136-9d9d-8b69e2ff8782.jpeg",
"size": 9009,
"url": "https://report-media-storage-bucket.s3.us-east-2.amazonaws.com/7d4a9938-71b3-4136-9d9d-8b69e2ff8782.jpeg",
"format": "image/jpeg"
},
"description": "Daily Report Entry Document",
"type": {
"id": "2c9f96ae7ab49230017ab4b5b2510033",
"name": "Daily Report Entry Document",
"description": "Daily Report Entry Document",
"status": "Valid"
},
"doctypeOthers": "None",
"dailyReportInfoId": "2c9f96ae7ab49230017ab4b5ab320031",
"generic": false
}create dar document
POST /api/v1/mobile/dailyreportdocuments
Authorization: Bearer token
For creating a daily report document, we need to first have daily report entry. And fileDetailId comes from response after calling file upload api
Body
{
"dailyReportInfoId":"2c927a8d74572a35017457e0ef0e001d",
"type":{
"name":"DL 1",
"description":"DL Description 1",
"status":"DL Status 1"
},
"fileDetailId":"2c927a8d74572a35017457e3fb16001f",
"description":"Document Description 1",
"doctypeOthers":"None 1",
"isGeneric":true
}Response
{
"isSuccessful": true,
"responseText": "Successfully Updated"
}update dar document
PUT /api/v1/mobile/dailyreportdocuments/{{daily report document id}}
Authorization: Bearer token
Body
{
"dailyReportInfoId":"2c927a8d74572a35017457e0ef0e001d",
"type":{
"name":"DL 1 Update",
"description":"DL Description 1 Update",
"status":"DL Status 1"
},
"fileDetailId":"2c927a8d74572a35017457e3fb16001f",
"description":"Document Description 1",
"doctypeOthers":"None 1",
"isGeneric":true
}Response
{
"isSuccessful": true,
"responseText": "Successfully Updated"
}delete dar document
DELETE /api/v1/mobile/dailyreportdocuments/{{daily report document}}
Response
{
"isSuccessful": true,
"responseText": "Successfully Updated"
}Incident report document
Fetch incident report documents
GET //api/v1/mobile/incidentreportdocuments
Authorization: Bearer token
Response
{
"totalItems": 21,
"items": [
{
"id": "2c9f96ae7ab49230017ab4b7cc0a004a",
"fileDetail": {
"id": "2c9f96ae7ab49230017ab4b7c53d0046",
"name": "3eba349f-4040-4732-8f9a-1f6a1752948a.jpeg",
"size": 9009,
"url": "https://report-media-storage-bucket.s3.us-east-2.amazonaws.com/3eba349f-4040-4732-8f9a-1f6a1752948a.jpeg",
"format": "image/jpeg"
},
"description": "Incident Report Document",
"type": {
"id": "2c9f96ae7ab49230017ab4b7cc0a004b",
"name": "Incident Report Document",
"description": "Incident Report Document",
"status": "Valid"
},
"doctypeOthers": "None",
"incidentReportId": "2c9f96ae7ab49230017ab4b7c7c60049",
"generic": false
},
{
"id": "2c9f96ae7ab49230017ab4b7cd4f004c",
"fileDetail": {
"id": "2c9f96ae7ab49230017ab4b7c5490047",
"name": "383bc770-73e4-43ce-9108-8eb4a468a754.jpeg",
"size": 15482,
"url": "https://report-media-storage-bucket.s3.us-east-2.amazonaws.com/383bc770-73e4-43ce-9108-8eb4a468a754.jpeg",
"format": "image/jpeg"
},
"description": "Incident Report Document",
"type": {
"id": "2c9f96ae7ab49230017ab4b7cd4f004d",
"name": "Incident Report Document",
"description": "Incident Report Document",
"status": "Valid"
},
"doctypeOthers": "None",
"incidentReportId": "2c9f96ae7ab49230017ab4b7c7c60049",
"generic": false
},
{
"id": "2c9f96ae7ab49230017ab4b7cd89004e",
"fileDetail": {
"id": "2c9f96ae7ab49230017ab4b7c5550048",
"name": "fbb9c448-5bbb-49aa-939e-61a7c312e31a.jpeg",
"size": 297016,
"url": "https://report-media-storage-bucket.s3.us-east-2.amazonaws.com/fbb9c448-5bbb-49aa-939e-61a7c312e31a.jpeg",
"format": "image/jpeg"
},
"description": "Incident Report Document",
"type": {
"id": "2c9f96ae7ab49230017ab4b7cd89004f",
"name": "Incident Report Document",
"description": "Incident Report Document",
"status": "Valid"
},
"doctypeOthers": "None",
"incidentReportId": "2c9f96ae7ab49230017ab4b7c7c60049",
"generic": false
}
],
"totalPages": 7,
"currentPage": 0
}Fetch incident report documents by id
GET /api/v1/mobile/incidentreportdocuments/{{incident report document id}}
Authorization: Bearer token
Response
{
"id": "2c9f96ae7ab49230017ab4b7cc0a004a",
"fileDetail": {
"id": "2c9f96ae7ab49230017ab4b7c53d0046",
"name": "3eba349f-4040-4732-8f9a-1f6a1752948a.jpeg",
"size": 9009,
"url": "https://report-media-storage-bucket.s3.us-east-2.amazonaws.com/3eba349f-4040-4732-8f9a-1f6a1752948a.jpeg",
"format": "image/jpeg"
},
"description": "Incident Report Document",
"type": {
"id": "2c9f96ae7ab49230017ab4b7cc0a004b",
"name": "Incident Report Document",
"description": "Incident Report Document",
"status": "Valid"
},
"doctypeOthers": "None",
"incidentReportId": "2c9f96ae7ab49230017ab4b7c7c60049",
"generic": false
}create incident report document
POST /api/v1/mobile/incidentreportdocuments
Authorization: Bearer token
For creating a incident report document, we need to first have incident report. And fileDetailId comes from response after calling file upload api
Body
{
"incidentReportId":"2c927a8d74582a4101745bd946bd007d",
"type":{
"name":"DL 1",
"description":"DL Description 1",
"status":"DL Status 1"
},
"fileDetailId":"2c927a8d74582a4101745bdb1a81007e",
"description":"Document Description 1",
"doctypeOthers":"None 1",
"isGeneric":true
}Response
{
"isSuccessful": true,
"responseText": "Successfully Created"
}update incident report document
PUT /api/v1/mobile/incidentreportdocuments/{{incident report document id}}
Authorization: Bearer token
Body
{
"incidentReportId":"2c927a8d74582a4101745bd946bd007d",
"type":{
"name":"DL 1",
"description":"DL Description 1",
"status":"DL Status 1"
},
"fileDetailId":"2c927a8d74582a4101745bdb1a81007e",
"description":"Document Description 1",
"doctypeOthers":"None 1",
"isGeneric":true
}Response
{
"isSuccessful": true,
"responseText": "Successfully Updated"
}delete incident report document
DELETE /api/v1/mobile/incidentreportdocuments/{{incident report document}}
Response
{
"isSuccessful": true,
"responseText": "Successfully Deleted"
}Officer contact
create officer contact
POST /api/v1/mobile/officers/{{officer id}}/contacts
Authorization: Bearer token
For creating a officer contact, we need to first have an officer. Offcier can have primary and emergency contacts. type field accepts either PRIMARY or EMERGENCY
Body
{
"emailId": "contact16@gmail.com",
"name": "Contact 16",
"phone": {
"type": "MOBILE",
"number": "9876543210"
},
"postalcode": "560024",
"relation": "WIFE",
"type": "PRIMARY"
}Response
{
"isSuccessful": true,
"responseText": "Successfully Created"
}update officer contact
PUT /api/v1/mobile/officers/{{officer id}}/contacts/{{officer contact id}}
Authorization: Bearer token
Body
{
"emailId": "contact16@gmail.com",
"name": "Contact 16",
"phone": {
"type": "MOBILE",
"number": "9876543210"
},
"postalcode": "560024",
"relation": "WIFE",
"type": "PRIMARY"
}Response
{
"isSuccessful": true,
"responseText": "Successfully Updated"
}delete officer contact
DELETE /api/v1/mobile/officers/{{officer id}}/contacts/{{officer contact id}}
Response
{
"isSuccessful": true,
"responseText": "Successfully Deleted"
}Officer documents
Fetch officer documents
GET /api/v1/mobile/officers/{{officer id}}/documents
Authorization: Bearer token
Response
{
"totalItems": 24,
"items": [
{
"id": "14c85653757a4def01757d3c24570014",
"fileDetail": {
"id": "14c85653757a4def01757d3b63980011",
"name": "z8bsg.png",
"size": 141073,
"url": "https://report-media-storage-bucket.s3.us-east-2.amazonaws.com/z8bsg.png",
"format": "image/png"
},
"description": "My Profile Image",
"type": {
"id": "14c85653757a4def01757d3c24570015",
"name": "avatar",
"description": "My Profile Picture",
"status": "Active"
},
"doctypeOthers": "None",
"generic": false
},
{
"id": "14c85653757a4def01757d3ea1e90019",
"fileDetail": {
"id": "14c85653757a4def01757d3dd6e90016",
"name": "25o0s.png",
"size": 124190,
"url": "https://report-media-storage-bucket.s3.us-east-2.amazonaws.com/25o0s.png",
"format": "image/png"
},
"description": "My Profile Image",
"type": {
"id": "14c85653757a4def01757d3ea1e9001a",
"name": "avatar",
"description": "My Profile Picture",
"status": "Active"
},
"doctypeOthers": "None",
"generic": false
},
{
"id": "14c85653757a4def01757d509ed60025",
"fileDetail": {
"id": "14c85653757a4def01757d508fb30023",
"name": "34z9l.png",
"size": 120802,
"url": "https://report-media-storage-bucket.s3.us-east-2.amazonaws.com/34z9l.png",
"format": "image/png"
},
"description": "My Profile Image",
"type": {
"id": "14c85653757a4def01757d509ed60026",
"name": "avatar",
"description": "My Profile Picture",
"status": "Active"
},
"doctypeOthers": "None",
"generic": false
}
],
"totalPages": 8,
"currentPage": 0
}Fetch officer document by id
GET /api/v1/mobile/officers/{{officer id}}/documents/{{document report id}}
Authorization: Bearer token
Response
{
"id": "14c85653757a4def01757d3c24570014",
"fileDetail": {
"id": "14c85653757a4def01757d3b63980011",
"name": "z8bsg.png",
"size": 141073,
"url": "https://report-media-storage-bucket.s3.us-east-2.amazonaws.com/z8bsg.png",
"format": "image/png"
},
"description": "My Profile Image",
"type": {
"id": "14c85653757a4def01757d3c24570015",
"name": "avatar",
"description": "My Profile Picture",
"status": "Active"
},
"doctypeOthers": "None",
"generic": false
}create officer document
POST /api/v1/mobile/officers/{{officer id}}/documents
Authorization: Bearer token
For creating a officer document, we need to first have an officer. First we need to upload a document to file upload api and attach the returned id ot fileDetailId field
Body
{
"type":{
"name":"avatar",
"description":"Profile pic",
"status":"Active"
},
"fileDetailId":"402880eb75b244d00175bae68b680007",
"description":"Document Description",
"doctypeOthers":"None",
"isGeneric":true
}Response
{
"isSuccessful": true,
"responseText": "Successfully Created"
}Update Officer Document
PUT /api/v1/mobile/officers/{{officer id}}/documents/{{document id}}
Authorization: Bearer token
Body
{
"type":{
"name":"avatar",
"description":"Profile pic",
"status":"Active"
},
"fileDetailId":"402880eb75b244d00175bae68b680007",
"description":"Document Description",
"doctypeOthers":"None",
"isGeneric":true
}Response
{
"isSuccessful": true,
"responseText": "Successfully Updated"
}Delete Officer document
DELETE /api/v1/mobile/officers/{{officer id}}/documents/{{document id}}
Response
{
"isSuccessful": true,
"responseText": "Successfully Deleted"
}Courtesy template
Fetch courtesy template by location ID
GET /api/v1/mobile/courtesytemplates?locationId={{location id}}
Note: location id is present in shift details. This api is called before creating courtesy report to check whether that location has a courtesy template or not.
Response
{
"id": "2c9f96ae7d98d298017e2816dae55614",
"name": "akrs nagar courtesy template",
"client": {
"id": "14c85653757a4def01757d87c791005c",
"name": "Swayaan Office",
"client_name": "Swayaan",
"avatarUrl": null
},
"location": {
"id": "14c85653757a4def01757dfce9fd0073",
"name": "Akrs nagar"
},
"fields": [
{
"id": "14c85653760ea81901761950df1b0010",
"name": "sky lounge",
"status": "ACTIVE"
},
{
"id": "14c85653760ea81901760eaa8d190004",
"name": "Access control devices fully functional",
"status": "ACTIVE"
},
{
"id": "14c85653760e8a1901760ea38f530001",
"name": "Club room secure",
"status": "ACTIVE"
},
{
"id": "14c85653760e8a1901760ea3236a0000",
"name": "Pool area secure",
"status": "ACTIVE"
}
],
"status": "ACTIVE"
}Notification
Fetch notifications
GET /api/v1/mobile/officers/{{officer id}}/notifications
Params
| pageSize | number |
| sort | dateTime, a |
Response
{
"totalItems": 46,
"items": [
{
"id": "2c9f96ae7ab49230017ab49e09c10011",
"userId": "14c85653757e5bab01757e717bba0000",
"title": "THERE IS A SHIFT FOR YOU",
"message": "07/17/2021 at akrs nagar client: Swayaan Office",
"dateTime": "2021-07-17T13:18:13.943674Z",
"avatarUrl": "https://report-media-storage-bucket.s3.amazonaws.com/9629cd7b-09cd-493b-adc7-9e5e788074cb.png",
"resource": "shift",
"viewed": false
},
{
"id": "2c9f96ae7ab49230017ab4abab210021",
"userId": "14c85653757e5bab01757e717bba0000",
"title": "THERE IS A SHIFT FOR YOU",
"message": "07/17/2021 at akrs nagar client: Swayaan Office",
"dateTime": "2021-07-17T13:33:07.232628Z",
"avatarUrl": "https://report-media-storage-bucket.s3.amazonaws.com/9629cd7b-09cd-493b-adc7-9e5e788074cb.png",
"resource": "shift",
"viewed": false
},
{
"id": "2c9f96ae7ab49230017ab4ad44b70023",
"userId": "14c85653757e5bab01757e717bba0000",
"title": "THERE IS A SHIFT FOR YOU",
"message": "07/17/2021 at akrs nagar client: Swayaan Office",
"dateTime": "2021-07-17T13:34:52.08472Z",
"avatarUrl": "https://report-media-storage-bucket.s3.amazonaws.com/9629cd7b-09cd-493b-adc7-9e5e788074cb.png",
"resource": "shift",
"viewed": false
}
],
"totalPages": 16,
"currentPage": 0
}Fetch notification by id
GET /api/v1/mobile/officers/{{officer id}}/notifications/{{notification id}}
Response
{
"id": "2c9f96ae7ab49230017ab49e09c10011",
"userId": "14c85653757e5bab01757e717bba0000",
"title": "THERE IS A SHIFT FOR YOU",
"message": "07/17/2021 at akrs nagar client: Swayaan Office",
"dateTime": "2021-07-17T13:18:13.943674Z",
"avatarUrl": "https://report-media-storage-bucket.s3.amazonaws.com/9629cd7b-09cd-493b-adc7-9e5e788074cb.png",
"resource": "shift",
"viewed": false
}Create notifications
POST /api/v1/mobile/officers/{{officer id}}/notifications
userId field is the officer id
Body
{
"text":"Shift Started 2",
"message":"Shift Started 2",
"userId":"0bbbd2cf7569ff1c01757ec9aee200d5"
}Response
{
"isSuccessful": true,
"responseText": "Successfully Created"
}Remote mobile cofiguration
GET /api/v1/mobile/config
Response
Response is in base64 encoded format. We will have to decode and then use it.
ew0KICJCQVNFX1VSTCI6ICJodHRwOi8vZWMyLTMtMTM2LTg2LTE1MS51cy1lYXN0LTIuY29tcHV0ZS5hbWF6b25hd3MuY29tOjkwOTAvYXBpL3YxL21vYmlsZSIsDQogIk1FRElBX1VSTCIgOiAiaHR0cDovL2VjMi0zLTEzNi04Ni0xNTEudXMtZWFzdC0yLmNvbXB1dGUuYW1hem9uYXdzLmNvbTo5MDkwL2FwaS92MS91cGxvYWQiLA0KICJDT01NT05fVVJMIiA6ICJodHRwOi8vZWMyLTMtMTM2LTg2LTE1MS51cy1lYXN0LTIuY29tcHV0ZS5hbWF6b25hd3MuY29tOjkwOTAvYXBpL3YxIiwNCiAiU0lHTl9JTiIgOiAiaHR0cDovL2VjMi0zLTEzNi04Ni0xNTEudXMtZWFzdC0yLmNvbXB1dGUuYW1hem9uYXdzLmNvbTo5MDkwL2FwaS92MS9vYXV0aDIvdG9rZW4iLA0KICJSRU5FV19UT0tFTiIgOiAiaHR0cDovL2VjMi0zLTEzNi04Ni0xNTEudXMtZWFzdC0yLmNvbXB1dGUuYW1hem9uYXdzLmNvbTo5MDkwL2FwaS92MS9vYXV0aDIvcmVuZXciLA0KICJGT1JHT1RfUEFTU1dPUkQiIDogImh0dHA6Ly9lYzItMy0xMzYtODYtMTUxLnVzLWVhc3QtMi5jb21wdXRlLmFtYXpvbmF3cy5jb206OTA5MC9hcGkvdjEvb2F1dGgyL2ZvcmdvdHBhc3N3b3JkIiwNCiAiUkVHSVNUUkFUSU9OIiA6ICJodHRwOi8vZWMyLTMtMTM2LTg2LTE1MS51cy1lYXN0LTIuY29tcHV0ZS5hbWF6b25hd3MuY29tOjkwOTAvYXBpL3YxL3VzZXIvcmVnaXN0ZXIiLA0KICJQQUdFX1NJWkUiIDogMjAwLA0KICJBQ0NFU1NfS0VZX0lEIjoiQUtJQVlQRUVVNTU1RklPRFpKRzUiLA0KICJTRUNSRVRfQUNDRVNTX0tFWSIgOiJub09YeGFzcmRMMlJ5SmZmdTNlZmpXRjc3YmxNNkVWOGJMYmhwaXpjIiwNCiAiQlVDS0VUIiA6InJlcG9ydC1tZWRpYS1zdG9yYWdlLWJ1Y2tldCIsDQogIlJFR0lPTiI6InVzLWVhc3QtMiINCn0=Base64 decoded format
{
"BASE_URL": "http://ec2-3-136-86-151.us-east-2.compute.amazonaws.com:9090/api/v1/mobile",
"MEDIA_URL" : "http://ec2-3-136-86-151.us-east-2.compute.amazonaws.com:9090/api/v1/upload",
"COMMON_URL" : "http://ec2-3-136-86-151.us-east-2.compute.amazonaws.com:9090/api/v1",
"SIGN_IN" : "http://ec2-3-136-86-151.us-east-2.compute.amazonaws.com:9090/api/v1/oauth2/token",
"RENEW_TOKEN" : "http://ec2-3-136-86-151.us-east-2.compute.amazonaws.com:9090/api/v1/oauth2/renew",
"FORGOT_PASSWORD" : "http://ec2-3-136-86-151.us-east-2.compute.amazonaws.com:9090/api/v1/oauth2/forgotpassword",
"REGISTRATION" : "http://ec2-3-136-86-151.us-east-2.compute.amazonaws.com:9090/api/v1/user/register",
"PAGE_SIZE" : 200,
"ACCESS_KEY_ID":"access key id",
"SECRET_ACCESS_KEY" :"secret access key",
"BUCKET" :"bucket name",
"REGION":"bucket region"
}Notification token
Add notification token
POST /api/v1/officers/{{officer id}}/notificationtokens
This api sets the fcm token we received from firebase to backend. Now backend will use this token to push notifications to that particular officer.
Body
{
"token":"123"
}Respnse
{
"isSuccessful": true,
"responseText": "Successfully Created"
}Delete notification token by id
DELETE /api/v1/officers/{{officer id}}/notificationtokens/{{notification token id}}
Notification token id is the one which backend returns while fetching tokens. Each token has its own unique id in the database.
Response
{
"isSuccessful": true,
"responseText": "Successfully Deleted"
}Fetch notification tokens
GET /api/v1/officers/{{officer id}}/notificationtokens
Params
| sort | dateTime, a |
Response
[
{
"id": "14c8565376ad2d210176b293eb920011",
"token": "cd8YTQeufEAOqEqmaH08gQ:APA91bFmph4VZTJ0eJBLtfx9X4SQnhklqHO9_kcD4qbpdqyPeEWsggIUFxzPOk7VBCvmBW1A48WTrq_KNjb8nVuPa51A_z9Kc38qqYXTLVPGhfOPoHGDzEUo69BwyX5iij_09UwVVv1e",
"dateTime": "2022-01-19T12:33:22.896824Z"
},
{
"id": "14c8565376ad2d210176b3131951001d",
"token": "eHz2Ik9ZDUB6uf-yq9tR4L:APA91bFrXEahru8dr3IaOQAjEC7NWYG_3fqHRNP9yPaXlKplFkKgbXGkP7L2GbpwpHMF1gnINH1RZTYXs2YH7pnYBDtIrLZaND5zCnSGwCc_lMYRghZYGEi25F57AP1kWzDjvHw-m29o",
"dateTime": "2022-01-19T12:33:22.897231Z"
},]Fetch notification tokens by id
GET /api/v1/officers/{{officer id}}/notificationtokens/{{notification token id}}
Response
{
"id": "14c8565376ad2d210176b293eb920011",
"token": "cd8YTQeufEAOqEqmaH08gQ:APA91bFmph4VZTJ0eJBLtfx9X4SQnhklqHO9_kcD4qbpdqyPeEWsggIUFxzPOk7VBCvmBW1A48WTrq_KNjb8nVuPa51A_z9Kc38qqYXTLVPGhfOPoHGDzEUo69BwyX5iij_09UwVVv1e",
"dateTime": "2022-01-19T12:33:22.896824Z"
},Update notification token by id
PUT /api/v1/officers/{{officer id}}/notificationtokens/{{notification token id}}
Body
{
"token":"xyz"
}Response
{
"isSuccessful": true,
"responseText": "Successfully Updated"
}Delete notification token by token
DELETE /api/v1/officers/{{officer id}}/notificationtokens?token={{notification token}}
This is used when we have just the token and not the token id. We can use to delete the token from database using the token itself
Response
{
"isSuccessful": true,
"responseText": "Successfully Deleted"
}File upload to AWS
Function to upload files to s3 and return file unique ids, which then are used to upload as report documents.
export const uploadS3 = async files => {
let config = await getConfig();
try {
AWS.config.update({
secretAccessKey: config.SECRET_ACCESS_KEY,
accessKeyId: config.ACCESS_KEY_ID,
region: config.REGION,
signatureVersion: 'v4', //API version
});
const s3 = new AWS.S3({signatureVersion: 'v4'});
let fileDetails = [];
await Promise.all(
files.map(async file => {
const base64 = await fs.readFile(file.uri, 'base64');
let arrayBuffer = Base64Binary.decode(base64);
let fileType = file.type;
let tempType = file.name.split('.');
tempType = tempType[tempType.length - 1];
const fileName = `${uuid.v4()}.${tempType}`;
const params = {
Key: fileName,
Bucket: config.BUCKET,
Body: arrayBuffer,
ContentType: fileType,
};
await new Promise((resolve, reject) => {
s3.upload(params, (err, uploadResp) => {
if (err) {
log.error(
'[action/index/uploadS3] file upload to s3 failed:',
err,
);
reject(err);
} else {
log.info(
'[action/index/uploadS3] file uploaded to s3 :',
uploadResp,
);
fileDetails.push({
name: uploadResp.Key,
url: uploadResp.Location,
format: file.type,
size: file.size,
});
log.info(
'file name after uploading to s3:',
uploadResp.key,
uploadResp.Key,
uploadResp.Location,
);
resolve(uploadResp);
}
});
});
}),
);
log.info('fileDetails in upload func:', fileDetails);
if (fileDetails.length) return fileDetails;
else return false;
} catch (error) {
log.error('[action/index/uploadFile] :', error);
return false;
// reject(false);
}
};Officer registration
POST /api/v1/user/register
This api is used to registering an officer from mobile end
agency is a string, it can be any agency that officer works for
Body
{
"name":"Chethan",
"emailId":"chetan@swa.com",
"number":"1234567890",
"agency":"Swayaan"
}Response
{
"isSuccessful": true,
"responseText": "Successfully Created"
}