自定义表单接口

新增表单

请求方式: 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) 外勤365系统中该流程的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开头

返回结果:

{
    "msg_id": "X000001",
    "response_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"
    },
    "return_code": 0,
    "return_msg": ""
}

响应信息

参数 类型 说明
msg_id String 请求消息ID
return_code int 响应编码,0-成功, 1-失败, 其他参照附件错误码
return_msg String 响应说明
response_data String 参照响应信息示例,response_data为当前保存的主记录数据

修改表单

请求方式: 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) 外勤365系统中该流程的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-失败, 其他参照附件错误码
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) 外勤365系统中该流程id
codes VARCHAR(4000) 主记录source_code,逗号分隔多条记录

返回结果:

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

响应信息

参数 类型 说明
msg_id String 请求消息ID
return_code int 响应编码,0-成功, 1-失败, 其他参照附件错误码
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",
    "creator_id": "3322631669645699527",
    "page": "1",
    "rows": "1000"
}

{
    "msg_id": "YY698688888",
    "response_data": [
        {
            "pt": {
                "id": "2064770493868875201",
                "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",
                    "rows": [
                        {
                            "id": "2217888117059747333",
                            "source_code": "code15597478179102",
                            "slfdf_1701180025": "产品编码002",
                            "slfdf_1701180026": "产品名称002",
                            "slfdf_1701180027": "4",
                            "slfdf_1701180028": "100"
                        },
                        {
                            "id": "2217888117059747332",
                            "source_code": "code15597478179102",
                            "slfdf_1701180025": "产品编码001",
                            "slfdf_1701180026": "产品名称001",
                            "slfdf_1701180027": "6",
                            "slfdf_1701180028": "100"
                        }
                    ]
                }
            ]
        }
    ],
    "return_code": 0,
    "return_msg": ""
}

请求信息

参数 类型 必填 说明
form_id VARCHAR(32) 外勤365系统中该流程的编码
source_code VARCHAR(200) 主记录code
data_id VARCHAR(32) 记录ID
date_start VARCHAR(10) 上报日期起,格式:“yyyy-MM-dd”
date_end VARCHAR(10) 上报日期止,格式:“yyyy-MM-dd”
creator_id VARCHAR (36) 上报人id
page VARCHAR (10) 数据页数
rows VARCHAR (10) 每页数据显示条数(最大1000)

查询表单模板

请求方式: POST(HTTPS
请求地址: https://openapi.waiqin365.com/api/userDefined/v1/getUserDefined/{ openid }/{ timestamp }/{ digest }/{ msg_id }
请求包体:

{
    "form_id": "4622631669645698414"
}

{
    "msg_id":"X000001",
    "return_code":"0",
    "return_msg":"",
    "response_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"
            }]
        }]
    }
}

请求信息

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

响应信息

参数 类型 说明
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 排序号