docusign / docusign-esign-php-client

The Official Docusign PHP Client Library used to interact with the eSign REST API. Send, sign, and approve documents using this client.
https://www.docusign.com/devcenter
MIT License
198 stars 122 forks source link

Error HTTPS_REQUIRED_FOR_CONNECT_LISTENER #131

Closed wehostadm closed 3 years ago

wehostadm commented 3 years ago

Hi,

Since few days, I had an error when creating a recipient view for DocuSign. Nothing has changed in my code, I don't understand the issue.

The error is : _[critical] Uncaught PHP Exception 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:35:"HTTPS_REQUIRED_FOR_CONNECTLISTENER";s:7:"message";s:50:"HTTPS required for Connect listener communication.";}" at /app/vendor/docusign/esign-client/src/Client/ApiClient.php line 344

It seems that we should now use an https request.

The code that create the view is (I use Symfony) : $returnUrl = $this->generateUrl("onboarding_contract", ["token" => $token], UrlGeneratorInterface::ABSOLUTE_URL );

$viewRequest = new RecipientViewRequest([ "authentication_method" => "none", "client_user_id" => $clientUserId, "return_url" => $returnUrl, "user_name" => $fullName, "email" => $email ]);

$results = $envelopeApi->createRecipientView($envelopId, $viewRequest);

return [$envelopId, (isset($results['url']) ? $results['url'] : null)];

Can you help me ?

Thanks,

LarryKlugerDS commented 3 years ago

It's not the RecipientViewRequest that is causing the error, it is your create envelope call.

You're including an eventNotification attribute that is using a url that starts with http. It needs to start with https.

See this StackOverflow answer

I'm sorry this was breaking change for you.

wehostadm commented 3 years ago

Thanks, it works now