Docusignapi 将文件添加到草稿信封中,不带签名选项卡
我们正在使用RESTAPI中的Java库开发一个对多个文档进行签名的过程,其中签名位置是使用signHereTabs中的anchorString设置的,每个签名者的anchorString是插入待签名文档的字符串; 因为我们有大小大于25MB的文档,所以我们使用中报告的内容,即我们创建一个信封草稿status=created,然后用文档更新信封; 问题是,当我们将信封设置为status=sent时,签名者会收到电子邮件,打开指向DocuSign的链接,但只有第一个文档允许访问主播字符串。 有没有什么特别的方法来更新信封草稿中的文件列表 谢谢 我们获得 选项卡:文档ID 1:类选项卡{ ... signHereTabs:[类SignHere{ anchorCaseSensitive:空 anchorHorizontalAlignment:空 anchorIgnoreIfNotPresent:空 anchorMatchWholeWord:null 主持人:买家 主播单位:像素 主持人:10人 锚地偏移量:-10 conditionalParentLabel:null conditionalParentValue:null customTabId:null 文件编号:1 errorDetails:空 合并字段:空 姓名:SignHere 可选:false 页码:1 接收方ID:edb96dfd-9700-4328-ba45-825a1284b030 scaleValue:1.0 印章类型:签名 stampTypeMetadata:null 状态:空 表号:e484087c-70c2-431c-9825-47605e1f44c2 塔巴贝尔:在这里签名 tabOrder:null templateLocked:空 templateRequired:空 工具提示:空 X职位:123 位置:297 }] ... } 选项卡:文档ID 2:类选项卡{ ... 签名页:[] ... }Docusignapi 将文件添加到草稿信封中,不带签名选项卡,docusignapi,Docusignapi,我们正在使用RESTAPI中的Java库开发一个对多个文档进行签名的过程,其中签名位置是使用signHereTabs中的anchorString设置的,每个签名者的anchorString是插入待签名文档的字符串; 因为我们有大小大于25MB的文档,所以我们使用中报告的内容,即我们创建一个信封草稿status=created,然后用文档更新信封; 问题是,当我们将信封设置为status=sent时,签名者会收到电子邮件,打开指向DocuSign的链接,但只有第一个文档允许访问主播字符串。 有没有
其中documentId 1在信封已创建状态=已创建时已上载,documentId 2在第二步中已上载documentId 1和documentId 2均包含主播字符串:BUYER\u 0。如果您的文档大小大于25MB,则将文档置于草稿模式也将无济于事,相反,您必须使用添加任何小于50MB的文档。如果JSON请求负载大于25 MB,则通过草稿添加多个文档是有用的,但如果信封中的任何文档大于25 MB,则将不有用。若要添加到Amit的答案中,则对DocuSign的每个API请求都必须小于25 MB 由于默认技术是在JSON对象内发送Base64编码的文档,因此在单个请求中发送的所有文档的有效最大总大小约为18MB 通过将API请求作为多部分MIME消息发送,可以避免Base64开销。此技术使您能够将文档作为二进制对象发送。请参阅代码示例,以了解PHP、Java、Node.js、Python和Ruby的可用代码 附加的 如果每个文档小于18MB,则可以使用常规JSON对象和Base64一次编码一个文档。如果文档大小之和大于18MB,则必须一次上载一个: 创建信封,包括其中一个文档。应创建文档状态,以便此时不发送信封。 向信封中添加更多文档,一次添加一个。您可以使用API方法。您可能希望在上应用查询参数\u文档\u字段。 使用将信封状态更新为已发送
对于向文档添加选项卡,如果使用锚定选项卡定位,则可以在开始时定义它们。或者,您也可以在将文档添加到信封后,将选项卡添加到信封定义中。谢谢大家的回答。 我用这种方式解决了这个问题: -步骤2:在每个添加的文件上设置参数apply_document_fields, -步骤3:再次设置信封中的收件人,然后将其设置为“已发送”。
在我看来,这个问题已经解决了。谢谢你的回答。更多细节:信封里有不止一份文件;每个文档的大小小于25MB;所有文档的大小总和超过25MB。欢迎使用StackOverflow,并感谢您使用DocuSign!请投票选出所有有用的答案,包括对他人问题的答案。请检查并接受您自己问题的最佳答案。谢谢。请看我的最新答案。
// add a recipient to sign the document, identified by name and email we used above
int recipientId = 0;
List<Signer> signerList = new ArrayList<Signer>();
/* to fix the position where the signature has to be inserted */
int buyerIdx = 0;
int supplierIdx = 0;
for(DSSignerInfo signerInfo : signers) {
Tabs tabs = new Tabs();
Signer signer = new Signer();
signer.setEmail(signerInfo.getEmail());
signer.setName(signerInfo.getName());
signer.setRecipientId(String.valueOf(++recipientId));
signer.setRoutingOrder(String.valueOf(recipientId)); // sequential
signer.setRoleName("role unknown");
RecipientEmailNotification emailNotification = new RecipientEmailNotification();
emailNotification.setEmailBody("emailBody - "+signerInfo.getName());
emailNotification.setEmailSubject("emailSubject - "+signerInfo.getName());
emailNotification.setSupportedLanguage(signerInfo.getLanguage());
signer.setEmailNotification(emailNotification);
// create a signHere tab somewhere on the document for the signer to sign
// default unit of measurement is pixels, can be mms, cms, inches also
for(int documentId = 1; documentId <= documentFiles.size(); documentId++) {
SignHere signHere = new SignHere();
signHere.setDocumentId("" + documentId);
signHere.setPageNumber("1");
signHere.setRecipientId(String.valueOf(recipientId));
if(signerInfo.getRole().equalsIgnoreCase("buyer")) {
signHere.setAnchorString("BUYER_"+buyerIdx);
} else {
signHere.setAnchorString("SUPPLIER_"+supplierIdx);
}
signHere.setAnchorXOffset("10");
signHere.setAnchorYOffset("10");
tabs.addSignHereTabsItem(signHere);
}
signer.setTabs(tabs);
signerList.add(signer);
if(signerInfo.getRole().equalsIgnoreCase("buyer")) {
buyerIdx++;
} else {
supplierIdx++;
}
}
Recipients recipients = new Recipients();
recipients.setSigners(signerList);
envDef.setRecipients(recipients);
try {
String envelopeId = null;
EnvelopesApi envelopesApi = null;
// create a byte array that will hold our document bytes
int documentId = 1;
for(String documentFile : documentFiles) {
byte[] fileBytes = null;
try {
// read file
Path path = Paths.get(documentFile);
fileBytes = Files.readAllBytes(path);
} catch (IOException ioExcp) {
// handle error
System.out.println("Exception: " + ioExcp);
return null;
}
// add a document to the envelope
Document doc = new Document();
String base64Doc = Base64.getEncoder().encodeToString(fileBytes);
doc.setDocumentBase64(base64Doc);
String fileName = new File(documentFile).getName();
doc.setName(documentId+"_"+fileName);
doc.setFileExtension(fileName.lastIndexOf('.') > 0 ? fileName.substring(fileName.lastIndexOf('.') + 1) : "");
doc.setDocumentId("" + documentId++);
envDef.addDocumentsItem(doc);
if(envelopeId == null || envelopesApi == null) {
// To save as a draft set to "created" (for test purpose I create and envelope with only one file)
envDef.setStatus("created");
envelopesApi = new EnvelopesApi();
EnvelopeSummary envelopeSummary = envelopesApi.createEnvelope(accountId, envDef);
envelopeId = envelopeSummary.getEnvelopeId();
} else {
// the files after the 1st are updated in the draft envelope
envDef.setRecipients(recipients);
List<Document> tmpDocumentList = new ArrayList<Document>();
doc.setApplyAnchorTabs("true");
tmpDocumentList.add(doc);
envDef.setDocuments(tmpDocumentList);
EnvelopeDocumentsResult envelopeDocumentsResult = envelopesApi.updateDocuments(accountId, envelopeId, envDef);
}
}
Envelope envelope = envelopesApi.getEnvelope(accountId, envelopeId);
envelope.setStatus("sent");
envelope.setPurgeState(null);
EnvelopesApi.UpdateOptions uo = envelopesApi. new UpdateOptions();
uo.setAdvancedUpdate("true");
EnvelopeUpdateSummary envelopeUpdateSummary = envelopesApi.update(accountId, envelopeId, envelope, uo);
documentId = 1;
for(String documentFile : documentFiles) {
Tabs tabs = envelopesApi.getDocumentTabs(accountId, envelopeId, ""+documentId++);
System.out.println("CARLO Tabs 3, documentId "+(documentId - 1)+": "+tabs);
}
documentId = 1;
for(String documentFile : documentFiles) {
Tabs tabs = envelopesApi.getDocumentTabs(accountId, envelopeId, ""+documentId++);
System.out.println("Tabs: documentId "+(documentId - 1)+": "+tabs);
}