gpt4 book ai didi

java - 如何更新文档签名信封文档?

转载 作者:行者123 更新时间:2023-12-01 09:53:20 31 4
gpt4 key购买 nike

在下面的java中,我创建了一个包含文档的信封,然后尝试更新该文档。创建工作正常,但我在更新时遇到文件转换错误。我正在使用 docusign java 客户端。有什么想法吗?

    // create
List<Document> documents = new ArrayList<>();
Document document = newDocument("1", "title", file);
documents.add(document);

EnvelopeDefinition envelopeDefinition = new EnvelopeDefinition();
envelopeDefinition.setDocuments(documents);
envelopeDefinition.setStatus("created");
EnvelopesApi envelopesApi = new EnvelopesApi();
EnvelopeSummary envelopeSummary = envelopesApi.createEnvelope(accountId, envelopeDefinition);

// update
documents = new ArrayList<>();
document = newDocument("2", "title 2", file);
documents.add(document);

envelopeDefinition = new EnvelopeDefinition();
envelopeDefinition.setDocuments(documents);
envelopeDefinition.setStatus("created");
EnvelopeDocumentsResult envelopeDocumentsResult = envelopesApi.updateDocuments(accountId, envelopeSummary.getEnvelopeId(), envelopeDefinition);

回应

class EnvelopeDocumentsResult {
envelopeId: a826c9f9-75f0-41bc-a958-537c45bc3918
envelopeDocuments: [class EnvelopeDocument {
documentId: 2
name: null
type: null
uri: null
order: 2
pages: null
containsPdfFormFields: null
errorDetails: class ErrorDetails {
errorCode: FORMAT_CONVERSION_ERROR
message: The data could not be converted.
}
}]
}

最佳答案

我不确定"file"变量是什么。但 DocuSign API 要求文件以 Base64 进行编码。我知道 EnvelopeDefinition 类非常复杂,所以我建议看一下这个示例并将代码片段与您的代码片段进行比较:https://www.docusign.com/developer-center/recipes/request-a-signature-via-email

另外请分享envelopeDefinition.toString()(您可以匿名化任何敏感数据)!

关于java - 如何更新文档签名信封文档?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37446350/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com