Search code examples
phpsymfonyhellosign-api

HelloSign gives 'Invalid custom field' error


I am using a HelloSign template and passing data to it using HelloSign PHP SDK on a Symfony project.

I used the same API ID in the template to pass data to the template but I am getting 'Invalid custom field: b1_fullname' error.

Here's my code,

$client = new \HelloSign\Client('zzzzzzzzzzzzzzzzzzzz');
$hs_request = new \HelloSign\TemplateSignatureRequest;
$hs_request->enableTestMode();
$hs_request->setTemplateId('xxxxxxxxxxxxxxxxxx');
$hs_request->setTitle('Test');
$hs_request->setSubject('Test');
$hs_request->setMessage('Test');
$hs_request->setSigner('Client', 'aaa@bbb.com', 'AAA');
$hs_request->setCustomFieldValue('b1_fullname', 'AAA BBB');

$hs_response = $client->sendTemplateSignatureRequest($hs_request);

Here's how the template API field ID looks like.

enter image description here


Solution

  • When setting up the template, you'll need to set "Who fills this out?" to "Me (when sending)" so the API knows the expect a value for the custom field: Template Field Example