我可以像通过API一样在文档级别添加隐藏的元数据吗?在DocuSign API中,我可以在文档对象中执行以下操作:
new Document()
{
DocumentId = (i+1).ToString(),
DocumentBase64 = Convert.ToBase64String(request.Documents[i].Stream.ReadAsBytes()),
Name = request.Documents[i].Name,
DocumentFields = new List<NameValue>()
{
new NameValue()
{
Name = "DocumentType",
Value = "ElectronicConsent"
}
}
};
DocumentFields
指定 文档是什么。通过API,我可以检索文档及其字段:
EnvelopeDocumentsResult docList = envApi.ListDocuments(_accountId, envelopeId);
DocumentFieldsInformation docInfo = envApi.ListDocumentFields(_accountId, envelopeId, document.DocumentId);
由于我知道返回的文档是什么,我现在可以在其上运行业务逻辑。我想让用户能够在UI中执行类似的操作。这将允许API检索不源自代码的信封,但代码仍然知道如何处理该类型的文档。
我尝试了以下内容:
当我运行相同的API方法来检索“文档字段”时,不会返回该值。看起来手动将字段放在文档上会导致该字段成为“表单”的一部分而不是元数据。
答案 0 :(得分:1)
You cannot set Document Field as you can set it in an API. The Document Custom Field which you are setting is just another reusable DocuSign tab. So on WEBApp if you are planning to use Document Custom Fields, then your Connect listener should check for two things, one document fields which will be coming from the API, and the Document Custom Field which will be coming as form data. When doing through WebApp, I will make that field white label on white text so that it is not visible to the customer, but it is present on the document. To make maintenance easier on your side, I would create two Connect listener, one just for API user who will be using Document Field, another for non-API/WebApp user who will be using these reusable Document Custom Fields, and write different logic on both listener.