自定义表单提交


根据用户自定义表单接收url,把表单数据发送到用户自有系统

对接步骤

  1. url设置:控制台->集成管理->表单自定义提交
  2. 创建表单作品,
  3. 用户使用表单作品提交表单
  4. 配置的url将接收到表单提交数据

接口规范

  • 接收接口:用户自定义的url

  • 请求格式:POST

  • Content-Type:application/json

  • 接收参数:

    {
      "id": 23387,
    "corpId":"72d5fb0ac90f42ecb4ac5e99e8ccff1e",
      "data": {
          "123456": "0分",
          "533494569": "{\"value\":\"2\",\"content\":\"选项2\",\"score\":0}",
          "1575406455": "{\"list\":[{\"id\":1,\"value\":\"姓名\",\"content\":\"5\"},{\"id\":2,\"value\":\"年龄\",\"content\":\"6\"},{\"id\":3,\"value\":\"联系方式\",\"content\":\"7\"}],\"score\":0}",
          "1581141795": "{\"content\":\"1\",\"score\":0}",
          "5777800621": "{\"value\":\"2\",\"content\":\"选项2\",\"score\":0}",
          "7548441278": "{\"value\":\"2,3\",\"content\":\"选项2,选项3\",\"score\":0}",
          "6408437499": "{\"value\":\"2\",\"content\":\"选项2\",\"score\":0}",
          "5288440068": "下拉2",
          "7193173279": "{\"list\":[{\"id\":1,\"value\":\"填空1\",\"content\":\"2\"},{\"id\":2,\"value\":\"填空2\",\"content\":\"3\"},{\"id\":3,\"value\":\"填空3\",\"content\":\"4\"}],\"score\":0}",
          "5397244815": "{\"content\":\"8\",\"score\":0}"
      },
      "title": "调查问卷",
      "type": "form",
      "customInfo": {
          "id": 6220,
          "type": 1,
          "corpId": "72d5fb0ac90f42ecb4ac5e99e8ccff1e",
          "openId": "oYy90xFVIL-8n0jnsV860xWPo3ME",
          "nickName": "因为艾青",
          "mobile": null,
          "sex": 0,
          "language": null,
          "city": "",
          "country": "",
          "headImgUrl": "https://thirdwx.qlogo.cn/mmopen/vi_32/ysmFmh8Gwl0aaFPpaRH22MB2wPbG4T0e38V3sSGmUkJZfwd73heboEfsIv2IXjboBX9aEBU12bb4eGyYNvLXqg/132",
          "privilege": null,
          "unionId": "oW-IQvyngEm7ntU1TKXOnPg6wN8g",
          "thirdAppId": "wx0424aefe853c387c",
          "thirdOpenId": "oYy90xFVIL-8n0jnsV860xWPo3ME",
          "thirdUserId": null,
          "encodeId": "eb23ff8625dafe67f81f8280332c387b"
      },
      "formMeta": {
          "533494569": {
              "score": "{\"score\":10,\"showScoreAndAnswer\":false,\"answers\":[],\"answerKeys\":\"\",\"scoreMethodType\":2,\"list\":[{\"score\":10,\"default\":false,\"src\":\"material/1624521649900-85s9bpj0dbn.svg\",\"id\":1,\"label\":\"选项1\",\"tag\":\"custom\"},{\"score\":10,\"default\":false,\"src\":\"material/1624521649900-85s9bpj0dbn.svg\",\"id\":2,\"label\":\"选项2\",\"tag\":\"custom\"},{\"score\":10,\"default\":false,\"src\":\"material/1624521649900-85s9bpj0dbn.svg\",\"id\":3,\"label\":\"选项3\",\"tag\":\"custom\"}]}",
              "type": "scoreImageRadio",
              "title": "图片单选题",
              "delFlag": false
          },
          "1575406455": {
              "options": [{
                  "score": 1,
                  "id": 1,
                  "label": "姓名",
                  "fills": {
                      "hLine": 0,
                      "css": {
                          "width": "63px"
                      },
                      "lLine": 0
                  }
              }, {
                  "score": 1,
                  "id": 2,
                  "label": "年龄",
                  "fills": {
                      "hLine": 0,
                      "css": {
                          "width": "63px"
                      },
                      "lLine": 0
                  }
              }, {
                  "score": 1,
                  "id": 3,
                  "label": "联系方式",
                  "fills": {
                      "hLine": 0,
                      "css": {
                          "width": "63px"
                      },
                      "lLine": 0
                  }
              }],
              "type": "5213",
              "title": "横向填空",
              "delFlag": false
          },
          "1581141795": {
              "type": "5210",
              "title": "单项填空",
              "delFlag": false
          },
          "7193173279": {
              "options": [{
                  "score": 1,
                  "id": 1,
                  "label": "填空1"
              }, {
                  "score": 1,
                  "id": 2,
                  "label": "填空2"
              }, {
                  "score": 1,
                  "id": 3,
                  "label": "填空3"
              }],
              "type": "5211",
              "title": "多项填空",
              "delFlag": false
          },
          "6408437499": {
              "score": "{\"score\":10,\"showScoreAndAnswer\":false,\"answers\":[],\"answerKeys\":\"\",\"scoreMethodType\":4,\"list\":[{\"score\":10,\"default\":false,\"src\":\"material/1624521649900-85s9bpj0dbn.svg\",\"id\":1,\"label\":\"选项1\",\"tag\":\"custom\"},{\"score\":10,\"default\":false,\"src\":\"material/1624521649900-85s9bpj0dbn.svg\",\"id\":2,\"label\":\"选项2\",\"tag\":\"custom\"},{\"score\":10,\"default\":false,\"src\":\"material/1624521649900-85s9bpj0dbn.svg\",\"id\":3,\"label\":\"选项3\",\"tag\":\"custom\"}]}",
              "type": "scoreImageCheckbox",
              "title": "图片多选题",
              "delFlag": false
          },
          "5288440068": {
              "options": [{
                  "label": "请选择",
                  "value": 0,
                  "selected": true
              }, {
                  "label": "下拉1",
                  "value": 1,
                  "selected": false
              }, {
                  "label": "下拉2",
                  "value": 2,
                  "selected": false
              }, {
                  "label": "下拉3",
                  "value": 3,
                  "selected": false
              }],
              "type": "z",
              "title": "下拉题",
              "delFlag": false
          },
          "7548441278": {
              "score": "{\"score\":10,\"showScoreAndAnswer\":false,\"answers\":[],\"answerKeys\":\"\",\"scoreMethodType\":4,\"list\":[{\"score\":10,\"default\":false,\"id\":1,\"label\":\"选项1\",\"tag\":\"custom\"},{\"score\":10,\"default\":false,\"id\":2,\"label\":\"选项2\",\"tag\":\"custom\"},{\"score\":10,\"default\":false,\"id\":3,\"label\":\"选项3\",\"tag\":\"custom\"}]}",
              "type": "scoreCheckbox",
              "title": "多选题",
              "delFlag": false
          },
          "5397244815": {
              "type": "5214",
              "title": "简答题",
              "delFlag": false
          },
          "5777800621": {
              "score": "{\"score\":10,\"showScoreAndAnswer\":false,\"answers\":[],\"answerKeys\":\"\",\"scoreMethodType\":2,\"list\":[{\"score\":10,\"default\":false,\"id\":1,\"label\":\"选项1\",\"tag\":\"custom\"},{\"score\":10,\"default\":false,\"id\":2,\"label\":\"选项2\",\"tag\":\"custom\"},{\"score\":10,\"default\":false,\"id\":3,\"label\":\"选项3\",\"tag\":\"custom\"}]}",
              "type": "scoreRadio",
              "title": "单选题",
              "delFlag": false
          }
      },
      "formDataId": 404843,
      "dataInfo": {
          "status": 0,
          "star": 0,
          "defFlag": false
      }
    }
    
    字段 类型 说明
    id Long 作品唯一标识
    corpId Long 企业id
    title String 内容标题
    type String 作品类型 h5:h5作品 lc:长页面 form:表单
    formDataId Long 表单提交数据的唯一Id,后端提交时会携带该参数
    formMeta.{elementId}.type String 表头类型
    formMeta.{elementId}.title String 表头名称
    formMeta.{elementId}.status Integer 表头状态
    formMeta.{elementId}.delFlag Boolean 表头是否删除(true:已删除 false:未删除)
    formMeta.{elementId}.options List 选项(根据type不同,返回值有所区别,见详细说明
    formMeta.{elementId}.score String 计分组件选项信息(json字符串,根据type不同,返回值有所区别,见详细说明
    ua.ua String 浏览器请求原始user-agent
    ua.os String 设备系统信息
    ua.device String 设备信息
    ua.browser String 浏览器信息
    ua.ip String ip地址
    dataInfo.status Integer 数据状态
    dataInfo.costTime Long 表单提交耗时
    dataInfo.star Integer 星级
    dataInfo.delFlag Boolean 该表单数据是否删除(true:已删除 false:未删除)
    data.{elementId} String 表单值(elementId:对应表头formMeta.elementId)
    customerInfo.encodeId Srtring 用户唯一标识【易企秀】
    customerInfo.type int 授权用户类型,1微信,2手机,3自定义
    customerInfo.corpId String 企业唯一标识
    customerInfo.nickName String 微信昵称,userType为1时
    customerInfo.mobile String 手机号,userType为2时
    customerInfo.sex String 微信性别,userType为1时
    customerInfo.language String 微信信息,userType为1时
    customerInfo.city Integer 微信信息,userType为1时
    customerInfo.country String 微信信息,userType为1时
    customerInfo.headImgUrl String 微信信息,userType为1时
    customerInfo.unionId String 微信信息,unionId
    customerInfo.appIdType Integer appId类型,1、易企秀 ;非 1,非易企秀
    customerInfo.thirdAppId String 微信信息,appId
    customerInfo.thirdOpenId String 微信信息,openId
  • 返回参数:
    正确时返回:

    {
    "success": true,
    "code": "200", //固定值 200代表接口请求成功
    "msg": null,
    "obj": {
      "thirdId": "b51090fbbf8f4ba89f1027409d4e3f50" //对接测的id
    },
    }
    

    错误时返回:

    {
    "success": true,
    "code": "200",
    "msg": null,
    "obj": {
      "errcode": "A0001", //如果保存校验不通过返回errcode、errmsg参数
      "errmsg": "请填写手机号",
    },
    }
    
  • 接口要求

    • 前端保存
      需支持跨域访问(因为数据不经过易企秀后台,由前端直接传输,会有跨域问题)
      demo:
    • 后端保存
      后端保存的数据会加密,解密方式同事件的一致

will 2024年8月9日 11:06 3804 收藏文档