我一直在玩Docusign API,我只能找到有关请求签名或检索文档的信息。
我有一些从一些pdf生成的模板创建的powerforms。我想要做的是以某种方式检索模板或powerforms,以便我可以拉动字段并将它们映射到另一个系统。通过这种方式,当提交powerform时,我通过connect获取文档,然后可以根据映射将字段存储在单独的系统中。所有这些我都是通过一组java服务来完成的。
这是否可以使用API,如果有的话,之前有人做过类似的事情,或者你能指出我的任何例子或文档的方向吗?
提前感谢您的任何帮助或建议, 真皮
修改
作为对此的更新,我尝试使用
https://demo.docusign.net/restapi/v2/accounts/xxxxxx/templates
获取我的所有模板ID然后
https://demo.docusign.net/restapi/v2/accounts/xxxxxx/templates/{template-id}
获取模板定义。在REST开发人员指南中,示例响应看起来有一个customfields部分
"customFields":{
"listCustomFields":[{
"name":"String content",
"required":"String content",
"show":"String content",
"value":"String content",
"listItems":["String content"]
}],
"textCustomFields":[{
"name":"String content",
"required":"String content",
"show":"String content",
"value":"String content"
}]
},
但是,在我的回复中我没有看到任何这样的部分(下面的示例数据x出来)。我确实在我的模板中添加了一些示例自定义字段,所以我想知道为什么没有回来或者我可能没有正确指定它们?
{ "envelopeTemplateDefinition":
{ "templateId": "xxx",
"name": "xxx",
"shared": "true",
"password": "",
"description": "",
"lastModified": "xxx",
"pageCount": x,
"uri": "xxx",
"folderName": "xxx",
"folderId": "xxx",
"folderUri": "xxx",
"owner": {
"userName": "xxx",
"email": "xxx",
"userId": "xxx"
}
},
"documents": [
{
"documentId": "xxx",
"uri": "xxx",
"name": "xxx",
"order": "xxx",
"pages": "xxx"
}
],
"recipients":
{
"signers": [
{
"defaultRecipient": "xxx",
"signInEachLocation": "xxx",
"name": "",
"email": "",
"recipientId": "xxx",
"accessCode": "",
"requireIdLookup": "xxx",
"routingOrder": "1",
"note": "",
"roleName": "xxx",
"templateLocked": "xxx",
"templateRequired": "xxx",
"inheritEmailNotificationConfiguration": "xxx"
}
],
"agents": [],
"editors": [],
"intermediaries": [],
"carbonCopies": [],
"certifiedDeliveries": [],
"inPersonSigners": [],
"recipientCount": "1"
},
"notification":
{
"reminders":
{
"reminderEnabled": "xxx",
"reminderDelay": "0",
"reminderFrequency": "0"
},
"expirations":
{
"expireEnabled": "xxx",
"expireAfter": "xxx",
"expireWarn": "0"
}
},
"emailSubject": "xxx",
"emailBlurb": "",
"signingLocation": "xxx",
"authoritativeCopy": "xxx",
"enforceSignerVisibility": "xxx",
"enableWetSign": "xxx",
"allowMarkup": "xxx"
}
如果有人有任何想法为什么customFields部分可能从上面遗漏,那就太棒了。目前我将尝试下面的Kims方法(感谢Kim!),看看是否涵盖了我正在尝试做的事情......
答案 0 :(得分:1)
DocuSign开发人员中心(http://www.docusign.com/developer-center)包含大量有关使用DocuSign API的信息 - 除了您已经找到的REST API指南之外,还要检查一下。
关于您描述的场景 - 即,想要使用API来确定在DocuSign模板中定义哪些字段 - 这当然是可能的。只需执行获取收件人请求,并将查询参数 include_tabs 设置为 true ,并包含模板ID以代替信封ID通常进入的位置请求网址。例如:
GET https://{{env}}.docusign.net/restapi/{{version}}/accounts/{{acctId}}/envelopes/{{templateId}}/recipients?include_tabs=true&include_extended=true
响应将包括为模板指定的所有收件人角色,以及每个收件人角色,属于收件人角色的选项卡(字段)。以下是包含两个收件人角色(均为type = 签名者)的模板的示例响应,每个收件人角色拥有多个不同类型的不同选项卡(字段):
{
"signers": [
{
"tabs": {
"signHereTabs": [
{
"name": "SignHere",
"tabLabel": "Sign Here",
"scaleValue": 1,
"optional": "false",
"documentId": "1",
"recipientId": "1",
"pageNumber": "1",
"xPosition": "10",
"yPosition": "100",
"tabId": "15311994-b09a-4ea5-b24d-d185875ba378"
},
{
"name": "Sign Here",
"tabLabel": "Signature 8",
"scaleValue": 1,
"optional": "false",
"documentId": "2",
"recipientId": "1",
"pageNumber": "1",
"xPosition": "71",
"yPosition": "107",
"tabId": "ff79b73d-ad5b-423c-9a37-70547e928100"
}
],
"initialHereTabs": [
{
"name": "Initial Here",
"tabLabel": "Initial 31",
"scaleValue": 1,
"optional": "false",
"documentId": "3",
"recipientId": "1",
"pageNumber": "1",
"xPosition": "75",
"yPosition": "106",
"tabId": "6be4892d-a2d2-4f50-b0ff-0acd5108dc6d"
}
],
"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": "1",
"pageNumber": "1",
"xPosition": "108",
"yPosition": "142",
"tabId": "0039105d-2a47-4937-874f-00307c54bca4"
},
{
"height": 11,
"validationPattern": "",
"validationMessage": "",
"shared": "false",
"requireInitialOnSharedChange": "false",
"name": "Text",
"value": "",
"width": 42,
"required": "true",
"locked": "false",
"concealValueOnDocument": "false",
"disableAutoSize": "false",
"tabLabel": "City",
"bold": "false",
"italic": "false",
"underline": "false",
"documentId": "1",
"recipientId": "1",
"pageNumber": "1",
"xPosition": "180",
"yPosition": "142",
"tabId": "1f071721-fe91-49cd-ab43-a316548adea6"
},
{
"height": 11,
"validationPattern": "",
"validationMessage": "",
"shared": "false",
"requireInitialOnSharedChange": "false",
"name": "Text",
"value": "",
"width": 42,
"required": "true",
"locked": "false",
"concealValueOnDocument": "false",
"disableAutoSize": "false",
"tabLabel": "State",
"bold": "false",
"italic": "false",
"underline": "false",
"documentId": "1",
"recipientId": "1",
"pageNumber": "1",
"xPosition": "250",
"yPosition": "142",
"tabId": "687f4dc4-736d-4a45-b195-29b44b7cb8a9"
},
{
"height": 11,
"validationPattern": "",
"validationMessage": "",
"shared": "false",
"requireInitialOnSharedChange": "false",
"name": "Text",
"value": "",
"width": 42,
"required": "true",
"locked": "false",
"concealValueOnDocument": "false",
"disableAutoSize": "false",
"tabLabel": "Zip",
"bold": "false",
"italic": "false",
"underline": "false",
"documentId": "1",
"recipientId": "1",
"pageNumber": "1",
"xPosition": "343",
"yPosition": "142",
"tabId": "e94a42fc-a38b-4536-a25a-008db64376a3"
}
],
"radioGroupTabs": [
{
"documentId": "1",
"recipientId": "1",
"groupName": "IsUSCitizen",
"radios": [
{
"pageNumber": "1",
"xPosition": "328",
"yPosition": "195",
"value": "Yes",
"selected": "false",
"tabId": "8cd7c1c3-41d3-4803-9a25-d4798e4f8465",
"required": "True",
"locked": "False"
},
{
"pageNumber": "1",
"xPosition": "328",
"yPosition": "217",
"value": "No",
"selected": "false",
"tabId": "c8481da7-5bf3-4648-a002-feb5b697746c",
"required": "True",
"locked": "False"
}
]
}
]
},
"signInEachLocation": "false",
"name": "",
"email": "",
"recipientId": "1",
"recipientIdGuid": "dd9dda12-13a8-4f91-ba77-f9427ce9c4c6",
"requireIdLookup": "false",
"routingOrder": "1",
"roleName": "Signer1",
"status": "created",
"templateLocked": "false",
"templateRequired": "false"
},
{
"tabs": {
"signHereTabs": [
{
"name": "Sign Here",
"tabLabel": "Signature 9",
"scaleValue": 1,
"optional": "false",
"documentId": "2",
"recipientId": "e3a92e6d-1533-4785-a814-2e4e7f96bef5",
"pageNumber": "1",
"xPosition": "71",
"yPosition": "194",
"tabId": "fd8eff65-105f-46ae-9f28-305790c9d4e7"
}
],
"initialHereTabs": [
{
"name": "Initial Here",
"tabLabel": "Initial 32",
"scaleValue": 1,
"optional": "false",
"documentId": "3",
"recipientId": "e3a92e6d-1533-4785-a814-2e4e7f96bef5",
"pageNumber": "1",
"xPosition": "75",
"yPosition": "154",
"tabId": "b01922a7-f20a-4dc4-9327-96e592733ca9"
}
],
"numberTabs": [
{
"validationPattern": "",
"validationMessage": "",
"shared": "false",
"requireInitialOnSharedChange": "false",
"name": "Text",
"value": "",
"width": 42,
"required": "true",
"locked": "false",
"concealValueOnDocument": "false",
"disableAutoSize": "false",
"tabLabel": "Quantity",
"bold": "false",
"italic": "false",
"underline": "false",
"documentId": "1",
"recipientId": "e3a92e6d-1533-4785-a814-2e4e7f96bef5",
"pageNumber": "1",
"xPosition": "43",
"yPosition": "396",
"tabId": "37cfcb7d-4357-4c6b-a9b8-500e5e9dc9b6"
}
],
"listTabs": [
{
"listItems": [
{
"text": "Regular",
"value": "Regular",
"selected": "false"
},
{
"text": "Express",
"value": "Express",
"selected": "false"
}
],
"value": "",
"width": 78,
"shared": "false",
"requireInitialOnSharedChange": "false",
"tabLabel": "ShippingMethod",
"bold": "false",
"italic": "false",
"underline": "false",
"documentId": "1",
"recipientId": "e3a92e6d-1533-4785-a814-2e4e7f96bef5",
"pageNumber": "1",
"xPosition": "121",
"yPosition": "395",
"tabId": "6f663d22-3632-486b-a1f5-7455c665b9d8"
}
]
},
"signInEachLocation": "false",
"name": "",
"email": "",
"recipientId": "e3a92e6d-1533-4785-a814-2e4e7f96bef5",
"recipientIdGuid": "e3a92e6d-1533-4785-a814-2e4e7f96bef5",
"requireIdLookup": "false",
"routingOrder": "2",
"roleName": "Signer2",
"status": "created",
"templateLocked": "false",
"templateRequired": "false"
}
],
"agents": [],
"editors": [],
"intermediaries": [],
"carbonCopies": [],
"certifiedDeliveries": [],
"inPersonSigners": [],
"recipientCount": "2"
}
DocuSign REST API指南(您在评论中链接到的)包含有关各种标签类型和每个标签类型包含的属性的信息。
答案 1 :(得分:0)
我知道这篇帖子的回复非常晚,但它可能会帮助其他一些需要的人。我正在使用REST Api从docusig帐户检索签名文档。
//获取docusign详细信息
$email = "enter your associated docusign account email";
$password = "enter your associated docusign account password";
$integratorKey = "enter your associated docusign account integrated key";
//将您的帐户信息传递到标题
$header = "<DocuSignCredentials><Username>" . $email . "</Username><Password>" . $password . "</Password><IntegratorKey>" . $integratorKey . "</IntegratorKey></DocuSignCredentials>";
//从docusign模拟账户中检索文档
$url = "https://demo.docusign.net/restapi/v2/login_information";
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, array("X-DocuSign-Authentication: $header"));
$json_response = curl_exec($curl);
$status = curl_getinfo($curl, CURLINFO_HTTP_CODE);
if ( $status != 200 ) {
$status = false;
}
$response = json_decode($json_response, true);
$accountId = $response["loginAccounts"][0]["accountId"];
$baseUrl = $response["loginAccounts"][0]["baseUrl"];
curl_close($curl);
// get document
$documentId = 1; //provide your document id
$curl = curl_init($baseUrl . "/envelopes/" . $envelopeID . "/documents/". $documentId."?show_changes=" );
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
'Content-Type: application/pdf',
"X-DocuSign-Authentication: $header" )
);
$json_response = curl_exec($curl);
$status = curl_getinfo($curl, CURLINFO_HTTP_CODE);
if ( $status != 200) {
$status = false;
}
curl_close($curl);
//您可以在此打印您的回复,或者如果您想以PDF格式保存,则可以添加以下代码
$path = APPLICATION_PATH . 'your path';
$filename ="your file name";
chmod("$path", 0777);
file_put_contents("$path/$filename", $json_response);