Search code examples
pythondocusignapi

What needs to be provided within the recipient_signature_providers list of the Signer Object for a DocuSign Envelope?


DocuSign has a trusted signature provider option within the envelope creation process. To do this you provider the recipient_signature_providers option to the Signer object.

According to the swagger generated Signer object this value needs to be a list. Taken from the swagger code:

    @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]
        """

I know to get a list of available signature providers you can call the AccountsApi.list_signature_providers() which returns an AccountSignatureProviders object, that you can convert to a dictionary with providers = AccountSignatureProviders.to_dict() to make it useful and iterable. Then you can separate out the providers via providers[1] and convert that to a json array, as you get an INVALID_REQUEST_BODY...To fix this error change the JSON to a JSON array if you don't. The output of this work is below:

[{'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}]

Does anyone know what needs to be contained within this RecipientSignatureProvider list to get the correct signature provider set on the envelope? Providing the complete output above does not work, the API uses the default whenever this is provided.


Solution

  • I was provided this documentation from Docusign. This shows that you can retrieve the signature providers with the AccountSignatureProviders.signature_providers, this returns something that can be indexed. From here, to set the signature provider to the signer object you have to put it in a list like so recipient_signature_providers=[AccountSignatureProviders.signature_providers[x]] since it has to be a json array.