Pega 7.3 Connect-Rest with multiple URLS - docusignapi

I am trying to figure out how to use multiple URLs in a Connect-Rest in Pega 7.3 to connect to DocuSign using the DocuSign Pega integration that is built by Pega.
I have a specific link that contains API keys that I am required to use as the resource path in my Connect-Rest. However, I also have another link that calls a specific instance of DocuSign so that the info from Pega goes directly to the DocuSign instance.
I know that Pega has updated their connect-rest functionality in the current version but my question is does anyone know if there is a way to incorporate multiple urls into one connect-rest.
Thank you in advance.

I don't know what you mean by "connect-rest."
DocuSign has the "Connect" feature for sending webhook notifications when an envelope's status changes. All envelope sent by selected (or all) users will be monitored. You can create multiple Connect subscriptions so that multiple URLs will be sent when an envelope's status changes.
DocuSign also has "individual envelope webhooks." This feature is configured when an envelope is created via the API and the create request includes the EventNotification attribute. A maximum of one URL can be set per envelope.

If you are invoking Connect-Rest from a pega activity, you can capture the relevant URL as variable and pass that to function call to 'Connect-Rest' within activity. Another useful way maybe to use dynamic system setting and use #(Pega-RULES:Utilities).getSystemSetting() function to read the value of URL saved in the Dynamic system settings

Related

DocuSign REST API: Correcting a document & too many api calls

Scenario:
My application dynamically generates a contract (PDF) on-the-fly through the use of some base language and replacement variables from user data. That pdf is then sent to the DocuSign REST API with the list of recipients/signers/tabs which handles delivery of the agreement to the various parties.
Issue:
At times during the negotiation process for the contract, users may need to make edits to the agreement. My application has a correction interface where they're able to regenerate the original PDF and then have an action that allows them to update the existing envelope.
To perform these corrections, I'm currently using the following API Calls for a single correction:
getEnvelope to retrieve the current status and make sure the envelope hasn't been voided, completed, etc.
deleteEnvelopeDocuments to remove all existing documents.
updateDocuments to send the base64 encoded document to the envelope.
updateEnvelope to send the recipients back to the envelope because they're deleted as a result to #2.
These 4 API calls feel like a mistake to me because if any one of them fails for whatever reason, the entire process fails. In addition, the processing time for the back-and-forth is also a consideration even though I could delegate that to a queue'd background process.
My Question (I know, finally)
Is there a better way to do what I'm trying to do? Perhaps I can skip #1 and just catch an exception thrown by DocuSign when attempting to update a completed / voided envelope. What I'm really interested in knowing is if I can consolidate #2-4 into a single call somehow. The API doesn't feel super clear on corrections and also doesn't send any notifications when an envelope is updated via the API.
I think this can be done with two API calls instead of four.
You can make a PUT call to replace a document
PUT .../envelopes/<envID>/documents/1
This API replaces an existing document, there's no need to do 2+3 separately.
This would eliminate the need to do #4 as well, because the tabs (not recipients as you stated) are not going to be removed if you don't delete the document but simply update it.

Add dynamically signers for bulk signing

I'm working on creating a gateway using the docusign API.
And i wonder if it's possible to add dynamically signers through a form.
I have tried many technique but none of them have worked.
For me one of the solution would be to add the signers with their parameters to a list in the model and use this list as a parameter of the controller, but i don't know if the Api have special limitation.
I will share you my code if you need it !
Thank you for your responses.
I think you want to do bulk send, but not sure.
Bulk Send is a feature where you send the same envelope (set of documents with tags etc.) to different signers (recipients). You then set the list and the system clones the original envelope many times and sends it to each user in turn.
Code example showcasing how to do this in 8 different languages can be found here:
https://developers.docusign.com/docs/esign-rest-api/how-to/bulk-send-envelopes

Docusign document retrieve using Docusign-connect

I am using the Docusign-Connet to get the notifications form docusign. In docusign api there is a line
"It can also be used to transport the completed documents back to your app or website and to retrieve any form field data entered by your recipients"
but in payload I am getting only document names?.
If you want the connect messages to include the envelopes' documents or fields, check the boxes in the Connection Subscription screen (shown below from the New DocuSign Experience Admin tool).
Or set the fields includeDocumentFields and/or includeDocuments to true in your call to ConnectConfigurations: create
What i've done in the past is, get the document statuses from DocuSignConnect when things change. Then call EnvelopesApi.GetDocument endpoint with DocumentStatuses.DocumentStatus.ID and the envelope ID to retrieve the document.
In my implementation, we only download the document if the entire envelope is complete. This way, the DocuSignConnect payload is not big as well.
Btw, my implementation is in .net using their 2.1.9.0 library.
Good luck!

Get all DocuSign EnvelopeIds that originated from a powerform

Using DocuSign's REST API, is there a way to retrieve a list of all envelope Ids from an account where the envelopes have a completed status and originated from a specific power form?
I've tried using the follow call and still see all completed envelopes after 9/12 regardless of where they originated from:
GET https://demo.docusign.net/restapi/v2/accounts/1655678/envelopes?from_date=2016-09-12&powerformids=2fc0a56d-f6c7-4e96-be93-258d0c038e3c&status=completed HTTP/1.1
The best working solution I have now is to add a custom field to the envelope and filter on it using the custom_field parameter. This requires additional setup from users and is not optimal.
Thanks.
Have you looked at DocuSign Connect for this? If you setup a specific user for your Powerform, Connect can publish events to you for just the envelopes created from that user. Then you wouldn't even need to make calls to get the Envelope IDs (or even other information).
Your idea of adding a custom field on the template level is the best way to go. It will help return accurate results, though I would agree it adds some overhead/upkeep during template/powerform creation.
The powerformids parameter you are including in your sample is not a supporter parameter and is simply being ignored.

PowerForms and its advantage

Few questions about PowerForms
What is the real advantage of using PowerForms? In which case(s) it is most useful?
In Docusign Classic View >> PowerForms, there is an option to download Form Data as XML and CSV. Can we download this data using APIs?
For this question, I referred this thread "Can We get a report for the values filled in radio button in DocuSign Envelope".
PowerForms are an easy way of referencing a DocuSign Template through the API without writing any code. They are intended for less technical end-users who want to quickly access a Template through either email delivery or through a direct link (URL) but don't know / want to code it up. Instead they manually initiate such requests through a created PowerForm.
With regards to the form data question- yes, you can programmatically retrieve the form data through the API. You need to keep in mind that DocuSign tabs (aka fields) are always with respect to recipients and not the document itself.
Therefore, you can make the Get Tab Information For Recipient API call (REST version linked).

Resources