查询单条业务数据
更新时间: 2023-12-01 浏览次数: {{ hits }}

LoadBizObject 为加载单个数据,请勿使用该接口来循环加载数据,可以使用LoadBizObjects 来批量加载数据。

请求方式:POST(HTTPS)

请求地址:https://www.h3yun.com/OpenApi/Invoke

请求包体:

{

"ActionName":"LoadBizObject",

"SchemaCode":"D000024chuangjian",

"BizObjectId":"fea0ade0-505d-4ffc-bca0-6cbdf3c302c6"

}

 

参数说明:

参数

参数类型

必须

说明

ActionName

String

调用的方法名

SchemaCode

String

需要查询的表单编码

BizObjectId

String

需要查询的数据ID,每个表单都有唯一的ObjectId


需要注意:使用该方法读取子表附件时,需要将子表schemacode和objectid作为参数传入读取,

读取主表单数据时不会带出子表附件信息。 


请求示例(C#):

string apiAddress = @"https://www.h3yun.com/OpenApi/Invoke";

HttpWebRequest request =   (System.Net.HttpWebRequest)WebRequest.Create(apiAddress);

request.Method = "POST";

request.ContentType = "application/json";

//身份认证参数

request.Headers.Add("EngineCode", "");

request.Headers.Add("EngineSecret","");

//参数

Dictionary<string, object> dicParams = new Dictionary<string, object>();

dicParams.Add("ActionName", "LoadBizObject");

dicParams.Add("SchemaCode", "D000024chuangjian");

dicParams.Add("BizObjectId","fea0ade0-505d-4ffc-bca0-6cbdf3c302c6");

 

string jsonData = JsonConvert.SerializeObject(dicParams);

byte[] bytes;

bytes = System.Text.Encoding.UTF8.GetBytes(jsonData);

request.ContentLength = bytes.Length;

using (Stream writer = request.GetRequestStream())

      {

         writer.Write(bytes, 0, bytes.Length);

         writer.Close();

       }

 

string strValue = string.Empty;

using (System.Net.HttpWebResponse response =   (System.Net.HttpWebResponse)request.GetResponse())

            {

                using (System.IO.Stream s =   response.GetResponseStream())

                {

                    string StrDate = string.Empty;

                    using (StreamReader Reader = new StreamReader(s,   Encoding.UTF8))

                    {

                        while ((StrDate = Reader.ReadLine())   != null)

                        {

                              strValue += StrDate + "\r\n";

                        }

                    }

                }

            }

 

请求示例(JAVA):

Map<String, String> paramMap = new HashMap();

paramMap.put("ActionName", "LoadBizObject");

paramMap.put("SchemaCode", "D000024chuangjian");

paramMap.put("BizObjectId","fea0ade0-505d-4ffc-bca0-6cbdf3c302c6");

 

//身份认证参数

Map headers = new HashMap();

headers.put("EngineCode","");

headers.put("EngineSecret","");

 

Gson gson = new Gson();

String result = HttpRequestUtil.sendPost(url,   gson.toJson(paramMap), headers);

 

返回结果:

{

    "Successful": true,

    "ErrorMessage": null,

    "Logined": false,

    "ReturnData": {

      "BizObject": {

        "ObjectId": "fea0ade0-505d-4ffc-bca0-6cbdf3c302c6",

        "Name": "123",

        "ModifiedBy": "System",

        "ModifiedTime": "2019/6/12 14:32:06",

        "WorkflowInstanceId":   "f6a030fc-1311-4877-bc88-cb2649a8f784",

        "Status": 2,

        "OwnerId": "System",

        "F0000028": null,

        "F0000002": "123",

        "ModifiedByObject": {

          "ObjectId":   "18f923a7-5a5e-426d-94ae-a55ad1a4b239",

          "Name": "System"

        },

        "OwnerIdObject": {

          "ObjectId":   "f3f69a49-edf6-468d-9aee-8cbc82a46662",

          "Name": "System"

        },

        "CreatedByObject": {

          "ObjectId":   "f3f69a49-edf6-468d-9aee-8cbc82a46662",

          "Name": "System"

        },

        "OwnerDeptIdObject": {

          "ObjectId":   "04204118-a9d4-42bf-898b-1cb2f2f73e29",

          "Name": "System部门"

        }

    }

    },

    "DataType": 0

}

 

参数

说明

Successful

返回结果是否成功true/false

ErrorMessage

错误信息

Logined

未使用,忽略

ReturnData

返回的数据

DataType

返回的数据类型,默认0