CubeDrive   ->   API

Add form data【saveData】


With this API, users can insert form data.

Name: {{baseuri}}/formData/saveData

Parameter:

http method: POST

Step


List the following step

@baseuri = http://localhost:8080/cubedrive-webapp
@username= admin
@password= abcabc
@xAuthToken=bbb6c793-832c-4733-9601-a023366d918f

###
GET {{baseuri}}/getLogin?j_username={{username}}&j_password={{password}}

###
POST {{baseuri}}/formData/saveData?formId=6671575366949146624
X-Auth-Token: {{xAuthToken}}
Content-Type: application/json

{
  formId: "6671575366949146624"
  data: 
	u295: null
	u524: "Data"
	u811: "2020-06-13T04:00:00.000Z"
	u1040: "Generate"
	u2490: "Team 2"
	u2942: "2020-05-31T04:00:00.000Z"
	u7184: "David"
	u8882: ""
	_u2942: "July 7"
	_weight_u2942: 99999999
}
    

Create data format


Users need ro create data in some format. Get 【form structure】, From the following data, each field has a 【uid】, and each uid will be used to generate the data.

{
  "success": true,
  "form": {
    "id": "6671575366949146624",
    "fields": [
      {
        "id": "5411",
        "title": "date",
        "col": 8,
        "uid": "u2942",
        "hidden": false,
        "settings": {
          "dt": 2,
          "showRequired": false,
          "disabled": true,
          "hint": "",
          "title": "date",
          "initialVal": "",
          "changeAllow": false,
          "description": "",
          "hidden": false,
          "openTplType": "default",
          "dfm": "M-d(l)",
          "hasMetaData": true,
          "list": [],
          "listCss": [],
          "addSortWeight": true,
          "nullValNotInSort": true
        },
        "permission": null
      },
      {
        "id": "5412",
        "title": "type",
        "col": 7,
        "uid": "u524",
        "hidden": false,
        "settings": {
          "dt": 1,
          "showRequired": false,
          "disabled": false,
          "hint": "",
          "title": "type",
          "initialVal": "",
          "changeAllow": false,
          "description": "",
          "hidden": false,
          "openTplType": "default",
          "dv": ""
        },
        "permission": null
      },
      ...   
    ],
    "author": false
  }
}
    
Hint: please be sure that each field format is correct. For example: date format is "2020-05-31"

Form field data format


Result


{
	dataId: "6678019837546991616"
	obj: {id: "6678019837546991616",…}
	success: true
	updateAt: 1592164040774
}