Introduction

介绍:

本套接口是Digital Maker提供的web Api形式的接口,支持操作Document、DataSourceList等数据。以下是对本套接口的规范说明。

调用地址:

开启签名验证不使用Cookie:

[domain]/[TenantId]/[AppCode]/CustomApi/[MethodName]

其中:

domain与AppMaker的domain一致,通过domain区分不同环境,

TenantId和AppCode是接口想访问的数据范围,

CustomApi是固定内容,写死即可,

MethodName指明具体调用哪个接口。

开启签名验证使用Cookie:

[domain]/[TenantId]/[AppCode]/Pages/[PageCode]/InternalApi/[MethodName]

OR

[domain]/[TenantId]/[AppCode]/Form/[PageMode]/[FormAlias]/InternalApi/[MethodName]

编码规范:

json,utf-8

HttpMethod:

除非特殊说明,否则所有接口默认使用 POST 调用

调用示例

  • JavaScrip Ajax

    //postData参数应该是一个JS对象的序列化值
    var postData = JSON.stringify({
                  "QueryAlias": "ewbtlegh2bn",
                  "Index": 0,
                  "Size": 10,
                  "SearchValues": {
                            "@@creator":this.creator
                  },
                  "StaffCode":"##190111031015539"
                });
    //注意type、contenType
    $.ajax({
        type: 'POST',
        contentType:"application/json;charset=utf-8",
        url: '/tenantId/appCode/CustomAPI/GetDocumentsByQuery',
        data: postData,
        dataType: 'json',
        success: function (data) {
            console.log(data.Data);
        },
        error: function (data) {
            alert("error");
        }
    })
    
  • C#

    //postData 应该是一个object的序列化值
    var postData=JsonConvert.SerializeObject(new object());
    var client = new HttpClient { BaseAddress = new Uri("http://www.ants.com") };
    var content = new StringContent(postData);
    //注意设置contentType
    content.Headers.ContentType = new MediaTypeHeaderValue("application/json");
    var postResponse = await client.PostAsync("/tenantId/appCode/CustomAPI/GetDocumentsByQuery", content).ConfigureAwait(false);
    postResponse.EnsureSuccessStatusCode();
    var result = await postResponse.Content.ReadAsStringAsync();
    

修改日志

点此查看修改日志

© Digital Maker Product Team all right reserved,powered by Gitbook该文件修订时间: 2023-02-02 10:40:12

results matching ""

    No results matching ""