0

任何人都可以为 createAndSendenvelope 提供一个示例顶点代码 R​​EST API 示例。我正在使用演示 DocuSign 沙箱,我收到 INCOMPLETE ENVELOPE 错误。我的信封中确实包含所有必需的元素,因此请查看我缺少的内容,或者我是否没有以正确的方式创建它。下面是我作为请求传递的 json,我得到响应:“信封不完整。完整的信封需要文档、收件人、选项卡和主题行。内容类型不包含边界参数。”

--BOUNDARY
Content-Type: application/json
Content-Disposition: form-data

{
    "status": "created",
    "recipients": {
        "signers": [{
            "tabs": {
                "signHeretabs": [{
                    "yPosition": "15",
                    "xPosition": "249",
                    "width": "100",
                    "tablabel": null,
                    "required": "TRUE",
                    "recipientId": "1",
                    "pagenumber": "1",
                    "fontSize": "Size12",
                    "font": "Calibri",
                    "documentid": "1",
                    "anchorYoffset": null,
                    "anchorXOffset": null,
                    "anchorUnits": "pixels",
                    "anchorString": "Sign Here",
                    "anchorIgnoreIfNotPresent": "true"
                }],
                "initialsTabs": [{
                    "yPosition": "45",
                    "xPosition": "249",
                    "width": "100",
                    "tablabel": null,
                    "required": "TRUE",
                    "receipientId": "1",
                    "pagenumber": "1",
                    "fontSize": "Size12",
                    "font": "Calibri",
                    "documentId": "1",
                    "anchorYoffset": null,
                    "anchorXOffset": null,
                    "anchorUnits": "pixels",
                    "anchorString": "Initials Here",
                    "anchorIgnoreIfNotPresent": "true"
                }],
                "dateSignedTabs": [{
                    "yPosition": "65",
                    "xPosition": "249",
                    "width": "100",
                    "tablabel": null,
                    "required": "TRUE",
                    "receipientid": "1",
                    "pagenumber": "1",
                    "fontSize": "Size12",
                    "font": "Calibri",
                    "documentid": "1",
                    "anchorYoffset": "-5",
                    "anchorXOffset": null,
                    "anchorUnits": "pixels",
                    "anchorString": "Date Signed",
                    "anchorIgnoreIfNotPresent": "true"
                }]
            },
            "routingorder": "1",
            "rolename": "First Signer",
            "recipientid": "1",
            "name": "Marisol L Testcase",
            "email": "testfd1@gcpa.com"
        }]
    },
    "emailsubject": "TestDocuSign Call",
    "emailBlurb": "Test Email Blurb",
    "documents": [{
        "name": "Name1",
        "fileExtension": ".txt",
        "documentId": "1",
        "documentBase64": null
    }]
}

--BOUNDARY
Content-Type: application/octet-stream
Content-Disposition: file; filename="Name1"; documentid=1
Content-Transfer-Encoding: base64

VGhpcyBpcyBhIHNhbXBsZSBmaWxlIHVwbG9hZCBmb3IgdGVzdGluZy4=
--BOUNDARY--

更新:我可以摆脱边界参数错误,现在得到“信封不完整。完整的信封需要文档、收件人、标签和主题行。缺少信封定义。

4

1 回答 1

0

您不应该放入"documentBase64": null“文档”节点,因为您已经将文档作为多部分请求传递并且"fileExtension"应该是"txt" not ".txt". 现在来到选项卡分配,您正在混合两种策略,一种是 X/Y 位置,另一种是 Anchor String。您应该使用其中之一,X/Y 位置将在指定位置放置一个 DocuSign 选项卡X/Y position,而AnchorString将尝试在文档中找到该字符串,如果找到,则在其上附加 DocuSign 选项卡。并且没有后备策略,这意味着如果锚字符串不可用则放置 X/Y 位置,这是不可能的。因此,要么您的文档应该有锚字符串,然后使用锚字符串策略,否则从 JSON 中删除锚字符串相关属性并根据 X/Y 位置放置标签。

于 2017-11-28T17:41:06.150 回答