[英]DocuSign: how to enter pre-fill field value via python
我正在使用 python 和 docusign_esign 包。 我已經嘗試了很多我在網上看到的解決方案,但我不知道為什么,但我無法讓它們中的任何一個工作。 重要的是,簽名者不能編輯這些預先填寫的字段。 發送的每個文檔都會有一些可變字段,因此這些預先填寫的字段需要在發送時填寫。
我正在嘗試在我的文檔上預填充預填充文本字段並將其發送到給定的電子郵件。
我收到 400 錯誤: b'{"errorCode":"REQUIRED_TAB_INCOMPLETE","message":"A Required field is incomplete. TabId: a53c008e-cbed-49d5-8ea5-150c7ecf4941"}'
我的代碼:
def create_and_send_envelope(
self, template_id, signer_email, signer_name, cc_email=None, cc_name=None):
envelope_definition = self.make_envelope_definition(
template_id, signer_email, signer_name
)
result = self.envelope_api.create_envelope(
self.account_id, envelope_definition=envelope_definition
)
return result
def make_envelope_definition(
self, template_id, signer_email, signer_name, cc_email=None, cc_name=None):
"""
Creates envelope
args -- parameters for the envelope:
signer_email, signer_name, signer_client_id
returns an envelope definition
"""
text_tab1 = Text(tab_label="serviceAddress", value="testValue")
prefill_tabs = PrefillTabs(text_tabs=[text_tab1])
tabs = Tabs(
PrefillTabs=prefill_tabs,
)
# Create the envelope definition
envelope_definition = EnvelopeDefinition(
status="sent", # requests that the envelope be created and sent.
template_id=template_id,
tabs=tabs
)
# Create template role elements to connect the signer and cc recipients
# to the template
roles = []
signer = TemplateRole(
email=signer_email,
name=signer_name,
role_name='Customer',
)
roles.append(signer)
# Create a cc template role.
if cc_email and cc_name:
cc = TemplateRole(
email=cc_email,
name=cc_name,
role_name='cc')
roles.append(cc)
# Add the TemplateRole objects to the envelope object
envelope_definition.template_roles = roles
return envelope_definition
預填充字段是一個文本字段,其標簽設置為serviceAddress
這是通過 API Request Builder 的 PreFill 選項卡實時示例您可以將工具的輸出語言更改為 Python sdk。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.