How to use Connect Services for event notifications in REST API with PHP SDK? - docusignapi

Helpers, I want to use Connect services with my DocuSign rest APIs integrated website. Could anyone help me out, Where can I get these in the GitHub? Basically the need is:
Once the document is fully executed, it will be routed via DocuSign connect to a folder which aligns with the name of the employee. This will require work on both the elected system as well as the DocuSign API to configure.

No problemo! These days, I suggest using an intermediate PaaS to queue and deliver the webhook notifications to your application which can live safely behind your firewall.
Here's a blog post on the technique. Note that we have PHP example software for this technique.
Once your PHP app is notified that an envelope is complete (fully signed), just download the documents from DocuSign and store them in your file system. Easy Peasy!

Related

Automating the process of creating and configuring a new DocuSign developer account via API

Right now I'm exploring potential options for automating the process of creating and configuring new DocuSign developer accounts via API calls, as this would allow my team to greatly reduce the work needed to setup and configure these accounts manually. I can't find any information in the current DocuSign API documentation that would allow for this, and the only question I could find online was Is it possible to create a DocuSign developer account via REST calls? from 2019.
Is it possible to create new developer accounts via an API? The POST requests utilized by the UI don't look to be designed in a way that would easily allow for this.
There's an endpoint in the eSignature API called Accounts:Create that enables creating new accounts.
However, it's important to note this:
This method is restricted to partner integrations. You must work with DocuSign Professional Services or DocuSign Business Development, who will provide you with the Distributor Code and Distributor Password that you need to include in the request body.

Different webhook endpoints for different apps?

Is it possible to have different webhook endpoints for different apps in docusign? I don't seem to be able to set the app in the configurations for webhook
I think, you can try using DocuSign connect, where you can give two different webhook links for different apps. Docusign connect is also more secured.
https://support.docusign.com/en/guides/ndse-admin-guide-connect
Not through the web console - Account-level Connect configs are mostly all-or-nothing (although you can enable/disable them by sending user).
If you want one application's envelopes to write to one endpoint and another's to another, you need to set up both applications to include EventNotifications in the envelope definition.
EventNotifications are effectively a Connect configuration embedded into the envelope. They are documented in the schema of the CreateEnvelope call (https://developers.docusign.com/docs/esign-rest-api/reference/Envelopes/Envelopes/create/) and code examples are available here: https://www.docusign.com/blog/dsdev-common-api-tasks-add-a-connect-webhook-to-your-envelopes
You can create two or more webhook "subscriptions" for a single account. One subscribing URL can be used for one of the apps, the other for a second app.
However, both URLs will receive all the notifications (for both apps).
So you need a way for both URLs' servers to only pay attention to the notifications for their own application. Easiest way is to set a metadata envelope-level field in the envelopes. This can be done either via the Envelopes:create method or set within a template.

Integrating Docusign in our webapp

I am new to Docusign and we have a requirement to integrate Docusign in our web app. I have gone through all the links for integrating docusign into a web app using REST Api calls. After thorough read and watching youtube videos, I came to know that we can integrate docusign in our web app through REST API calls but for the same additionally we need to develop our own UI to upload documents and send it to the recipient. But basically we are looking something where we can be reidrected to docusign from our webapp to perform all the operations of sending document for signing and once document is sent then I will be redirected back to our web app.
Kindly help with the above query and let me know if my understanding is correct for integration of docusign and for the same developing our own UI in our web app. Also please let me know if there is any alternative to fullfill the requirement of directly accessing docusign from our web app and performing all required operations of sending a document to recipient.
Thanks in advance!
So you want a button on your web app that says "Sign with DocuSign" and then what?
Most customers who want to send from their web app already have the documents controlled by their web app.
They:
authenticate the user with DocuSign (OAuth Authorization Code Grant)
Upload the document to DocuSign from their app.
Add tabs (signing fields) to the documents programmatically. (This is not hard and it saves the sender a lot of work.)
Upload the recipients (signers, copy-only recipients, etc)
And then tell DocuSign to send the envelope (the transaction).
Applications can also monitor the progress of the envelope through the signing process and programatically act on the signed documents.
The above is not hard to do and provides a good user experience.
You can also redirect the user of your application to DocuSign to accomplish any/all of the above manually. But the more the user does manually, the less convenient the integration will be for them.
If you want the manual experience, check out the EnvelopeViews::createSender method.

Can anyone post an example for event notification using docusign java-client sdk?

I want to implement event notification webhook method into my app. I am using docusign-java-client SDK for docusign, but I am unable to find any example using SDK. Can anyone provide some example to achieve this?
I'm sorry to report that we (DocuSign) don't yet have a Java recipe for this. We do have a Python example. Java is on the list of things to do. Perhaps someone else can provide an example in the meantime.
Here is a general description:
First, set up your webhook subscription. You can have an envelope-specific webhook subscription by including the eventNotification fields in your envelope create request.
Or you can set up a more general subscription by using the "Connect" feature. You can setup Connect subscriptions either via the DocuSign web tool, or programmatically.
As part of the subscription you provide your url for the incoming XML notification messages.
To handle them, you write a small web app using whatever web app framework is easiest for you and your stack. Your web server will receive the incoming https calls from DocuSign.
You can see what the incoming XML messages look like by using the beta Recipe Framework. Run it on Heroku. Use the embedded signing recipe and click the button to see the Webhook / Connect messages. You can then see the sorts of messages that you will receive.
Your incoming message web server will simply parse the XML messages and then handle them accordingly.
Thanks for using the webhook system. Please ask more questions here if you have any issues.

DocuSign Connect vs EventNotification attribute in createEnvelope call

We are doing an integration with DocuSign where users can submit documents stored in our system to DocuSign to get the documents signed. We have the DocuSign Connect feature working in our demo account. We can process messages from DocuSign successfully.
We were concerned that getting users to add a Connect Configuration themselves may be too challenging for some and it will be error-prone.
I see now in the documentation that it is possible to automatically get DocuSign to push notifications by passing the information in the EventNotification attribute when we call createEnvelope. Is this an acceptable way to get push notifications from DocuSign? Will this cause issues with getting the integration certified?
Is there any other way to get Connect configured easily in customer accounts?
This is an old question, but I wanted, for the record to have answers, since it's important to anyone who may be reading this.
We see now in the documentation that it is possible to automatically
get DocuSign to push notifications by passing the information in the
EventNotification attribute when we call createEnvelope. Is this an
acceptable way to get push notifications from DocuSign?
Yes, it is. It's a very good way in fact, to reduce polling and make your app better. We highly recommend that you use EvenNotification and sign-up for events going through a webhook to your app such that you can handle them in your code only when they occur, instead of polling DocuSign APIs repeatedly.
Will this cause issues with getting the integration certified?
The opposite is true. If you use polling you may have issues being certified. Using connect events with a webhook is one way to avoid the need for excessive polling which could cause issues with the certification.
Is there any other way to get Connect configured easily in customer
accounts?
You can configure connect like you suggested using EventNotification at the envelope level. This approach works well for ISVs since you don't need your customers to have admin access to their accounts.
The other option is account-level connect configuration, which does require admin level access and there are some other limitations. This approach adds the connect webhook for all envelopes in the account. So it may or may not be better, depending on your scenario.

Resources