用文档创建信封

Create envelope with document

我想通过 DocuSign 创建一个包含新文档的新信封 Api。

根据 docs, I understand that I need to send a POST request to https://demo.docusign.net/restapi/v2.1/accounts/{accountId}/envelopes.

但我还没有找到如何将文档添加到请求正文的示例。

谁能给我一个代码示例?请求的正文应该是什么样子?

非常感谢。

Here is a link to examples, some using our SDKs

您的 JSON 的 body 可能如下所示:

{
    "emailSubject": "Please sign this document set",
    "documents": [
        {
            "documentBase64": "' > $request_data
            cat $doc1_base64 >> $request_data
            printf '",
            "name": "Lorem Ipsum",
            "fileExtension": "pdf",
            "documentId": "1"
        }
    ],
    "recipients": {
        "carbonCopies": [
            {
                "email": "{USER_EMAIL}",
                "name": "Charles Copy",
                "recipientId": "2",
                "routingOrder": "2"
            }
        ],
        "signers": [
            {
                "email": "{USER_EMAIL}",
                "name": "{USER_FULLNAME}",
                "recipientId": "1",
                "routingOrder": "1",
                "clientUserId": "1000",
                "tabs": {
                    "signHereTabs": [
                        {
                            "anchorString": "/sn1/",
                            "anchorUnits": "pixels",
                            "anchorXOffset": "20",
                            "anchorYOffset": "10"
                        }
                    ]
                }
            }
        ]
    },
    "status": "sent"
}