Hello,
I’ve been trying all weekend but I just cannot get this to work, so hopefully the experts here and guide me through what I’m missing. I’ve tried a number of combinations and nothing is working. What I want to do, is create an In Person Signing event, where the delivery driver (under the host account) signed the document saying he has delivered the shipment, and then passes the device to the customer for them to sign their portion. In a mockup, I got it to work but I can’t get it to work in a full run through with an embedded signing request with the PHP SDK.
Heres what I got:
$document = new DocuSign\eSign\Model\Document(
[
'document_base64' => base64_encode($file_content_in_bytes),
'name' => 'TestFile',
'file_extension' => 'pdf',
'document_id' => '1'
]
);
//Find Driver Area
$deliverySignature = new DocuSign\eSign\Model\SignHere(
[
'anchor_string' => 'Signature of Driver',
'anchor_units' => 'pixels',
'anchor_y_offset' => '-20',
'anchor_x_offset' => '20'
]
);
$deliverySigner = new DocuSign\eSign\Model\InPersonSigner(
[
'host_email' => $MY_EMAIL_ADDRESS,
'host_name' => $MY_NAME,
'signer_name' => $MY_NAME,
'signer_email' => $MY_EMAIL_ADDRESS,
'recipient_id' => '1',
'routing_order' => "1"
]
);
$deliverySigner->settabs(new Tabs(['sign_here_tabs' => [$deliverySignature]]));
//Find Customer Area
$inPersonSigner = new DocuSign\eSign\Model\InPersonSigner(
[
'host_email' => $MY_EMAIL_ADDRESS,
'host_name' => $MY_NAME,
'signer_name' => $CUSTOMER_NAME,
'signer_email' => $CUSTOMER_EMAIL,
'recipient_id' => 2,
'routing_order' => "2"
]
);
$customerSignature = new DocuSign\eSign\Model\SignHere(
[
'anchor_string' => 'Signature of Customer',
'anchor_units' => 'pixels',
'anchor_y_offset' => '-20',
'anchor_x_offset' => '20'
]
);
$inPersonSigner->settabs(new Tabs(['sign_here_tabs' => [$customerSignature]]));
return new DocuSign\eSign\Model\EnvelopeDefinition([
'email_subject' => "Sign for Delivery Acceptance",
'documents' => [$document],
'recipients' => new Recipients([
'in_person_signers' => [$deliverySigner, $inPersonSigner],
]),
'status' => "sent"
]);
Now after creating the envelope, I checked to see what the envelope recipients object says to make sure I’m there:
DocuSign\eSign\Model\Recipients Object
(
[container:protected] => Array
(
[agents] => Array
(
)
[carbon_copies] => Array
(
)
[certified_deliveries] => Array
(
)
[current_routing_order] => 1
[editors] => Array
(
)
[error_details] =>
[in_person_signers] => Array
(
[0] => DocuSign\eSign\Model\InPersonSigner Object
(
[container:protected] => Array
(
[access_code] =>
[access_code_metadata] =>
[add_access_code_to_email] =>
[allow_system_override_for_locked_recipient] =>
[auto_navigation] =>
[auto_responded_reason] =>
[bulk_send_v2_recipient] =>
[can_sign_offline] => true
[client_user_id] =>
[completed_count] => 0
[creation_reason] => sender
[custom_fields] =>
[declined_date_time] =>
[declined_reason] =>
[default_recipient] =>
[delivered_date_time] =>
[delivery_method] => email
[delivery_method_metadata] =>
[designator_id] =>
[designator_id_guid] =>
[document_visibility] =>
[email] =>
[email_metadata] =>
[email_notification] =>
[embedded_recipient_start_url] =>
[error_details] =>
[excluded_documents] =>
[fax_number] =>
[fax_number_metadata] =>
[host_email] => ***MY_EMAIL****
[host_email_metadata] =>
[host_name] => ***MY_NAME****
[host_name_metadata] =>
[id_check_configuration_name] =>
[id_check_configuration_name_metadata] =>
[id_check_information_input] =>
[identity_verification] =>
[inherit_email_notification_configuration] =>
[in_person_signing_type] =>
[in_person_signing_type_metadata] =>
[locked_recipient_phone_auth_editable] =>
[locked_recipient_sms_editable] =>
[name] =>
[name_metadata] =>
[notary_host] =>
[notary_id] =>
[note] =>
[note_metadata] =>
[offline_attributes] => DocuSign\eSign\Model\OfflineAttributes Object
(
[container:protected] => Array
(
[account_esign_id] =>
[device_model] =>
[device_name] =>
[gps_latitude] =>
[gps_longitude] =>
[offline_signing_hash] => DA3***********709
)
)
[phone_authentication] =>
[recipient_attachments] =>
[recipient_authentication_status] =>
[recipient_feature_metadata] =>
[recipient_id] => 1
[recipient_id_guid] => e14*******f76
[recipient_signature_providers] =>
[recipient_supplies_tabs] =>
[recipient_type] => inpersonsigner
[recipient_type_metadata] =>
[require_id_lookup] => false
[require_id_lookup_metadata] =>
[require_signer_certificate] =>
[require_sign_on_paper] =>
[require_upload_signature] => false
[role_name] =>
[routing_order] => 1
[routing_order_metadata] =>
[sent_date_time] => 2024-11-11T06:07:41.8270000Z
[signature_info] =>
[signed_date_time] =>
[signer_email] => ***MY_EMAIL****
[signer_email_metadata] =>
[signer_first_name] =>
[signer_first_name_metadata] =>
[signer_last_name] =>
[signer_last_name_metadata] =>
[signer_name] => ****MY_NAME****
[signer_name_metadata] =>
[sign_in_each_location] =>
[sign_in_each_location_metadata] =>
[signing_group_id] =>
[signing_group_id_metadata] =>
[signing_group_name] =>
[signing_group_users] =>
[sms_authentication] =>
[social_authentications] =>
[status] => sent
[status_code] =>
[suppress_emails] =>
[tabs] =>
[template_locked] =>
[template_required] =>
[total_tab_count] =>
[user_id] => 34******21
)
)
[1] => DocuSign\eSign\Model\InPersonSigner Object
(
[container:protected] => Array
(
[access_code] =>
[access_code_metadata] =>
[add_access_code_to_email] =>
[allow_system_override_for_locked_recipient] =>
[auto_navigation] =>
[auto_responded_reason] =>
[bulk_send_v2_recipient] =>
[can_sign_offline] =>
[client_user_id] =>
[completed_count] => 0
[creation_reason] => sender
[custom_fields] =>
[declined_date_time] =>
[declined_reason] =>
[default_recipient] =>
[delivered_date_time] =>
[delivery_method] => email
[delivery_method_metadata] =>
[designator_id] =>
[designator_id_guid] =>
[document_visibility] =>
[email] =>
[email_metadata] =>
[email_notification] =>
[embedded_recipient_start_url] =>
[error_details] =>
[excluded_documents] =>
[fax_number] =>
[fax_number_metadata] =>
[host_email] => ***MY_EMAIL****
[host_email_metadata] =>
[host_name] => ***MY_NAME****
[host_name_metadata] =>
[id_check_configuration_name] =>
[id_check_configuration_name_metadata] =>
[id_check_information_input] =>
[identity_verification] =>
[inherit_email_notification_configuration] =>
[in_person_signing_type] =>
[in_person_signing_type_metadata] =>
[locked_recipient_phone_auth_editable] =>
[locked_recipient_sms_editable] =>
[name] =>
[name_metadata] =>
[notary_host] =>
[notary_id] =>
[note] =>
[note_metadata] =>
[offline_attributes] =>
[phone_authentication] =>
[recipient_attachments] =>
[recipient_authentication_status] =>
[recipient_feature_metadata] =>
[recipient_id] => 2
[recipient_id_guid] => 64*****4a765
[recipient_signature_providers] =>
[recipient_supplies_tabs] =>
[recipient_type] => inpersonsigner
[recipient_type_metadata] =>
[require_id_lookup] => false
[require_id_lookup_metadata] =>
[require_signer_certificate] =>
[require_sign_on_paper] =>
[require_upload_signature] => false
[role_name] =>
[routing_order] => 2
[routing_order_metadata] =>
[sent_date_time] =>
[signature_info] =>
[signed_date_time] =>
[signer_email] => ***CUSTOMER_EMAIL***
[signer_email_metadata] =>
[signer_first_name] =>
[signer_first_name_metadata] =>
[signer_last_name] =>
[signer_last_name_metadata] =>
[signer_name] => Customer
[signer_name_metadata] =>
[sign_in_each_location] =>
[sign_in_each_location_metadata] =>
[signing_group_id] =>
[signing_group_id_metadata] =>
[signing_group_name] =>
[signing_group_users] =>
[sms_authentication] =>
[social_authentications] =>
[status] => created
[status_code] =>
[suppress_emails] =>
[tabs] =>
[template_locked] =>
[template_required] =>
[total_tab_count] =>
[user_id] => 34d********21
)
)
)
[intermediaries] => Array
(
)
[notaries] => Array
(
)
[participants] =>
[recipient_count] => 2
[seals] => Array
(
)
[signers] => Array
(
)
[witnesses] => Array
(
)
)
)
And then in my RecipientViewRequest Object, I have:
DocuSign\eSign\Model\RecipientViewRequest Object
(
[container:protected] => Array
(
[assertion_id] =>
[authentication_instant] =>
[authentication_method] => None
[client_ur_ls] =>
[client_user_id] => 16******cb7
[display_format] =>
[email] => ***MY_EMAIL***
[frame_ancestors] => Array
(
[0] => https://********/
[1] => https://apps-d.docusign.com
)
[message_origins] => Array
(
[0] => https://apps-d.docusign.com
)
[ping_frequency] =>
[ping_url] =>
[recipient_id] => 1
[return_url] => https://*******/
[security_domain] =>
[user_id] =>
[user_name] => ***MY_NAME***
[x_frame_options] =>
[x_frame_options_allow_from_url] =>
)
)
I’ll send all that off to the function
$envelope_api = $this->getEnvelopeAPI();
if ($viewUrl = $envelope_api->createRecipientView($account_id, $envelope_id, $recipient_view_request)) return $viewUrl;
And no matter the combination of variable I use, I’ll usually get
getRecipientView failed: DocuSign\eSign\Client\ApiException: Error while requesting server, received a non successful HTTP code [400] with response Body: O:8:"stdClass":2:{s:9:"errorCode";s:26:"UNKNOWN_ENVELOPE_RECIPIENT";s:7:"message";s:85:"The recipient you have identified is not a valid recipient of the specified envelope.";} in /home/*****/vendor/docusign/esign-client/src/Client/ApiClient.php:344
I’ve tried defining custom recipient Ids, different user ids and whatnot and those sometimes change the error to something about invalid recipient ids, or whatnot. So I know I’m able to change something to affect the outcome, but I can’t get the winning combination to get an embedded signature request, with in person signing.
Please help before I loose any more hair ;)