Skip to content
This repository was archived by the owner on Oct 17, 2023. It is now read-only.
This repository was archived by the owner on Oct 17, 2023. It is now read-only.

Add support for custom_fields editor and required fields #21

Open

Description

@alexmac05

Currently the python SDK does not support
'custom_fields': '[{"name":"newline", "value":"$20,000", "editor":"Client", "required":true}]',
the editor and required fields for custom_fields. Please add this support.

The python SDK will work for templates and custom fields, but not in the case where you want to assign an editor or make it required.

Workaround:

import requests

buildTheRequest = 'https://' + apikey + ':@api.hellosign.com/v3/signature_request/create_embedded_with_template'

data = {
'client_id': 'YOUR_CLIENT_ID',
'template_id': 'YOUR_TEMPLATE_ID',
'subject': 'ticket214090',
'message': 'ticket214090',
'signers[Client][name]': 'George',
'signers[Client][email_address]':'YOUR_EMAIL',
'custom_fields': '[{"name":"newline", "value":"$20,000", "editor":"Client", "required":true}]',
'test_mode': '1'
}

print(buildTheRequest)

r = requests.post(buildTheRequest, data)
print(r.text)

Activity

  1. alexmac05 commented on Dec 26, 2019

    @alexmac05
    ContributorAuthor

    In order to understand this SDK issue one must be able to create a template and setup custom fields. Custom fields are text boxes that have the value 'ME WHEN SENDING' and then in the code when you call the signature request, you should be able to pass the value to the custom field.
    https://app.hellosign.com/api/templatesAndApiWalkthrough

    1. To understand this issue first go to the documentation link here: https://app.hellosign.com/api/reference#send_with_template

    2. Search on that link for the parameter "custom_fields"

    3. Notice that there are four things that can be set by custom fields and that it is documented as being passed as a JSON array. If you look at the curl example it is working more as designed.
      -F 'custom_fields=[{"name":"Cost", "value":"$20,000", "editor":"Client", "required":true}]'

    name: the name, or "Field Label," of the custom field (the field's API ID can be used here as well)
    value: the value of the custom field
    editor: the RoleName allowed to edit the custom field (optional, but required if 'required' is defined)
    required: a boolean describing if this field is required (default: false)

    1. Notice that currently the PYTHON SDK works like this with a custom field
      custom_fields=[{ 'Cost': '$20,000' }]

    which is basically saying, pass the value of $20,000 to the custom field named Cost.

    DESIRED RESULTS
    Should be able to pass this instead:
    [{"name":"Cost", "value":"$20,000", "editor":"Client", "required":true}]

    Also, if there are multiple custom fields, this should be supported
    [{"name":"Cost", "value":"$20,000", "editor":"Client", "required":true}, {"name":"fName", "value":"Sally", "editor":"Client", "required":true}]

    @neillom

  2. oconnor-sn commented on Jan 15, 2020

    @oconnor-sn
    Contributor

    @alexmac05 @martinytodorov - change has been made and tested but dependant on PR 61 so will wait till this PR is merged before I commit these changes

  3. oconnor-sn commented on Feb 21, 2020

    @oconnor-sn
    Contributor

    Ref: New PR created with code change and unit test completed:
    PR #69

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    legacyRelated to legacy, non-OpenAPI SDK

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions