DocuSign 在信封创建过程中具有受信任的签名提供商选项。为此,您需要向 Signer 对象提供
recipient_signature_providers
选项。
根据 swagger 生成的 Signer 对象,该值需要是一个列表。摘自招摇代码:
@property
def recipient_signature_providers(self):
"""Gets the recipient_signature_providers of this Signer. # noqa: E501
# noqa: E501
:return: The recipient_signature_providers of this Signer. # noqa: E501
:rtype: list[RecipientSignatureProvider]
"""
return self._recipient_signature_providers
@recipient_signature_providers.setter
def recipient_signature_providers(self, recipient_signature_providers):
"""Sets the recipient_signature_providers of this Signer.
# noqa: E501
:param recipient_signature_providers: The recipient_signature_providers of this Signer. # noqa: E501
:type: list[RecipientSignatureProvider]
"""
我知道要获取可用签名提供程序的列表,您可以调用
AccountsApi.list_signature_providers()
,它返回一个 AccountSignatureProviders
对象,您可以使用 providers = AccountSignatureProviders.to_dict()
将其转换为字典,使其有用且可迭代。然后,您可以通过 providers[1]
分离出提供者,并将其转换为 json 数组,如果不这样做,您会得到 INVALID_REQUEST_BODY...To fix this error change the JSON to a JSON array
。这项工作的输出如下:
[{'is_required': 'false'},
{'priority': '1'},
{'signature_provider_display_name': 'GlobalSign - Digital Signing Service (DSS) - Production'},
{'signature_provider_id': '73'},
{'signature_provider_name': 'globalsign_tsp'},
{'signature_provider_options_metadata': None},
{'signature_provider_required_options': None}]
有谁知道此 RecipientSignatureProvider 列表中需要包含什么才能在信封上设置正确的签名提供程序?提供上面的完整输出不起作用,每当提供时,API 都会使用默认值。
Docusign 向我提供了此文档。这表明您可以使用
AccountSignatureProviders.signature_providers
检索签名提供程序,这将返回可以索引的内容。从这里开始,要将签名提供者设置为签名者对象,您必须将其放入字典中,如下所示recipient_signature_providers=[AccountSignatureProviders.signature_providers[x]]
,因为它必须是 json 数组。