# To-do Setting

##  To-do Setting List
Interface Request Invoking Description <br>
HTTP Request Method: POST <br>
Request Address: http://127.0.0.1:8080/demo/horizon/workflow/rest/agent/person/page${suffix} <br>
**Post Data Description：**
```
{
  "accessToken": "",
  "page": "1",
  "limit": "10",
  "sort": "flowName",
  "search": ""
}
```
Request Parameter Description:

| Parameter   | Required | Description                                                                                                                        |
|-------------|----------|------------------------------------------------------------------------------------------------------------------------------------|
| accessToken | Yes      | Invoking interface credentials, unique user ID                                                                                     |
| page        | No       | Page number, if blank, it means querying all data                                                                                  |
| limit       | No       | The number of data items displayed on each page. If it is blank, the default query is 10 items                                     |
| sort        | No       | Not required. If a minus sign is added before the field, such as sort=- flowName, it will be arranged in reverse order of flowName |
| search      | No       | Query process name and process type fields, default is empty, query all data by default                                            |
**Example of returned results：**
```
{
  "code": 0,
  "data": [
    {
      "agentUserId": "HZ28821856ef63420156ef6342a20003",
      "agentUserName": "User02",
      "beginDate": "2022-05-24 00:00:00",
      "endDate": "2022-05-31 23:59:59",
      "flowId": "test3",
      "flowName": "Newflowtest3",
      "id": "HZ28858f80b703d30180b7069c4c000b",
      "status": "Yes",
      "typeName": "www",
      "version": "2"
    },
    {
      "agentUserId": "",
      "agentUserName": "",
      "beginDate": "",
      "endDate": "",
      "flowId": "test2",
      "flowName": "Newflowtest2",
      "id": "",
      "status": "No",
      "typeName": "",
      "version": "1"
    }
  ],
  "message": "",
  "recordsTotal": "3",
  "success": true
}
```
**Result parameter description:**

| Parameter     | Type   | Description                                                                                                                                                                     |
|---------------|--------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| agentUserId   | String | Agent User ID                                                                                                                                                                   |
| agentUserName | String | Agent User Name                                                                                                                                                                 |
| beginDate     | String | Begin time  format：yyyy-MM-dd HH:mm:ss                                                                                                                                          |
| endDate       | String | End time format：yyyy-MM-dd HH:mm:ss ,The end time need to be greater than or equal to the start time                                                                            |
| flowId        | String | Flow id                                                                                                                                                                         |
| flowName      | String | Flow name                                                                                                                                                                       |
| id            | String | Data ID in the agent data table                                                                                                                                                 |
| status        | String | Has the agent been set?<br>Yes: has been set.<br>No: has not been set.<br>If it is not set, the id, the values  of beginDate, endDate, agentUserId, and agentUserName are empty |
| typeName      | String | Flow category                                                                                                                                                                   |
| version       | String | Flow version                                                                                                                                                                    |

## Agent setting operation
Interface Request Invoking Description <br>
HTTP Request Method: POST <br>
Request Address: http://127.0.0.1:8080/demo/horizon/workflow/rest/agent/operate/action${suffix} <br>
**Post Data Description：**
```
{
  "accessToken": "",
  "id": "test~Newflowtest",
  "agentId": "U_HZ28821856ef63420156ef6342a20002",
  "agentName": "User01",
  "startDate": "2022-05-12",
  "endDate": "2022-05-31",
  "moveTodo": "1",
  "noticeType": "SMS"
}
```
Request Parameter Description:

| Parameter   | Required | Description                                                                                                                                                                                                                                                |
|-------------|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| accessToken | Yes      | Invoking interface credentials, unique user ID                                                                                                                                                                                                             |
| id          | Yes      | Select the ID of the agent setting data, whose value is equal to the process ID~process name. If multiple data items are selected for agent setting, the ID values are separated by a semicolon. For example: test01~new process 01; Test02~New Process 02 |
| agentId     | Yes      | Agent ID                                                                                                                                                                                                                                                   |
| agentName   | Yes      | Name of agent                                                                                                                                                                                                                                              |
| startDate   | Yes      | Start date format：yyyy-MM-dd                                                                                                                                                                                                                               |
| endDate     | Yes      | End date format：yyyy-MM-dd                                                                                                                                                                                                                                 |
| moveTodo    | Yes      | Transfer existing to-do list: 1 indicates yes, 0 indicates no; By default, it is 1                                                                                                                                                                         |
| noticeType  | No       | SMS is a text message, Msg is a system message, IM is an instant message, and Mail is an email. The default<br>value is blank. If multiple choices are made, commas are used to separate them. For example：<br>Msg,SMS,IM                                  |
**Example of returned results：**
```
{
  "success": true,
  "code": 0,
  "message": "Set up agent successfully "
 }
```

## Cancel setting operation
Interface Request Invoking Description <br>
HTTP Request Method: POST <br>
Request Address: http://127.0.0.1:8080/demo/horizon/workflow/rest/agent/cancel/action${suffix} <br>
**Post Data Description：**
```
{
  "accessToken": "",
  "id": "test~HZ28858f80b77e670180b793dad70010 "
}
```
Request Parameter Description:

| Parameter   | Required | Description                                                                                                                                                                                                                                                                                                                                                  |
|-------------|----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| accessToken | Yes      | Invoking interface credentials, unique user ID                                                                                                                                                                                                                                                                                                               |
| id          | Yes      | Cancel the agent setting and select the identifier of the data. Its value is composed of flowId~dataId, where the data ID in the agent data table. If multiple data is selected to cancel the agent setting, the id values are separated by a semicolon. for example：<br>yyy00~HZ28868f5cc3367c015cc33abb4d000a;<br>yuwei33~HZ28868f5cc3367c015cc33abb4d000e |
**Example of returned results：**
```
{
  "success": true,
  "code": 0,
  "message": "Cancel agent successful"
}
```

## List of agent services
Interface Request Invoking Description <br>
HTTP Request Method: POST <br>
Request Address: http://127.0.0.1:8080/demo/horizon/workflow/rest/agent/page${suffix} <br>
**Post Data Description：**
```
{
  "accessToken": "",
  "requestType": "",
  "page": "1",
  "limit": "10",
  "sort": "flowName",
  "search": ""
}
```
Request Parameter Description:

| Parameter   | Required | Description                                                                                                                                   |
|-------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------|
| accessToken | Yes      | Invoking interface credentials, unique user ID                                                                                                |
| requestType | Yes      | Agent service name:'AgentTransfer' represents the query of agent transfer list,'AgentReceive' represents the query of agent work receipt list |
| page        | No       | Page number, if blank, it means querying all data                                                                                             |
| limit       | No       | The number of data items displayed on each page. If it is blank, the default query is 10 items                                                |
| sort        | No       | Not required. If a minus sign is added before the field, such as sort=- flowName, it will be arranged in reverse order of flowName            |
| search      | No       | The default query condition is empty, and all data is queried by default                                                                      |
**Example of returned results：**
```
{
  "code": 0,
  "data": [
    {
      "flowId": "test",
      "flowName": "Newflowtest",
      "id": "HZ28858f80b77e670180b79a5c8c0023",
      "newName": "User01",
      "newUser": "HZ28821856ef63420156ef6342a20002",
      "oldName": "",
      "oldUser": "",
      "startTime": "2022-05-12 14:21:25",
      "title": "Newflowtest"
    }
  ],
  "message": "",
  "recordsTotal": "3",
  "success": true
}
```
**Result parameter description:**

| Parameter | Type   | Description                |
|-----------|--------|----------------------------|
| flowId    | String | Flow ID                    |
| flowName  | String | Flow Name                  |
| id        | String | Data ID                    |
| newName   | String | Recipient of agent work    |
| newUser   | String | Recipient ID of agent work |
| oldUser   | String | ID of transferor           |
| oldName   | String | Name of transferor         |
| startTime | String | Start time                 |
| title     | String | Query result title         |

## Agent History
Interface Request Invoking Description <br>
HTTP Request Method: POST <br>
Request Address: http://127.0.0.1:8080/demo/horizon/workflow/rest/agent/history/page${suffix} <br>
**Post Data Description：**
```
{
  "accessToken": "",
  "page": "1",
  "limit": "10",
  "sort": "flowName",
  "search": ""
}
```
Request Parameter Description:

| Parameter   | Required | Description                                                                                                                                       |
|-------------|----------|---------------------------------------------------------------------------------------------------------------------------------------------------|
| accessToken | Yes      | Invoking interface credentials, unique user ID                                                                                                    |
| page        | No       | Page number, if blank, it means querying all data                                                                                                 |
| limit       | No       | The number of data items displayed on each page. If it is blank, the default query is 10 items                                                    |
| sort        | No       | Sort, default to positive order. If a minus sign is added before a field, such as sort=- flowName, it will be sorted in reverse order of flowName |
| search      | No       | The default query condition is empty, and all data is queried by default                                                                          |
**Example of returned results：**
```
{
  "code": 0,
  "data": [
    {
      "agentUserId": "HZ28821856ef63420156ef6342a20003",
      "agentUserName": "User02",
      "beginDate": "2022-05-24 00:00:00",
      "endDate": "2022-05-31 23:59:59",
      "flowId": "test3",
      "flowName": "Newflowtest3",
      "id": "HZ28858f80b703d30180b7069c4c000b",
      "status": "Invalid"
    }
  ],
  "message": "",
  "recordsTotal": "9",
  "success": true
}
```
**Result parameter description:**

| Parameter     | Type   | Description                              |
|---------------|--------|------------------------------------------|
| agentUserId   | String | Agent ID                                 |
| agentUserName | String | Name of agent                            |
| beginDate     | String | Begin date of agent                      |
| endDate       | String | End date of agent                        |
| flowId        | String | Flow ID                                  |
| flowName      | String | Flow Name                                |
| id            | String | Data ID                                  |
| status        | String | Limit value: invalid, valid, not started |

## Agent History Details
Interface Request Invoking Description <br>
HTTP Request Method: POST <br>
Request Address: http://127.0.0.1:8080/demo/horizon/workflow/rest/agent/dealinfo${suffix} <br>
**Post Data Description：**
```
{
  "accessToken": "",
  "page": "1",
  "limit": "10",
  "sort": "flowName",
  "dataId": "HZ28811c72024d8d0172024da7b60007"
}
```
Request Parameter Description:

| Parameter   | Required | Description                                                                                                                                                                                             |
|-------------|----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| accessToken | Yes      | Invoking interface credentials, unique user ID                                                                                                                                                          |
| dataId      | Yes      | 代办Data ID                                                                                                                                                                                               |
| page        | No       | Page number, if blank, it means querying all data                                                                                                                                                       |
| limit       | No       | The number of data items displayed on each page. If it is blank, the default query is 10 items                                                                                                          |
| sort        | No       | The sorting of agent history details, default is positive order. If a minus sign is added before a field, for example, sort=- flowName, then the sorting will be arranged in reverse order of flowName. |
| search      | No       | The default query condition is empty, and all data is queried by default                                                                                                                                |
**Example of returned results：**
```
{
  "code": 0,
  "data": [
    {
      "beginDate": "2022-05-18 00:00:00",
      "endDate": "2022-05-31 23:59:59",
      "flowId": "test",
      "flowName": "Newflowtest",
      "saveTime": "2022-05-18 11:18:27",
      "title": "Newflowtest"
    }
  ],
  "message": "",
  "recordsTotal": "1",
  "success": true
}
```
**Result parameter description:**

| Parameter | Type   | Description                             |
|-----------|--------|-----------------------------------------|
| beginDate | String | Begin date of agent                     |
| endDate   | String | End date of agent                       |
| flowId    | String | Flow ID                                 |
| flowName  | String | Flow Name                               |
| saveTime  | String | Sending time format:yyyy-MM-dd HH:mm:ss |
| title     | String | Flow title                              |

## Agent work receiving operation
Interface Request Invoking Description <br>
HTTP Request Method: POST <br>
Request Address: http://127.0.0.1:8080/demo/horizon/workflow/rest/agent/handwork/receivework${suffix} <br>
**Post Data Description：**
```
{
  "accessToken": " ",
  "dataId": "HZ28811c72024d8d0172024da7b60007"
}
```
Request Parameter Description:

| Parameter   | Required | Description                                                                    |
|-------------|----------|--------------------------------------------------------------------------------|
| accessToken | Yes      | Invoking interface credentials, unique user ID                                 |
| dataId      | Yes      | Multiple data IDs of agency work receives operation is separated by semicolons |
**Example of returned results：**
```
{
  "success": true,
  "code": 0,
  "message": "",
  "recordsTotal": "2",
  "data": {
    "HZ2882c0550fa85001550fac06cd00b4": "false",
    "HZ2882c0550fa85001550fac06d100b6": "true"
  }
}
```
**Result parameter description:**

| Parameter | Type | Description                                                                                                                                                                                                               |
|-----------|------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| data      | Map  | The key value is the identification of the successful reception of the dataId related to-do work. False indicates that the process has failed to receive, while True indicates that the process has successfully received |

## Agent Management List
Interface Request Invoking Description <br>
HTTP Request Method: POST <br>
Request Address:  http://127.0.0.1:8080/demo/horizon/workflow/rest/agent/manage/page${suffix} <br>
**Post Data Description：**
```
{
  "accessToken": "",
  "page": "1",
  "limit": "10",
  "sort": "flowName",
  "search": ""
}
```
Request Parameter Description:

| Parameter   | Required | Description                                                                                                                                        |
|-------------|----------|----------------------------------------------------------------------------------------------------------------------------------------------------|
| accessToken | Yes      | Invoking interface credentials, unique user ID                                                                                                     |
| page        | No       | Page number, if blank, it means querying all data                                                                                                  |
| limit       | No       | The number of data items displayed on each page. If it is blank, the default query is 10 items                                                     |
| sort        | No       | Sort, default to positive order. If a minus sign is added before a field, such as sort=- flowName, it will be sorted in reverse order of flowName。 |
| search      | No       | Query all data when the query condition is empty.                                                                                                  |
**Example of returned results：**
```
{
  "code": 0,
  "data": [
    {
      "agentUserId": "HZ28821856ef63420156ef6342a20002",
      "agentUserName": "User01",
      "beginDate": "2022-05-13 00:00:00",
      "endDate": "2022-05-31 23:59:59",
      "flowId": "test",
      "flowName": "Newflowtest",
      "id": "HZ28858f80bb94640180bb974fef001c",
      "status": "Yes",
      "typeName": "",
      "userId": "admin",
      "userName": "Admin"
    },
    {
      "agentUserId": "",
      "agentUserName": "",
      "beginDate": "",
      "endDate": "",
      "flowId": "test2",
      "flowName": "Newflowtest2",
      "id": "",
      "status": "No",
      "typeName": "",
      "userId": "",
      "userName": ""
    }
  ],
  "message": "",
  "recordsTotal": "3",
  "success": true
}
```
**Result parameter description:**

| Parameter     | Type   | Description                                                                                                                                                                     |
|---------------|--------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| agentUserId   | String | Agent User ID                                                                                                                                                                   |
| agentUserName | String | Name of agent                                                                                                                                                                   |
| beginDate     | String | Begin time format: yyyy-MM-dd HH:mm:ss                                                                                                                                          |
| endDate       | String | End time format: yyyy-MM-dd HH:mm:ss                                                                                                                                            |
| flowId        | String | Flow ID                                                                                                                                                                         |
| flowName      | String | Flow Name                                                                                                                                                                       |
| id            | String | This data ID is only available after the process is set to be processed by the agent                                                                                            |
| status        | String | Has the agent been set?<br>Yes: has been set.<br>No: has not been set.<br>If it is not set, the id, the values  of beginDate, endDate, agentUserId, and agentUserName are empty |
| typeName      | String | Flow category                                                                                                                                                                   |
| userId        | String | Original operator ID                                                                                                                                                            |
| userName      | String | Original operator name                                                                                                                                                          |

## Agent Management Settings Operation
Interface Request Invoking Description <br>
HTTP Request Method: POST <br>
Request Address:  http://127.0.0.1:8080/demo/horizon/workflow/rest/agent/manage/action${suffix} <br>
**Post Data Description：**
```
{
  "accessToken": "",
  "id": "test2~Newflowtest2",
  "agentId": "U_HZ28821856ef63420156ef6342a20002",
  "agentName": "User01",
  "userId": "U_HZ28821856ef63420156ef6342a20003",
  "userName": "User02",
  "startDate": "2022-05-13",
  "endDate": "2022-05-31",
  "moveTodo": "1",
  "noticeType": "SMS"
}
```
Request Parameter Description:

| Parameter   | Required | Description                                                                                                                                                                                                                                         |
|-------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| accessToken | Yes      | Invoking interface credentials, unique user ID                                                                                                                                                                                                      |
| id          | Yes      | Select the ID of the agent setting data, whose value is the process ID~process name. If multiple data items are selected for agent setting, the ID values are separated by a semicolon. For example:<brtest01~New Process 01; Test02~New Process 02 |
| agentId     | Yes      | Agent ID                                                                                                                                                                                                                                            |
| agentName   | Yes      | Name of agent                                                                                                                                                                                                                                       |
| userId      | Yes      | Original operator ID                                                                                                                                                                                                                                |
| userName    | Yes      | Original operator name                                                                                                                                                                                                                              |
| startDate   | Yes      | Start date format：yyyy-MM-dd                                                                                                                                                                                                                        |
| endDate     | Yes      | End date format：yyyy-MM-dd                                                                                                                                                                                                                          |
| moveTodo    | Yes      | Transfer existing to-do list: 1 indicates yes, 0 indicates no; By default, it is 1                                                                                                                                                                  |
| noticeType  | No       | SMS is a text message, Msg is a system message, IM is an instant message, and Mail is an email. The default<br>value is blank. If multiple choices are made, commas are used to separate them. For example：<br>Msg,SMS,IM                           |
**Example of returned results：**
```
{
  "success": true,
  "code": 0,
  "message": "Set up agent successfully "
 }
```