Inside DocuSign can we add checkboxes in the document at specific position using API? - docusignapi

We are sending the document from our app to DocuSign, and we want to add checkboxes at a specific position. How do we achieve this using API endpoint?
I tried adding checkbox manually on docusign portal now I want to check if can I achieve it by using API endpoint. I searched inside docusign API but didn't get any specific API for the same.

xPosition and yPosituon properties on the object can be used to position any tab including checkbooks.
JSON:
checkboxTabs": [
{
"tabLabel" : "myCheckbox",
"xPosition": "50",
"yPosition": "50",
"tabGroupLabels": [
"checkboxgroup1"
],
}
]
More information about checkbooks:
https://www.docusign.com/blog/developers/tabs-deep-dive-checkboxes-and-radio-groups

Related

Docusign Custom Connector for Power Automate and Power Apps

I am developing an automated document preparation process within our Office365 environment (Word Template, SharePoint etc.) and are using Power Apps and Power Automate to prepare and send the document for authenticated signatures via Docusign. I do not want to use the 'out of the box' Docusign Power Automate connectors as I am need to invoke some of the more advanced Docusign capabilities within my Power Apps solution.
I have successfully developed my own Custom Connectors in Power Apps and Power Automate using the REST API capabilities with Docusign and successfully accomplished Oauth2 user authentication and been able to create envelopes and send documents for signature to a single recipient.
My problem is that I am wanting to send a document to multiple recipients using the V2.1 document REST API standards however, it seems I am bumping into an issue with the custom connector in Power Apps/Power Automate.
To ensure I had a correctly constructed JSON list, I used the built in Docusign API development environment sending the document to multiple recipients along with a document anchortag. It functioned correctly and resulted in the following JSON code:
{
"documents": [
{
"applyAnchorTabs": "True",
"documentBase64": "<Base64BytesHere>",
"documentId": "1",
"fileExtension": "txt",
"name": "NDA Agreement",
"pages": "3"
}
],
"emailSubject": "Testing Docusign",
"recipients": {
"signers": [
{
"email": "wilson.smith#email.com",
"name": "Wilson Smith",
"recipientId": "1",
"roleName": "Vice President",
"routingOrder": "1",
"tabs": {
"signHereTabs": [
{
"documentId": "1",
"pageNumber": "3",
"tabLabel": "CompanySigner"
}
]
}
},
{
"email": "john.doe#gemail.com",
"name": "John Doe",
"recipientId": "2",
"roleName": "President",
"routingOrder": "2",
"tabs": {
"signHereTabs": [
{
"documentId": "1",
"pageNumber": "3",
"tabLabel": "RecipientSignature"
}
]
}
}
]
},
"status": "Sent"
}
I used this as the sample payload to import into the Request section of the DEFINITION page of the Custom Connector:
Request section of Definition Page in Power Automate Custom Connector
This results in a 'body' being developed in the REQUEST section. Opening up the BODY section of the REQUEST reveals the following elements:
Body of Request after importing JSON payload
It can be seen that there are only elements for a single recipient listed in the JSON payload.
It is further confirmed when you go to test the Custom Connector, the test page appears as follows:
Custom Connector Test Page
The test page successfully executes however, it is only sending to a single recipient. It is not identifying the need to send to multiple recipients.
I speculate that Microsoft Custom Connectors are not supporting REST V2.1 and is a limitation. I would appreciate some input on this and, if there is a workaround for this.
Thank you.
Ok, so after crafting the question and issue above, it got me thinking about maybe importing JSON payload directly into the test page (using RAW Body display) and then tested the connector. I was surprised that the JSON code ran with MULTIPLE recipients yet, when I selected back from RAW Body mode), the test page only showed one recipient. This is very misleading.
I then thought that perhaps the connector was configured correctly and it was just a limitation in the connector test process.
I went back to Power Automate and used the multi recipient connector in my flow and was surprised to see that I now had the ability to add multiple recipients and each recipient could be set up with multiple anchor tags.
In summary, the custom connector test is a basic test environment. Going forward, I would use my full JSON payload in the RAW Body view and test it that way. Also, you need to configure the JSON payload to show multiple components to enable Power Automate to configure the use of the connector with these multiple elements.
I think this issue is worth doing a video tutorial on as I am sure many other people will bump into the same issue.

Why is a certified delivery person still prompte

I ran a quick test using a certified delivery recipient, one document, one signing point. Here is part of that request:
"compositeTemplates": [
{
"serverTemplates": [
{
"sequence": "1",
"templateId": "15a22617-4525-438c-aaf1-45f8632ba2d1"
}
],
"inlineTemplates": [
{
"sequence": "1",
"recipients": {
"signers": [],
"certifiedDeliveries": [
{
"name": "Kathy xxx",
"email": "kathyxxx#gmail.com",
"recipientId": "1",
"accessCode": "12345",
"customFields": [],
"routingOrder": "1",
"note": "",
"roleName": "##Buyer1"
}
]
I noticed if I used a document and template where the roleName matched and there were signing tabs, that the receiver would still be prompted for a signature, even though I put them as a certified delivery. I thought that certified delivery would mean just viewing the document, not ever having to sign it. I guess that's not the case. Is there any way to make sure that the certified delivery person only ever has to view?
Changing a RecipientType on a Server Template just does not feel like a good use of Server Templates. It means you have not defined your server template correctly. You should create another ServerTemplate with the appropriate recipient types and use that instead.
CompositeTemplates allows you to extend your serverTemplates and enables you to overlay document, recipient, and tab definitions from multiple sources.
Sometimes it is better to create your own server template for your specific need rather than extending them using CompositeTemplates.
If you do not want to Create a new server template, you can use the updateEnvelopeRecipients API to update the recipient type.
Here are the steps
Create the envelope as a Draft (Status = 'Created')
Use the updateEnvelopeRecipients API to update the recipient type to CertifiedDelivery. Any tabs that are associated with the recipient will be removed.
Send the Envelope using the updateEnvelope Api.
Another Hack that seems to work. ( I do not recommend this)
You can change the routingOrder of the recipient. The recipient will then be considered as the certified Delivery Recipient as it will no longer match the recipient in the server template.
From Documentation (Expand the compositeTemplates section)
Recipient matching is based on Recipient Role and Routing Order. If there are matches, the recipient information is merged together. A final pass is done on all Composite Templates, after all template overlays have been applied, to collapse recipients with the same email, username and routing order. This prevents having the same recipients at the same routing order.

Docusign API integration - how to send multiple templates and populate values

I have a pretty basic question about how the Docusign API works. I tried finding the answer myself but was quickly overwhelmed by the massive amount of information, much of which is outdated, in the support center.
Here’s what I’m trying to do:
I have uploaded and configured multiple templates in my Docusign account
I am writing a web app which will allow my users to request a subset of those templates based on certain criteria
The subset of templates would then be used in my app via an iframe integration (I'm assuming)
I would also like to automatically populate several of the fields in my new copies of the templates
How do I perform the API request in step 2?
How do I perform the API call in step 3? Or are the values injected into the document some other way?
A totally different approach would be to provision a new Docusign account for each of my users but that didn’t seem right. If someone could just point me in there right direction I would really appreciate it.
It's actually not that basic of a question, I'd say if you were asking how to send a signature request on a document or from one template that's basic but how to combine and send multiple templates and populate values in them is a little more involved.
With that said, to combine multiple templates into signature requests you can simply use the Composite Templates node in your envelope definition. Using composite templates you can combine multiple server-side templates from your account, or combine templates with local documents or documents from other sources (i.e. cloud).
Regarding your Questions:
1]
You can make an API call to programmatically retrieve the templates that are available in your account then display whatever aspects you want about them in your UI, such as name, description, template ID, etc. Once the user (or your app logic) indicates which templates they want to combine into a signature request you can combine them like this (this combines 2 server templates):
{
"emailSubject":"DocuSign Signature Request using Composite Templates",
"status":"sent",
"compositeTemplates":[
{
"serverTemplates":[
{
"sequence":"1",
"templateId":"55A80182-2E9F-435D-9B16-FD1E1C0F9D74"
}
],
"inlineTemplates":[
{
"sequence":"1",
"recipients":{
"signers":[
{
"name":"John Doe",
"email":"firstrecipient#gmail.com",
"recipientId":"1",
"clientUserId":"1001",
"roleName":"RoleOne"
}
]
}
}
]
},
{
"serverTemplates":[
{
"sequence":"2",
"templateId":"44D9E888-3D86-4186-8EE9-7071BC87A0DA"
}
],
"inlineTemplates":[
{
"sequence":"2",
"recipients":{
"signers":[
{
"name":"Jane Doe",
"email":"secondrecipient#gmail.com",
"recipientId":"1",
"clientUserId":"1002",
"roleName":"RoleOne"
}
]
}
}
]
}
]
}
2]
Yes if you want to embed your recipients (which means they sign through your UI and not through the DocuSign website or app) then it is recommended you use an iFrame for Web apps and a Webview for mobile apps. To embed a given recipient you must set their clientUserId as I have for both recipients in the above example. This is a string and is defined on the client-side, you just need to remember which values you use for each recipient as you need that to generate each recipient's signing URL (which you will load in the iFrame).
Have a look at the "Signing from within your app" API Recipe for sample code of how to accomplish this. That sample doesn't use templates to create the envelope but it shows how to generate the unique signing URLs:
Signing from within your app
Or if you want to test with raw API calls (that don't use the DocuSign SDKs) you can use the API Explorer to test these calls:
API Explorer
3]
You basically had a third question I think which was how to populate the tabs (aka document fields) in the template. You can identify a given tab by its tabLabel and populate it's value using the value property. For instance, if you had two tabs of type textTab (called Data fields in the UI) you can populate their values like this:
{
"email": "jane.doe#email.com",
"name": "Jane Doe",
"roleName": "RoleOne",
"recipientId": "1",
"clientUserId": "1001",
"tabs": {
"textTabs": [
{
"tabLabel": "ApplicantAddress",
"value": "221 Main St. Suite 1000 San Francisco, CA 94105"
},
{
"tabLabel": "ApplicantSSN",
"value": "12-345-6789"
}
]
}
}

Not able to rename document of Draft envelope

Our application creates a draft envelope from template using docusign rest API. Based on the user input application renaming the document and send envelope for signing.
We are using API PUT "docusignUrl/envelopes/{envelopeId}/documents" to rename the documents of a draft envelope from past 10 months. It was working till yesterday. All of sudden today it is not renaming the document. It is keeping document name as template name itself.
Can somebody please help me to rename the document. I am using demo.docusign.net
Following are the request and response contents.
Url: https://demo.docusign.net/restapi/v2/accounts/1234/envelopes/a499c33a-94c6-46e1-a0f2-bf5cd368529b/documents
Request body:
{"documents":[
{"name":"150821183100_Order-Sign_companyc_P",
"documentId":"1",
"order":"1",
"pages":"1",
"type":"content",
"uri":"/envelopes/a499c33a-94c6-46e1-a0f2-bf5cd368529b/documents/1"
}]
}
Response Body:
{
"envelopeId": "a499c33a-94c6-46e1-a0f2-bf5cd368529b",
"envelopeDocuments": [
{
"documentId": "1",
"name": "SOMA_Sign_OrderManagement.pdf",
"uri": "/envelopes/a499c33a-94c6-46e1-a0f2-bf5cd368529b/documents/1",
"order": "1"
}
]
}
Your previous behavior is the desired behavior.
This is a bug that is being looked into by DocuSign, I'll update this answer if I get any additional information.
UPDATE: The issue has been resolved and is working as intended in Demo once again.

Create template programmatically using Docusign API

I have a question on the embedded signing process. As per the API we have to pass the templateId and templateRole which already created earlier.
Can we create the template programmatically using Docusign API ?
--
Thanks and Regards
Sandeep
Yes you can create a template programmatically (see the REST API documentation for more info) however I want to make clear that you do not need to use a template for Embedded Signing. If you are looking at the Embedded Signing code samples in the DocuSign API Walkthroughs those use a template just to shorten the code and request body, but as mentioned it's not required.
To make any recipient an Embedded recipient (meaning they will sign using embedded signing), you simply have to set an additional property on the recipient named clientUserId. The trick is that whatever value you use for a given recipient, you have to reference that same value when requesting the signing URL.
For instance, your (partial) request body for an embedded recipient might look like this:
"recipients": {
"signers": [
{
"tabs": {
"signHereTabs": [
{
"name": "SignatureTab1",
"pageNumber": "1",
"documentId": "1",
"yPosition": "100",
"xPosition": "100"
}
]
},
"routingOrder": "1",
"recipientId": "1",
"clientUserId": "1000",
"name": "Sally Doe",
"email": "test_1#email.com"
}
]
}
Notice the clientUserId property that I've randomly set to 1000.
Now if you want to do embedded signing without a template, you can combine some of the above sample JSON with the multipart/form-data API call for creating an envelope from a local document.
This API Walkthrough shows you exactly how to do that:
http://iodocs.docusign.com/APIWalkthrough/requestSignatureFromDocument

Resources