CreateDocWithFileId
Method : Post
Interface Function
step 1: Creating a document which belongs to the form "FormAlias" with the initial values from "Doc".
step 2: Binding the file according to file id to the doc created in step 1.
Request Parameter
Parameter | Required | Type | Remarks |
---|---|---|---|
FormAlias | Yes | String | Form alias, the identity of the form |
DocId | No | String | the document id of the new created document, if null, generate a new guid. |
FileId | Yes | String | the file id of the file should be bound with the new created doc |
FileFieldName | Yes | String | The name of the "FileUpload" control field that will be bound by the file which has the "FileId" |
Doc | No | Dictionary |
The data that should be saved in the created doc |
UserCode | Yes | String | The creator staff code (Required, or you will be unable to edit this document) |
UserName | Yes | String | The creator name |
Return Data Type(Data)
StatusCode: 200 if success, others if fail.
Info: the value will not be empty if error occurs, it shows the error message.
Data (string): the created document id.
public class ResultMsg
{
public int StatusCode { get; set; }
public string Info { get; set; }
public object Data { get; set; }
}
Input Sample
{
"UserCode" : "##66522552323222",
"UserName" : "Eason",
"FormAlias": "Eason",
"DocId": "7b2e1cb9-5ecd-46e2-abef-494eb11c2554",
"FileId" : "ab2c1ec3-cba0-4b11-a919-1783ceffdd00",
"FileFieldName": "File",
"Doc": {
"FieldName_A" : "value-A",
"FieldName_B" : "value-B",
"FieldName_C" : "[{\"Type\":1,\"Count\":1,\"Status\":false}]",
}
}
Return Sample
{
"StatusCode": 200,
"Info": "",
"Data": "cf49a2bc-ee10-455c-9ac2-facf7dcd2a00"
}