Skip to main content

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(s'sign_here_tabs' => a$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(s'sign_here_tabs' => a$customerSignature]]));

return new DocuSign\eSign\Model\EnvelopeDefinition(D
'email_subject' => "Sign for Delivery Acceptance",
'documents' => n$document],
'recipients' => new Recipients(R
'in_person_signers' => e$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 e400] 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 ;)

The error "UNKNOWN_ENVELOPE_RECIPIENT" means you have input the wrong userName, email, or clientUserId in the createRecipientView API request body. You should match the value of the userName, email, and clientUserId properties between the CreateEnvelope and CreateRecipientView API calls.

In your case, the CreateEnvelope wasn't specified with the clientUserId but you specified it in the CreateRecipientView API, which eventually caused this error as it didn’t match. To resolve this issue, please remove the clientUserId from the request body of the CreateRecipientView API call. 

Note that when you host the in-person signing session with embedded signing, the host has to be the authenticated user--the user who is used to authenticate through OAuth2.0 (e.g. Authorization Code Grant or JWT grant). If the host isn't the authenticated user, the embedded signing page will only show the signing view of the envelope and the in-person signing session won't appear. In contrast, you can start the in-person signing session if you open the same envelope through email notification.

This is because the host is required to authenticate for the signing session. Through email notification, the host is validated as the owner of the email since the host can only open the signing session. Through embedded signing, however, the host can only be validated through the Authentication (e.g. Authorization Code Grant or JWT grant).

I also noticed that you defined two in-person signer recipients. The first recipient's host and signer are set as your name and email address. This is not the right way to use the in-persion signing. If your goal is to get the signature from the delivery driver and then get the signature from the customer as an in-person signing, you can specify the delivery driver (first recipient in the routing order) as the regular signer, and the second recipient as the in-person signer.

More information about hosting an in-person signing session with embedded signing is here: https://developers.docusign.com/docs/esign-rest-api/how-to/send-envelope-to-in-person-signer/

More information about the recipient type is here: https://developers.docusign.com/docs/esign-rest-api/reference/envelopes/enveloperecipients/#signer-recipient


Sir, thank you.  I removed the ‘signer_client_id’ param from the CreateRecipientView request, and it all worked.  I also changed around the signer to be the driver and then he can host the in person signing event.  I was trying so many different options my head was spinning.

Thank You!


Reply