Visit Plan
Create Visit Plan
Description
Create a visit plan, which can be linked when creating an IR task, to output more data.
Request Config
| Config | Definition |
|---|---|
| URL | /plan |
| Method | POST |
| Content-Type | application/json |
Request Body Schema
| Name | Type | Description | Required |
|---|---|---|---|
| store_code | string | Store code | Yes |
| username | string | User name,account name when logging in(Please see:User) | No |
| plan_start_time | int64 | Expected visit plan start time(millisecond timestamp) | No |
| plan_end_time | int64 | Expected visit plan end time(millisecond timestamp) | No |
| extra_info | string | Additional information about visit plan, 2000 chars maximum | No |
| longitude | float64 | Longitude, WGS84 | No |
| latitude | float64 | Latitude, WGS84 | No |
Request Body Sample
json
{
"store_code":"TEST001",
"username":"visitor_01",
"plan_start_time": 1677808307000,
"plan_end_time": 1677808407000,
"extra_info": "{\"name\":\"james\"}"
}Response
Schema of data
| Name | Type | Description |
|---|---|---|
| plan_id | string | Created plan id |
Request Body Sample
json
{
"code": 0,
"message": "",
"data": {
"plan_id": "P2207290611226274600"
}
}Update Visit Plan
Description
Update visit plan.
Request Config
| Config | Definition |
|---|---|
| URL | /plan/<plan_id> |
| Method | PUT |
| Content-Type | application/json |
Path
| Name | Type | Description | Required |
|---|---|---|---|
| plan_id | string | Created plan id | Yes |
Request Body Schema
| Name | Type | Description | Required |
|---|---|---|---|
| store_code | string | Store code | No |
| username | string | User name,account name when logging in(Please see:User) | No |
| plan_start_time | int64 | Expected visit plan start time(millisecond timestamp) | No |
| plan_end_time | int64 | Expected visit plan end time(millisecond timestamp) | No |
| extra_info | string | Additional information about visit plan, 2000 chars maximum | No |
| longitude | float64 | Longitude, WGS84 | No |
| latitude | float64 | Latitude, WGS84 | No |
Request Body Sample
json
{
"store_code":"TEST001",
"username":"visitor_01",
"plan_start_time": 1677808307000,
"plan_end_time": 1677808407000,
"extra_info": "{\"name\":\"james\"}"
}Response
Schema of data
| Name | Type | Description |
|---|---|---|
| plan_id | string | Created plan id |
Response Body Sample
json
{
"code": 0,
"message": "",
"data": {
"plan_id": "P2207290611226274600"
}
}Finish Visit Plan
Description
Finish visit plan.
Request Config
| Config | Definition |
|---|---|
| URL | /plan/<plan_id>/finish |
| Method | PUT |
| Content-Type | application/json |
Path
| Name | Type | Description | Required |
|---|---|---|---|
| plan_id | string | Created plan id | Yes |
Request Body Schema
| Name | Type | Description | Required |
|---|---|---|---|
| task_ids | []string | All task ids created under this plan. | Yes |
| finish_visit_time | int64 | Finish visit plan time(millisecond timestamp) | Yes |
| longitude | float64 | Longitude, WGS84 | No |
| latitude | float64 | Latitude, WGS84 | No |
| front_photos | []string | Front photos | No |
Request Body Sample
json
{
"task_ids":["f9a9b6c9-2b09-11f0-b69f-b8599fae14b3","03904e98-2b0a-11f0-b69f-b8599fae14b3"],
"finish_visit_time": 1746598310000,
"longitude": 102.7979,
"latitude": 17.4021
}Response
Schema of data
| Name | Type | Description |
|---|---|---|
| plan_id | string | Created plan id |
Response Body Sample
json
{
"code": 0,
"message": "",
"data": {
"plan_id": "P2207290611226274600"
}
}Get Visit Plan List
Description
Get visit plan list
Request Config
| Config | Definition |
|---|---|
| URL | /plan/list?page_index=1&page_size=100&plan_id=P2207290611226274600&store_code=TEST001&plan_start_time=1677808307000&plan_end_time=1677808407000&start_visit_time=1677808307000&end_visit_time=16778084070000 |
| Method | GET |
Params:
| Name | Type | Description | Required |
|---|---|---|---|
| page_index | int64 | Page index,default:1 | No |
| page_size | int64 | Page size,default 10,maximum 100 | No |
| plan_id | string | Plan id | No |
| store_code | string | Store code | No |
| plan_start_time | int64 | Expected visit plan start time(millisecond timestamp) | No |
| plan_end_time | int64 | Expected visit plan end time(millisecond timestamp) | No |
| start_visit_time | int64 | Visit plan start time(millisecond timestamp) | No |
| end_visit_time | int64 | Visit plan end time(millisecond timestamp) | No |
Response
Schema of data
| Name | Type | Description |
|---|---|---|
| total | long | Total visit plans |
| page | object | Page info |
| + index | int | Page index |
| + size | int | Page size |
| results | []object | Results |
| + plan_id | string | Plan id |
| + store | object | Store info |
| ++ code | string | Store code |
| ++ name | string | Store name |
| ++ address | string | Store address |
| + user | object | period info |
| ++ username | string | User name,account name when logging in |
| ++ real_name | string | Real name |
| + status | int32 | Visit plan status 0:Pending 1:Processing 2:Completed, 3:Failed, 4:Cancelled, 7:Expired |
| + longitude | float64 | Longitude when visiting the store, the coordinate system is WGS84 |
| + latitude | float64 | Latitude when visiting the store, the coordinate system is WGS84 |
| + start_visit_time | int64 | Visit plan start time(millisecond timestamp) |
| + end_visit_time | int64 | Visit plan end time(millisecond timestamp) |
| + start_time | int64 | Expected visit plan start time(millisecond timestamp) |
| + end_time | int64 | Expected visit plan end time(millisecond timestamp) |
| + tasks | []object | The corresponding task list of the visit plan |
| + + id | string | IR task id |
| + + task_name | string | Task name |
| + + status | string | Task status:PENDING,FAIL,SUCCESS |
| + + timeout | boolean | Whether the task timed out |
| + qnns | []object | The corresponding questionnaire list of the visit plan |
| + + id | string | Questionnaire task id |
| + + task_name | string | Task name |
| + + timeout | boolean | Whether the questionnaire timed out |
| + qualities | []object | Quality check of visit plan,please see Description of visit plan quality check indicators |
| + + id | string | Quality id |
| + + code | string | Quality code |
| + reason | string | The reason for canceling the visit plan. It is only valuable when the visit plan status is cancelled |
| + photos | []string | Evidence photos when the visit plan is cancelled, it is only valuable when the visit plan status is cancelled. |
| + quality_solutions | []object | The solution definitions after some quality issues occur in this plan, such as auto-rejected. |
| + + solution | string | The solution type. Currently defined is only "auto-rejected". May add more in future. |
| + + quality_ids | []string | The quality id list of which cause the quality solution. See quality id definition in Description of visit plan quality check indicators |
Response Body Sample
json
{
"code": 0,
"message": "",
"data": {
"total": 1000,
"page": {
"index": 1,
"size": 10
},
"results": [
{
"plan_id": "P2207290611226274600",
"store": {
"code": "TEST001",
"name": "Store name",
"address": "Lujiazui, Shanghai"
},
"user":{
"username": "testname",
"real_name": "John"
},
"status": 2,
"start_time": 1668478888000,
"end_time": 1700014888000,
"longitude": 121.42275,
"latitude": 31.230621,
"start_visit_time": 1668478888000,
"end_visit_time": 1700014888000,
"tasks": [
{
"id": "0005e8c6-7ddc-4672-9224-5e8b40b1585d",
"task_name": "KO Cooler",
"status": "SUCCESS",
"timeout": true
}
],
"qnns" : [
{
"id": "f5e0e040-1203-11ec-9808-1548c6183e34",
"task_name": "KO Cooler",
"timeout": false
}
],
"qualities": [
{
"id": "19",
"name": "Location Offset"
},
{
"id": "21",
"name": "Reuse"
},
{
"id": "23",
"name": "Irrelevant photo"
}
],
"reason": "Wrong store",
"photos": ["https://f-reaapi.clobotics.cn/v/d9d2f6e2dc34ced34d2d081e959e1030.jpg"],
"quality_solutions": [
{
"solution": "auto-rejected",
"quality_ids": ["21","23"]
}
]
}
]
}
}