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

Add support for custom_fields editor and required fields #21

Open
alexmac05 opened this issue Oct 25, 2016 · 3 comments
Open

Add support for custom_fields editor and required fields #21

alexmac05 opened this issue Oct 25, 2016 · 3 comments
Labels
legacy Related to legacy, non-OpenAPI SDK

Comments

@alexmac05
Copy link
Contributor

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)

@alexmac05
Copy link
Contributor Author

alexmac05 commented Dec 26, 2019

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

@oconnor-sn
Copy link
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

@oconnor-sn
Copy link
Contributor

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

@jtreminio-dropbox jtreminio-dropbox added the legacy Related to legacy, non-OpenAPI SDK label Apr 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
legacy Related to legacy, non-OpenAPI SDK
Projects
None yet
Development

No branches or pull requests

3 participants