# 自定义表单接口

# 新增表单数据

请求方式: POST(HTTPS
请求地址: https://openapi.waiqin365.com/api/userDefined/v1/addUserDefined/{ openid }/{ timestamp }/{ digest }/{ msg_id } 在线调试
请求示例:

{
    "config": {
        "form_id": "4803305597478179107"
    },
    "data": {
        "pt": {
            "source_code": "code15597478179102",
            "creator_id": "3258191447353251895",
            "slfdf_1701180002": "订单编码001",
            "slfdf_1701180004": "2017-01-19 15:27",
            "slfdf_1701180005": "买家编码001",
            "slfdf_1701180006": "8037753159935166023",
            "slfdf_1701180007": "卖家编码001",
            "slfdf_1701180008": "卖家名称001",
            "slfdf_1701180009": "订单状态完成",
            "slfdf_1701180010": "1000",
            "slfdf_1701180011": "订单类型1",
            "slfdf_1701180012": "江浙沪",
            "slfdf_1701180013": "现金",
            "slfdf_1701180014": "1000",
            "slfdf_1701180015": "2017-01-19 15:28",
            "slfdf_1701180016": "收货人名称",
            "slfdf_1701180017": "15152621000",
            "slfdf_1701180018": "江苏",
            "slfdf_1701180019": "南京",
            "slfdf_1701180020": "建邺区",
            "slfdf_1701180021": "嘉陵江东街",
            "slfdf_1701180022": "9点-15点",
            "slfdf_1701180023": "9点",
            "slfdf_1701180024": "15点",
            "slfdf_1701190001": "备注1",
            "slfdf_1701190002": "备注2",
            "slfdf_1701190003": "备注3",
            "slfdf_1701190004": "备注4",
            "slfdf_1701190005": "备注5",
            "slfdf_1701190006": "备注6"
        },
        "sts": [
            {
                "id": "7144770493868875242",
                "rows": [
                    {
                        "source_code": "code155974781791021",
                        "slfdf_1701180025": "产品编码002",
                        "slfdf_1701180026": "产品名称002",
                        "slfdf_1701180027": "4",
                        "slfdf_1701180028": "100"
                    },
                    {
                        "source_code": " code155974781791022",
                        "slfdf_1701180025": "产品编码001",
                        "slfdf_1701180026": "产品名称001",
                        "slfdf_1701180027": "6",
                        "slfdf_1701180028": "100"
                    }
                ]
            }
        ]
    }
}
说明: 本示例仅供参考,具体以参数说明为准。

参数说明:

参数 类型 必填 说明
config.form_id VARCHAR(32) 勤策系统中该流程的id
data.pt 该流程主记录
data.sts 该流程明细(子表)记录
data.pt.source_code VARCHAR(200) 第三方系统数据KEY
data.pt.creator_id VARCHAR(36) 创建人id
data.pt.slfdf_* 主记录数据(字段编码详见页面接口数据),图片需要以http或https开头
data.sts.id CHAR(32) 明细数据的表格id
data.sts.rows. source_code CHAR(200) 明细数据第三方系统数据KEY
data.sts.rows.slfdf_* 明细数据(字段编码详见页面接口数据),图片需要以http或https开头

响应示例:

{
    "return_code": "0", 
    "return_msg": "响应信息",
    "msg_id": "{ msg_id }",  
    "response_data": "<<DATA>>"
}

数据DATA示例:

[
    {
       "slfdf_1701180002": "订单编码001",
       "slfdf_1701180004": "2017-01-19 15:27",
       "slfdf_1701180005": "买家编码001",
       "slfdf_1701180006": "8037753159935166023",
       "slfdf_1701180007": "卖家编码001",
       "slfdf_1701180008": "卖家名称001",
       "slfdf_1701180009": "订单状态完成",
       "slfdf_1701180010": "1000",
       "slfdf_1701180011": "订单类型1",
       "slfdf_1701180012": "江浙沪",
       "slfdf_1701180013": "现金",
       "slfdf_1701180014": "1000",
       "slfdf_1701180015": "2017-01-19 15:28",
       "slfdf_1701180016": "收货人名称",
       "slfdf_1701180017": "15152621000",
       "slfdf_1701180018": "江苏",
       "slfdf_1701180019": "南京",
       "slfdf_1701180020": "建邺区",
       "slfdf_1701180021": "嘉陵江东街",
       "slfdf_1701180022": "9点-15点",
       "slfdf_1701180023": "9点",
       "slfdf_1701180024": "15点",
       "slfdf_1701190001": "备注1",
       "slfdf_1701190002": "备注2",
       "slfdf_1701190003": "备注3",
       "slfdf_1701190004": "备注4",
       "slfdf_1701190005": "备注5",
       "slfdf_1701190006": "备注6",
       "id": "6425258429832019"
    }
]

# 修改表单数据

请求方式: POST(HTTPS
请求地址: https://openapi.waiqin365.com/api/userDefined/v1/modifyUserDefined/{ openid }/{ timestamp }/{ digest }/{ msg_id } 在线调试
请求示例:

{
    "config": {
        "form_id": "4622631669645698414"
    },
    "data": {
        "pt": {
            "id": "2064770493868875201",
            "source_code": "code155974781791021",
            "creator_id": "3258191447353251895",
            "slfdf_1701180002": "订单编码001",
            "slfdf_1701180004": "2017-01-19 15:27",
            "slfdf_1701180005": "卖家编码001",
            "slfdf_1701180006": "8037753159935166023",
            "slfdf_1701180007": "卖家编码001",
            "slfdf_1701180008": "卖家名称001",
            "slfdf_1701180009": "订单状态完成",
            "slfdf_1701180010": "1000",
            "slfdf_1701180011": "订单类型1",
            "slfdf_1701180012": "江浙沪",
            "slfdf_1701180013": "现金",
            "slfdf_1701180014": "1000",
            "slfdf_1701180015": "2017-01-19 15:28",
            "slfdf_1701180016": "收货人名称",
            "slfdf_1701180017": "15152621000",
            "slfdf_1701180018": "江苏",
            "slfdf_1701180019": "南京",
            "slfdf_1701180020": "建邺区",
            "slfdf_1701180021": "嘉陵江东街",
            "slfdf_1701180022": "9点-15点",
            "slfdf_1701180023": "9点",
            "slfdf_1701180024": "15点",
            "slfdf_1701190001": "备注1",
            "slfdf_1701190002": "备注2",
            "slfdf_1701190003": "备注3",
            "slfdf_1701190004": "备注4",
            "slfdf_1701190005": "备注5",
            "slfdf_1701190006": "备注6"
        },
        "sts": [
            {
                "id": "7144770493868875242",
                "rows": [
                    {
                        "id": "2064770493868875201",
                        "source_code": "code770493868875201",
                        "slfdf_1701180025": "产品编码002",
                        "slfdf_1701180026": "产品名称002",
                        "slfdf_1701180027": "4",
                        "slfdf_1701180028": "100"
                    },
                    {
                        "id": "2064770493868875201",
                        "source_code": "code770493868875202",
                        "slfdf_1701180025": "产品编码001",
                        "slfdf_1701180026": "产品名称001",
                        "slfdf_1701180027": "6",
                        "slfdf_1701180028": "100"
                    }
                ]
            }
        ]
    }
}
说明: 本示例仅供参考,具体以参数说明为准。

参数说明:

参数 类型 必填 说明
config.form_id VARCHAR(32) 勤策系统中该流程的id
data.pt 该流程主记录
data.sts 该流程明细(子表)记录
data.pt.id VARCHAR(32) 主记录id,与第三方系统数据KEY必填一个
data.pt.source_code VARCHAR(200) 第三方系统数据KEY,与主记录id必填一个
data.pt.creator_id VARCHAR(36) 创建人id
data.pt.slfdf_* 主记录数据(字段编码详见页面接口数据),图片需要以http或https开头
data.sts.id VARCHAR(32) 明细数据的表格id
data.sts.rows.id VARCHAR(32) 明细数据记录id
data.sts.rows.source_code VARCHAR(200) 明细数据第三方系统数据KEY,id或者source_code必须填写一个
data.sts.rows.slfdf_* 明细数据(字段编码详见页面接口数据),图片需要以http或https开头

响应示例:

{
    "msg_id": "X000001",
    "return_code": 0,
    "return_msg": ""
}

参数说明:

参数 类型 说明
msg_id String 请求消息ID
return_code int 响应编码。0:成功,1:失败。其他详见附录错误码说明 (opens new window)
return_msg String 响应说明

# 删除表单数据

请求方式: POST(HTTPS
请求地址: https://openapi.waiqin365.com/api/userDefined/v1/delUserDefined/{ openid }/{ timestamp }/{ digest }/{ msg_id } 在线调试
请求示例:

{
    "form_id": "4622631669645698414",
    "codes": "8767607948140064370, 8767607948140064371"
}
说明: 本示例仅供参考,具体以参数说明为准。

参数说明:

参数 类型 必填 说明
form_id VARCHAR(32) 勤策系统中该流程id
codes VARCHAR(4000) 主记录source_code,多个值以“,”隔开

响应示例:

{
   	"msg_id":"X000001",
	"return_code":0,
	"return_msg":""
}

参数说明:

参数 类型 说明
msg_id String 请求消息ID
return_code int 响应编码。0:成功,1:失败。其他详见附录错误码说明 (opens new window)
return_msg String 响应说明

# 查询表单数据

请求方式: POST(HTTPS
请求地址: https://openapi.waiqin365.com/api/userDefined/v1/queryUserDefined/{ openid }/{ timestamp }/{ digest }/{ msg_id } 在线调试
请求示例:

{
    "form_id": "4622631669645698414",
    "source_code": "8767607948140064370",
    "data_id": "3322631669645692334",
    "date_start": "2017-01-10",
    "date_end": "2017-01-20",
	"modify_date_start": "2017-01-10",
	"modify_date_end": "2017-01-20",
    "creator_id": "3322631669645699527",
	"status":"1",
    "page": "1",
    "rows": "1000"
}
说明: 本示例仅供参考,具体以参数说明为准。

参数说明:

参数 类型 必填 说明
form_id VARCHAR(32) 勤策系统中该流程的编码
source_code VARCHAR(200) 主记录code
data_id VARCHAR(32) 记录ID
date_start VARCHAR(10) 上报日期起。格式:yyyy-MM-dd
date_end VARCHAR(10) 上报日期止。格式:yyyy-MM-dd
modify_date_start VARCHAR(10) 修改日期起。格式:yyyy-MM-dd
modify_date_end VARCHAR(10) 修改日期止。格式:yyyy-MM-dd
creator_id VARCHAR (36) 上报人id
status VARCHAR (1) 主表数据状态,1:正常,0:删除
page VARCHAR (10) 数据页数
rows VARCHAR (10) 每页数据显示条数,最大显示1000条

响应示例:

{
    "return_code": "0", 
    "return_msg": "响应信息",
    "msg_id": "{ msg_id }",  
    "response_data": "<<DATA>>"
}

数据DATA示例:

[
    {
        "pt": {
                "id": "2064770493868875201",
                "status": "1",
                "source_code": "code15597478179102",
                "creator_id": "3258191447353251895",
                "creator_time": "2017-01-20 12:12:03",
                "modifyier_id": "",
                "modifyier_ time ": "",
                "slfdf_1701180002": "订单编码001",
                "slfdf_1701180004": "2017-01-19 15:27",
                "slfdf_1701180005": "买家编码001",
                "slfdf_1701180006": "8037753159935166023",
                "slfdf_1701180007": "卖家编码001",
                "slfdf_1701180008": "卖家名称001",
                "slfdf_1701180009": "订单状态完成",
                "slfdf_1701180010": "1000",
                "slfdf_1701180011": "订单类型1",
                "slfdf_1701180012": "江浙沪",
                "slfdf_1701180013": "现金",
                "slfdf_1701180014": "1000",
                "slfdf_1701180015": "2017-01-19 15:28",
                "slfdf_1701180016": "收货人名称",
                "slfdf_1701180017": "15152621000",
                "slfdf_1701180018": "江苏",
                "slfdf_1701180019": "南京",
                "slfdf_1701180020": "建邺区",
                "slfdf_1701180021": "嘉陵江东街",
                "slfdf_1701180022": "9点-15点",
                "slfdf_1701180023": "9点",
                "slfdf_1701180024": "15点",
                "slfdf_1701190001": "备注1",
                "slfdf_1701190002": "备注2",
                "slfdf_1701190003": "备注3",
                "slfdf_1701190004": "备注4",
                "slfdf_1701190005": "备注5",
                "slfdf_1701190006": "备注6"
            },
            "sts": [
                {
                    "id": "7144770493868875242",
					"table_name":"slfdf_2201180028",
                    "rows": [
                        {
                            "id": "2217888117059747333",
                            "source_code": "code15597478179102",
                            "slfdf_1701180025": "产品编码002",
                            "slfdf_1701180026": "产品名称002",
                            "slfdf_1701180027": "4",
                            "slfdf_1701180028": "100",
							"slfdf_2201050036_attachment":{
									"type":"2",
									"data":[
										{
											"name":"测试文件1",
											"alias":"20220902090149_0d75a95147df4fe4a732cb8b8f451e1f",
											"size":9467,
											"path":"user_defined/5215672326251838156",
											"type":"xlsx"
										},
										{
											"name":"测试文件2",
											"alias":"20220902090149_0d75a95147df4fe4a732cb8b8f451e1f",
											"size":9467,
											"path":"user_defined/5215672326251838156",
											"type":"xlsx"
										}
									],
									"url":"",
									"attachmentRoot":"http://image-test.waiqin365.com/9152215568046829952"
								},
							"slfdf_2112020002_pic":"http://image-test.waiqin365.com/9152215568046829952/user_defined/6088294822871327856/202208/20220804170311115_b2583e2c_CAMERA_11001003277.jpeg,http://image-test.waiqin365.com/9152215568046829952/user_defined/6088294822871327856/202205/20220505171852699_39683371_CAMERA_21001004187.jpg"
                        },
                        {
                            "id": "2217888117059747332",
                            "source_code": "code15597478179102",
                            "slfdf_1701180025": "产品编码001",
                            "slfdf_1701180026": "产品名称001",
                            "slfdf_1701180027": "6",
                            "slfdf_1701180028": "100",
							"slfdf_2201050036_attachment":{
									"type":"2",
									"data":[
										{
											"name":"测试文件3",
											"alias":"20220902090149_0d75a95147df4fe4a732cb8b7f451e1f",
											"size":5892,
											"path":"user_defined/5215672326251838156",
											"type":"xlsx"
										},
										{
											"name":"测试文件4",
											"alias":"20220902090149_0d75a95147df4fe4a732cb8b7f451e1f",
											"size":5892,
											"path":"user_defined/5215672326251838156",
											"type":"xlsx"
										}
									],
									"url":"",
									"attachmentRoot":"http://image-test.waiqin365.com/9152215568046829952"
								},
							"slfdf_2112020002_pic":"http://image-test.waiqin365.com/9152215568046829952/user_defined/6088294822871327856/202208/20220804170311115_b2583e2c_CAMERA_11001005677.jpeg,http://image-test.waiqin365.com/9152215568046829952/user_defined/6088294822871327856/202205/20220505171852699_39683371_CAMERA_21001009687.jpg"
                        }
                    ]
                }
            ]
    }
]
说明: 本示例仅供参考,具体以参数说明为准。

参数说明:

参数 类型 说明
pt.id String 主表数据id
pt.status String 主表数据状态,1:正常,0:删除
pt.source_code String 主记录code
pt.creator_id String 上报人id
pt.creator_time String 上报时间
pt.modifyier_id String 修改人id
pt.modifyier_ time String 修改时间
pt.slfdf_* String 自定义字段
sts List 子表数据列表
sts.id String 子表id
sts.table_name String 子表表名
sts.rows.id String 子表数据id
sts.rows.source_code String 子表数据记录code
sts.rows.slfdf_* String 子表自定义字段,附件类型字段会在数据中新增字段slfdf_2201050036_attachment,下载路径:attachmentRoot + "/" + path + "/" + alias + "." + type。照片类型字段会在数据中新增字段slfdf_2112020002_pic,值为图片全路径

# 查询表单模板

请求方式: POST(HTTPS
请求地址: https://openapi.waiqin365.com/api/userDefined/v1/getUserDefined/{ openid }/{ timestamp }/{ digest }/{ msg_id } 在线调试
请求示例:

{
    "form_id": "4622631669645698414"
}
说明: 本示例仅供参考,具体以参数说明为准。

参数说明:

参数 类型 必填 说明
form_id VARCHAR(32) 勤策系统中该流程的编码

响应示例:

{
    "return_code": "0", 
    "return_msg": "响应信息",
    "msg_id": "{ msg_id }",  
    "response_data": "<<DATA>>"
}

数据DATA示例:

[
    {
        "primary_table": {
        "table_name": "slfdf_1912300001",
        "description": "格式测试",
        "columns": [{
            "column_name": "slfdf_1912300004",
            "description": "单行文本框",
            "type": "1",
            "select_option":"",
            "sequence":"1"
        }]
    },
        "subtables": [{
        "table_name": "slfdf_1912300002",
        "description": "子表单1",
        "columns": [{
            "column_name": "slfdf_1912300005",
            "description": "单行文本框",
            "type": "1",
            "select_option":"",
            "sequence":"1"
        }]
    }, {
        "table_name": "slfdf_1912300003",
        "description": "子表单2",
        "columns": [{
            "column_name": "slfdf_1912300006",
            "description": "单行文本框",
            "type": "1",
            "select_option":"",
            "sequence":"2"
        }]
    }]
    }
]

参数说明:

参数 类型 说明
primary_table.table_name String 主表数据库表名称
primary_table.description String 主表表单名称
subtables.table_name String 子表数据库表名称
subtables.description String 子表名称
columns.column_name String 字段编码
columns.description String 字段名称
columns.type String 字段类型。1:文本框,2:多行文本框,3:单选框,4:多选框,5:下拉选择框,6:日期框,7:时间框,8:拍照控件,9:定位控件,10:人员多选,11:人员单选,12:客户单选,13:客户多选,14:商品多选,15:商品单选,17:数值控件,18:附件,19:条码控件,20:日期时间框,21:其它数据源单选,22:其它数据源多选,23:资产单选,24:资产多选,25:部门控件,34:请假类型控件)
columns.select_option String 列表选项
columns.sequence String 排序号

# 查询AI表单数据

请求方式: POST(HTTPS
请求地址: https://openapi.waiqin365.com/api/userDefined/v1/queryUserDefinedAiResult/{openid}/{timestamp}/{digest}/{msgid} 在线调试
请求示例:

{
    "modify_time":"2021-03-24 15:50:11",
    "create_time":"2021-03-24 15:44:07",
    "page": "1",
    "rows": "1000"
}
说明: 本示例仅供参考,具体以参数说明为准。

参数说明:

参数 类型 必填 说明
modify_time VARCHAR(32) 数据修改时间
create_time VARCHAR(32) 数据新增时间
page VARCHAR(10) 数据页数(值大于0)
rows VARCHAR(10) 每页显示条数,最大显示1000条(值大于等于0)

响应示例:

{
    "return_code": "0", 
    "return_msg": "响应信息",
    "msg_id": "{ msg_id }",  
    "response_data": "<<DATA>>"
}

数据DATA示例:

[
    {
        "field_id":"7856071430514797610",
        "record_id":"7486454188400427586",
        "create_time":"2021-03-24 15:44:07",
        "modify_time":"2021-03-24 15:50:11",
        "function_id":"6606111292149627432",
        "id":"7228163879460221890",
        "biz_id":"7228163879460221890",
        "ai_status":"0",
        "picture":"user_defined/6606111292149627432/202103/20210324154403522_3b33ea47_CAMERA_11001002261.jpg",
        "status":"1"
    }
]

参数说明:

参数 类型 说明
field_id String 属性表ID
record_id String 记录ID
create_time String 创建时间
modify_time String 修改时间
function_id String 功能ID
id String 主表ID
biz_id String 业务ID
ai_status String AI识别状态
picture String 图片地址
status String 数据状态

# 查询表单列表

请求方式: POST(HTTPS
请求地址: https://openapi.waiqin365.com/api/userDefined/v1/queryFlowTables/{ openid }/{ timestamp }/{ digest }/{ msg_id } 在线调试
请求示例:

{
    "page": 1,
    "rows": 100,
    "id": "8036003615216169577",
    "form_name": "zzz1",
    "userd_type": "1,2"
}
说明: 本示例仅供参考,具体以参数说明为准。

参数说明:

参数 类型 必填 说明
id VARCHAR(32) 勤策(原外勤365)系统中表单模版ID
form_name VARCHAR(32) 表单名称
userd_type VARCHAR(32) 表单所属业务类型 0 - 拜访流程使用 1 - 独立使用;2 - 审批流程使用;3 - 资产用;4 - 终端检核用;6 - 促销核销申请单核销叠加表单;7 - 促销活动申请表单叠加表单;10 - 拜访审核表单;11 - 促销上报审核表单;12 - 促销上报模板表单;13 - 促销检核模板表单;14 - 消费者活动上报模板;15 - 智能铺货上报上报模板;16 - 德高-客户-专卖店运维-流程设置
page VARCHAR(10) 数据页数(值大于0)
rows VARCHAR(10) 每页显示条数,最大显示1000条(值大于等于0)

响应示例:

{
    "return_code": "0", 
    "return_msg": "响应信息",
    "msg_id": "{ msg_id }",  
    "response_data": "<<DATA>>"
}

数据DATA示例:

[
    {
       "userd_type": "1",
       "id": 8036003615216169577,
       "form_name": "zzz1",
       "table_name": "slfdf_2304140006",
       "release_user_name": "",
       "remarks": "",
       "enabled": "0",
       "publish_status": "0",
       "release_time": "",
       "ref_function_ids": "7580892324389547286,7712307334976595581"
    }
]

参数说明:

参数 类型 说明
userd_type String 表单所属业务类型
id String 勤策(原外勤365)系统中表单模版ID
form_name String 主表单模版名称
table_name String 主表单模版编码
release_user_name String 最后修改人
remarks String 主表单备注
enabled String 主表单启用停用状态 0 - 停用 1 - 启用
publish_status String 主表单发布状态 0 - 未发布 1 - 已发布
release_time String 最后修改时间
ref_function_ids String 勤策(原外勤365)系统中关联表单I