使用REST DocuSign API从模板获取所有选项卡 [英] Getting all tabs from a template using REST DocuSign API

查看:77
本文介绍了使用REST DocuSign API从模板获取所有选项卡的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道最好的方法是使用REST API从模板中获取所有选项卡。

I was wondering what the best approach is to get all the tabs from a template using the REST API.

我目前试图做的就是获取所有收件人及其所有选项卡,以便我们在创建信封时可以默认使用某些值以及填充了值的锁定字段。

What I am currently trying to do is get all the recipients and all of their tabs so that we can default some of the values as well as lock fields that have populated values when creating the envelope.


  • 要获取收件人,我正在使用/ envelopes / {templateId} / recipients。

  • 要获取标签,我将遍历模板中的所有收件人,然后我会使用/ envelopes / {templateId} / recipients / {recipientId} / tabs。

我想知道这是否最好就像我将向DocuSign拨打尽可能多的电话一样,如果有更好的方法,我也不想拨打额外的电话。

I was wondering if this would be the best approach as I would be making as many calls to DocuSign as there are recipients and don't want to make extra calls if there is a better way of doing this.

谢谢

推荐答案

实际上,有一种更简单的方法可以通过REST API获取模板的所有字段(标签)。只需进行以下(单个)调用:

Actually, there's a simpler way to get all the fields (tabs) for a Template via the REST API. Simply make the following (single) call:

GET https://{{env}}.docusign.net/restapi/{{version}}/accounts/{{acctId}}/envelopes/{{templateId}}/recipients?include_tabs=true&include_extended=true

成功的响应将包含每种收件人类型(即,签名人代理 carbonCopies)的模板收件人的集合等),并且这些集合中的每个接收者对象都将包含有关接收者标签的信息。例如,这是包含两个Signer的Template的响应-每个拥有多个不同类型的标签:

A successful response will contain a collection of the Template's Recipients for each recipient type (i.e., signers, agents, carbonCopies, etc.) -- and each recipient object within any of those collections will include information about the recipient's tabs. For example, here's the response for a Template that contains two Signers -- each 'owning' several tabs of various types:

{
    "signers": [
        {
            "tabs": {
                "signHereTabs": [
                    {
                        "name": "Sign Here",
                        "tabLabel": "Signature 1",
                        "scaleValue": 1,
                        "optional": "false",
                        "documentId": "1",
                        "recipientId": "f1b5d256-d85c-42d3-b081-913fb93e13a7",
                        "pageNumber": "1",
                        "xPosition": "74",
                        "yPosition": "96",
                        "tabId": "bb7df562-665c-4f8d-8395-56f0c2f6accf"
                    }
                ],
                "textTabs": [
                    {
                        "height": 11,
                        "validationPattern": "",
                        "validationMessage": "",
                        "shared": "false",
                        "requireInitialOnSharedChange": "false",
                        "name": "Text",
                        "value": "",
                        "width": 42,
                        "required": "true",
                        "locked": "false",
                        "concealValueOnDocument": "false",
                        "disableAutoSize": "false",
                        "tabLabel": "address",
                        "bold": "false",
                        "italic": "false",
                        "underline": "false",
                        "documentId": "1",
                        "recipientId": "f1b5d256-d85c-42d3-b081-913fb93e13a7",
                        "pageNumber": "1",
                        "xPosition": "74",
                        "yPosition": "257",
                        "tabId": "451365aa-f066-45b9-aa58-4d7da60f3039"
                    }
                ],
                "radioGroupTabs": [
                    {
                        "documentId": "1",
                        "recipientId": "f1b5d256-d85c-42d3-b081-913fb93e13a7",
                        "groupName": "Radio Group 1",
                        "radios": [
                            {
                                "pageNumber": "1",
                                "xPosition": "185",
                                "yPosition": "165",
                                "value": "Radio 1",
                                "selected": "false",
                                "tabId": "25362e61-c421-466b-a13c-934bb3be0ac6",
                                "required": "True",
                                "locked": "False"
                            },
                            {
                                "pageNumber": "1",
                                "xPosition": "214",
                                "yPosition": "165",
                                "value": "Radio 2",
                                "selected": "false",
                                "tabId": "350f3efa-f2ba-4aaf-bd78-4b45dc475ee4",
                                "required": "True",
                                "locked": "False"
                            }
                        ]
                    }
                ],
                "listTabs": [
                    {
                        "listItems": [
                            {
                                "text": "Married",
                                "value": "M",
                                "selected": "false"
                            },
                            {
                                "text": "Single",
                                "value": "S",
                                "selected": "false"
                            },
                            {
                                "text": "Divorced",
                                "value": "D",
                                "selected": "false"
                            },
                            {
                                "text": "Widowed",
                                "value": "W",
                                "selected": "false"
                            }
                        ],
                        "value": "",
                        "width": 78,
                        "shared": "false",
                        "requireInitialOnSharedChange": "false",
                        "tabLabel": "MaritalStatus",
                        "bold": "false",
                        "italic": "false",
                        "underline": "false",
                        "documentId": "1",
                        "recipientId": "f1b5d256-d85c-42d3-b081-913fb93e13a7",
                        "pageNumber": "1",
                        "xPosition": "72",
                        "yPosition": "213",
                        "tabId": "b6e5b284-5c87-4a0c-9db5-e4d364ab1113"
                    }
                ]
            },
            "signInEachLocation": "false",
            "name": "",
            "email": "",
            "recipientId": "f1b5d256-d85c-42d3-b081-913fb93e13a7",
            "recipientIdGuid": "f1b5d256-d85c-42d3-b081-913fb93e13a7",
            "requireIdLookup": "false",
            "routingOrder": "1",
            "roleName": "Signer1",
            "status": "created",
            "templateLocked": "false",
            "templateRequired": "false"
        },
        {
            "tabs": {
                "signHereTabs": [
                    {
                        "name": "Sign Here",
                        "tabLabel": "Signature 8",
                        "scaleValue": 1,
                        "optional": "false",
                        "documentId": "1",
                        "recipientId": "79e8bc34-6a40-4cc5-90e1-e58d9707418e",
                        "pageNumber": "1",
                        "xPosition": "354",
                        "yPosition": "88",
                        "tabId": "1e1829ef-005d-4277-b7af-8758cfdf186a"
                    }
                ],
                "fullNameTabs": [
                    {
                        "name": "Full Name",
                        "tabLabel": "Full Name",
                        "bold": "false",
                        "italic": "false",
                        "underline": "false",
                        "documentId": "1",
                        "recipientId": "79e8bc34-6a40-4cc5-90e1-e58d9707418e",
                        "pageNumber": "1",
                        "xPosition": "354",
                        "yPosition": "183",
                        "tabId": "c33c0f3c-2f77-4985-b5b7-d538220a2f86"
                    }
                ],
                "textTabs": [
                    {
                        "height": 11,
                        "validationPattern": "",
                        "validationMessage": "",
                        "shared": "false",
                        "requireInitialOnSharedChange": "false",
                        "name": "Text",
                        "value": "",
                        "width": 42,
                        "required": "true",
                        "locked": "false",
                        "concealValueOnDocument": "false",
                        "disableAutoSize": "false",
                        "tabLabel": "Data Field 9",
                        "bold": "false",
                        "italic": "false",
                        "underline": "false",
                        "documentId": "1",
                        "recipientId": "79e8bc34-6a40-4cc5-90e1-e58d9707418e",
                        "pageNumber": "1",
                        "xPosition": "354",
                        "yPosition": "156",
                        "tabId": "80e5a803-b1d4-4175-97b4-09c6125f3143"
                    }
                ]
            },
            "signInEachLocation": "false",
            "name": "",
            "email": "",
            "recipientId": "79e8bc34-6a40-4cc5-90e1-e58d9707418e",
            "recipientIdGuid": "79e8bc34-6a40-4cc5-90e1-e58d9707418e",
            "requireIdLookup": "false",
            "routingOrder": "2",
            "roleName": "Signer2",
            "status": "created",
            "templateLocked": "false",
            "templateRequired": "false"
        }
    ],
    "agents": [],
    "editors": [],
    "intermediaries": [],
    "carbonCopies": [],
    "certifiedDeliveries": [],
    "inPersonSigners": [],
    "recipientCount": "2"
}

这篇关于使用REST DocuSign API从模板获取所有选项卡的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆