如何设置带有验证的日期字段

问题描述 投票:0回答:1

我使用 adobe Rest API v6。我想向带有日期字段的用户发送协议,并且日期字段应该进行验证。我发送以下 json。用户可以看到文本字段,但没有格式。仅当数据具有日期格式时,Adobe 才能验证用户数据。

实际:2024 年 1 月 21 日 - 对于 Adobe 来说可以,但对我来说不行

预计:21/01/2024 - 对我来说没问题

我想我需要配置

validation
validationData
但该怎么做呢?我需要线索。

{

    "name": "Sinatures",
    "signatureType": "ESIGN",
    "state": "IN_PROCESS",
    "status": null,
    "formFieldGenerators": [
        {
            "participantSetName": "unknown",
            "formFieldNamePrefix": "//textu11//",
            "generatorType": "ANCHOR_TEXT",
            "formFieldDescription": {
                "contentType": "DATA",
                "inputType": "TEXT_FIELD",
                "required": true,
                "masked": false,
                "fontName": null,
                "fontColor": null,
                "fontSize": null,
                "displayFormatType" : "DATE",
                "displayFormat": "mm/dd/yyyy",
                "validationData": "mm/dd/yyyy",
                "validation": "DATE_CUSTOM"
            },
            "anchorTextInfo": {
                "anchorText": "//textu11//",
                "anchoredFormFieldLocation": {
                    "height": 20,
                    "width": 150,
                    "offsetX": 20,
                    "offsetY": 0
                }
            }
        }
    ]
}
rest adobe adobe-sign
1个回答
0
投票

使用V6 Rest api,您可以先创建协议,然后

PUT
表单字段单独更改

PUT /agreements/{agreementId}/formFields HTTP/1.1
authorization: Bearer xxxxx
x-api-user: ""
content-type: application/json; charset=utf-8

{
    "fields": [
        {
            "name": "Date Signed",
            "inputType": "TEXT_FIELD",
            "contentType": "SIGNATURE_DATE",
            "required": true,
            "locations": [
                {
                    "height": 20,
                    "width": 150,
                    "left": 20,
                    "top": 0
                }
            ],
            "displayformatType": "DATE",
            "displayFormat": "mm/dd/yyyy",
            "validation": "DATE_CUSTOM",
            "validationData": "mm/dd/yyyy",
            "validationErrMsg": "Invalid Date Format"
        }
    ]
}
© www.soinside.com 2019 - 2024. All rights reserved.