Switch signers on an In Process shared document - docusignapi

Is it possible to switch a signer (with tabs), on a shared document, once an envelope's In Process?
Our process goes like this:
A single shared PDF document is generated (not using a DocuSign template) with signing placeholders for all signers.
We create and send an envelope for the document PDF.
One or more customers sign the document (using an embedded signing page).
The last signer (our employee) signs the document (also using an embedded signing page).
The employee signer could be one of several employees, but, whomever it is, they'll always sign the same locations on the document. We'd like to be able to delay the choice of which employee signs the document until the end of the process, instead having to specify them at envelope creation.
Once the envelope is In Process, I'm able to add and delete employee recipients, but I can't find a way to include their tabs too. I include the tabs in the request, but the added employee is always in a draft-like 'created' state without tabs. The embedded view still asks the viewer to manually place their tabs. I need the tabs to be already placed and locked in position on the document so the employee can sign.
We're using the REST API and this needs to be an automated solution (no manual envelope corrections). Is there some way to achieve this or something similar?
Here's my add-recipient request
POST https://demo.docusign.net/restapi/v2/accounts/<account>/envelopes/<envelope-id>/recipients?resend_envelope=true
{
"signers" : [{
"recipientId" : 4,
"email" : "john#example.com",
"name" : "John Citizen",
"tabs" : {
"initialHereTabs" : [{
"documentId" : "1",
"recipientId" : 4,
"name" : "InitialHere_3",
"pageNumber" : 1,
"xPosition" : 282,
"yPosition" : 454,
"tabName" : "InitialHere_3"
}
],
"signHereTabs" : [{
"documentId" : "1",
"recipientId" : 4,
"name" : "SignHere_3",
"pageNumber" : 1,
"xPosition" : 81,
"yPosition" : 447,
"tabName" : "SignHere_3"
}
],
},
"clientUserId" : "LTEST_Resident4",
"routingOrder" : 2,
}
]
}
(I've also tried the same request with PUT instead of POST. The result is the same)

It sounds like your workflow needs to do the following:
Create Envelope with a "Blocker Recipient"
Add Additional Recipient when they're identified
Add Tags to new Recipient
Delete "Blocker Recipient" when you want the document sent on
I'll assume you have 1. taken care of and I'll go through quick examples of 2-4.
2. Create Additional Recipient
POST: https://demo.docusign.net/restapi/v2/accounts/{accountId}/envelopes/{envelopeId}/recipients
{
"signers": [
{
"email": "email#domain.com",
"name": "Andrew Wilson",
"recipientId": "3",
"defaultRecipient": "true",
"routingOrder": "3"
}
]
}
3. Add Tags to Recipient
POST: https://demo.docusign.net/restapi/v2/accounts/{accountId}/envelopes/{envelopeId}/recipients/{recipientId}/tabs
{
"signHereTabs": [
{
"xPosition": "100",
"yPosition": "200",
"documentId": "1",
"pageNumber": "1"
},
{
"xPosition": "200",
"yPosition": "200",
"documentId": "1",
"pageNumber": "1"
}
]
}
4. Delete Blocker Recipient
DELETE: https://demo.docusign.net/restapi/v2/accounts/{accountId}/envelopes/{envelopeId}/recipients/{recipientId}

It sounds like you are trying to Modify or Correct and Resend Recipient Information.
https://www.docusign.com/sites/default/files/REST_API_Guide_v2.pdf Page 137
Modify or Correct and Resend Recipient Information
This lets you modify recipients in a draft envelope or correct recipient information for an in process envelope.For draft envelopes, you can edit: email, userName, routingOrder, faxNumber, deliveryMethod,accessCode and requireIdLookup. Once an envelope has been sent, you can only edit: email, userName, signerName, routingOrder,faxNumber, and deliveryMethod.You can also select to resend an envelope by using the resend_envelope option.
Example Request:
PUT https://{server}/restapi/{apiVersion}/accounts/{accountId}/envelopes/{envelopeId}/recipients?resend_envelope=true
X-DocuSign-Authentication:<DocuSignCredentials><Username>{name}</Username><Password>{password}</Password><IntegratorKey>{integrator_key}</IntegratorKey></DocuSignCredentials>
Accept: application/json
Content-Type: application/json
{
"signers": [
{
"email": "email#domain.com",
"name": "John Smith",
"recipientId": "1"
}
]
}
Response
The response returns if the correction was successful.The following example shows the response json body.
Example Response:
{
"recipientUpdateResults": [
{
"errorDetails": {
"errorCode": "SUCCESS",
"message": ""
},
"recipientId": "1"
}
]
}

Related

Send envelope to another recipient

I am trying to send a DocuSign envelope, that has already been sent to a customer (not signed yet), to another or a new customer. This is slightly different from resending the contract, but the same envelope is being resent to a new contact.
Is this possible? I have tried all sorts of things, like change the recipient details to new contact, add new sender to the existing recipient details.
The document is sent to the original sender fine, but to the new sender, the tab information is missing and the sign here tab is not there.
Replacing the original recipient :
The original recipient can be replaced with a new recipient using the UpdateEnvelopeRecipients api.
The original recipient will no longer have access to the envelope.
PUT /v2/accounts/{accountId}/envelopes/{envelopeId}/recipients
{
"signers": [
{
"recipientId": 1,
"email": "newsigner#acme.com",
"name": "New Signer",
}
]
}
Adding a new recipient: To add a new recipient in addition to the existing recipients, use the CreateEnvelopeRecipients api.
POST /v2/accounts/{accountId}/envelopes/{envelopeId}/recipients
{
"signers": [
{
"recipientId": 2,
"email": "newsigner#acme.com",
"name": "New Signer"
}
]
}
To Add tabs to the new recipient, use the CreateEnvelopeRecipientTabs api. Make sure you specify the recipientId correctly in the Url.
POST /v2/accounts/{accountId}/envelopes/{envelopeId}/recipients/{recipientId}/tabs
{
"signHereTabs": [
{
"documentId": "1",
"pageNumber": "1",
"xPosition": "120",
"yPosition": "120",
}
]
}

DocuSign Status Code TAB_REFERS_TO_DOCUMENT_NO_TABS_ALLOWED?

I am currently using the REST api to create an envelope containing a document and a template which I have already set up in Docusign. I get the following error on the web request and can't find this error on the status code/error list provided by DocuSign to try debug the issue. Their support person suggests I ask here..
TAB_REFERS_TO_DOCUMENT_NO_TABS_ALLOWED -- The Tab refers to a document that does not allow tabs.
Has anyone experienced this?
Edit:
The issue appears to be related to the document section.
{
"emailBlurb":"Test Email Body",
"emailSubject": "Test Email Subject",
"status" : "sent",
"compositeTemplates": [
{
"serverTemplates": [
{
"sequence" : 1,
"templateId": "b1eccee3-9c00-4cb2-8d30-0400d51dcfe0"
}],
"inlineTemplates": [
{
"sequence" : 2,
"recipients": {
"signers" : [{
"email": "usera#bah.com",
"name": "usera",
"recipientId": "1",
"roleName": "Producer"
}]
}
}],
"document": {
"documentId": 1,
"name": "Test.docx",
"documentBase64":"[bytesremoved]",
"fileExtension":"docx"
}
}]
}
So you have a template on the server, with a document as part of the template?
But you want the envelope to use a different document with the template, yes?
It is my understanding that the documentId in the document section of the composite template must match the documentId used in the template if you want the document to be substituted for the template's document.
So check the definition of the template. Did you create the template programmatically or did you use the web browser DocuSign app? If the latter, then note that the first document in a template is not always given an id of 1.

Docusign signing url - Showing document 1 of a composite template

Using the docusign rest api i would like to create an envelope with 2 documents.
I will then be using the Post Recipient view to show document 1 to the first recipient (in an iframe) and once signed show document 2 in the same envelope to another recipients.
i have created the templates with different tempalteRoles (different names, order 5 and 10).
Its my understanding using a userId and the right settings in my docusign account, i can show document 1 to recipient 1 and then document 2 to recipient 2.
When i try and create the composite envelope the whole document is shown.
when i call the recipient status for the envelope it only shows one signer.
I have found the envelope will only create when the 2 template roles have the same clientUserId, userName and email, otherwise i get the error "ONESIGNALLSIGN_NOT_SATISFIED"
here is the envelope i am sending through
{
"accountId": "ACCOUNT_ID",
"emailSubject": "Email subject",
"status": "sent",
"templateId": "TEMPLATE_ID",
"templateRoles": [
{
"roleName": "PDS Customer",
"email": "pds#example.com",
"name": "TestFirstName TestSurname",
"clientUserId": "1",
"tabs": {
"textTabs": [
{
"tabLabel": "DocumentNumber",
"value": "123456789",
"locked": true,
"documentId": 1,
"pageNumber": 1
}
...removed some
]
}
},
{
"roleName": "Customer",
"email": "test#example.com",
"name": "mrTestFirstName TestSurname",
"clientUserId": "2",
"tabs": {
"textTabs": [
{
"tabLabel": "StorerEmail_LocalPart",
"value": "test",
"locked": true,
"documentId": 2,
"pageNumber": 1
}
...removed some
]
}
}
],
"compositeTemplates": [
{
"compositeTemplateId": 1,
"serverTemplates": [
{
"sequence": 1,
"templateId": "TEMPLATE_ID_2"
}
]
}
]
}
The error message is due to having Document Visibility enabled. In that scenario, each signer must have at least one tab present. Your second signer (embedded or not) must have at least one tab. In this case it'd probably be on the second document.
Your API call above does refer to a second documentId though so you may be okay there.
I would suggest that you not mix the "simple" sending (using templateRoles at the top level) with composite templates. Instead, add an inline template to the compositeTemplates structure with all of your recipient information. You may be seeing some odd behavior due to mixing those.
Lastly, the default Document Visibility configuration will show a document to a recipient only if they have a tab on that document. If your second signer should see all documents then you must either add a tab for them on each document or explicitly set visibility per document.

How do I docuSign multiple documents in an envelope once using docuSign Rest API?

I am creating composite templates that work correctly and I'm running into this issue.
I am adding 2 templates to sign via docusign. I set the routing orders for both of them as shown below:
Form 1
Order 1 RoleName signer test1#gmail.com
Order 2 RoleName signer2 test2#gmail.com
Form 2
Order 1 RoleName dataEntry test1#gmail.com
Order 2 RoleName dataEntry2 test2#gmail.com
This will send one email to test#gmail.com. This user completes all of his fields for both Form 1 and Form 2 in one request. This is what I want and expect. However, when test1#gmail.com completes their process, test2#gmail.com will receive 2 different emails. One to sign form 1 and the other to sign form 2. I'm trying to understand why test2#gmail.com doesn't work the same as test1#gmail.com. Can someone help explain what the reason is for receiving 2 separate emails for test2#gmail.com may be and if there's a way to fix it?
Note: When I do this via the docuSign website, it doesn't allow for the same recipient to be in that same routingOrder. It will bring up the error:
The role 'signer' conflicts with 'dataEntry'
The role 'signer2' conflicts with 'dataEntry2'
This behavior seemed strange to me since I'm able to send the envelope using the docusign rest API. If somebody could give me some clarification on this as well I'd appreciate it.
Thank you!
I am unable to repro the issue you describe. Here's what I did, and the Result:
I created two separate templates in DocuSign, each having a single document and two recipients/signers (with Role Names and Routing Orders that you specify above in your question).
I used the REST API (JSON request included below) to create/send an Envelope from these two Templates, specifying identical recipient information (name/email/recipient ID/routing order) for Recipient 1 and Recipient 2 across both Inline Template structures.
Result: Recipient 1 receives an email first, opens the envelope, and signs both documents at once. Then Recipient 2 receives an email, opens the envelope, and signs both documents at once. The Envelope status is "Completed" at that point.
I've included my API request below for your reference -- perhaps compare/contrast this with what you're doing? Also -- make sure that Recipient information (Name / Email / Recipient ID / Routing Order) is identical (including case) for each recipient between the first Inline Template and the second Inline template within the API Request -- any small difference in Name/Email/Recipient Id/Routing Order, and DocuSign will treat them as different/separate people (recipients).
POST https://{{env}}.docusign.net/restapi/{{version}}/accounts/{{acctId}}/envelopes
{
"emailSubject": "Please sign",
"emailBlurb": "Please sign...thanks!",
"status": "sent",
"compositeTemplates": [
{
"serverTemplates": [
{
"sequence" : 1,
"templateId": "TEMPLATE_ID_1"
}],
"inlineTemplates": [
{
"sequence" : 2,
"recipients": {
"signers" : [{
"email": "adamsemail#outlook.com",
"name": "Adam Adamson",
"recipientId": "1",
"roleName": "signer",
"routingOrder": "1"
},
{
"email": "bobsemail#outlook.com",
"name": "Bob Burns",
"recipientId": "2",
"roleName": "signer2",
"routingOrder": "2"
}
]
}
}]
},
{
"serverTemplates": [
{
"sequence" : 1,
"templateId": "TEMPLATE_ID_2"
}],
"inlineTemplates": [
{
"sequence" : 2,
"recipients": {
"signers" : [{
"email": "adamsemail#outlook.com",
"name": "Adam Adamson",
"recipientId": "1",
"roleName": "dataEntry",
"routingOrder": "1"
},
{
"email": "bobsemail#outlook.com",
"name": "Bob Burns",
"recipientId": "2",
"roleName": "dataEntry2",
"routingOrder": "2"
}
]
}
}]
}]
}

Docusign: creating envelopes through templates with the REST API and prefilling tags

I'm integrating Docusign so that recipients can see their envelopes embedded on my site. I first create the envelope with the api, and I'm attempting to prefill Data Fields using dynamic data.
As far as I can tell, there's nothing wrong with my json that I'm using to create the envelopes. None of the other solutions on StackOverflow to this issue have helped. My json looks like this (which I send to https://demo.docusign.net/restapi/v2/accounts/360734/envelopes):
{
"status": "sent",
"emailBlurb": "Please sign the document.",
"emailSubject": "Please sign your agreement",
"templateId": "TEMPLATE_ID",
"templateRoles": [
{
"clientUserId": "EMAIL",
"name": "NAME",
"email": "EMAIL",
"roleName": "Signer1",
"tabs": {
"textTabs": [
{
"tabLabel": "address",
"value": "ADDRESS "
},
{
"tabLabel": "multi_address",
"value": "ADDRESSES"
}
]
}
},
{
"name": "ANOTHER NAME",
"email": "ANOTHER EMAIL",
"roleName": "Random1"
}
]
}
And I get the following response:
{
"envelopeId": "ENVELOPE_ID",
"uri": "/envelopes/ENVELOPE_ID",
"statusDateTime": "2013-10-25T01:20:55.6750772Z",
"status": "sent"
}
I then get the link to show the client by posting to https://demo.docusign.net/restapi/v2/accounts/360734/envelopes/ENVELOPE_ID/views/recipient
{
"authenticationMethod": "email",
"clientUserId": "EMAIL",
"email": "EMAIL",
"returnUrl": "MYURL",
"userName": "NAME"
}
And I get this response:
{
"url": "https://demo.docusign.net/Member/StartInSession.aspx?t=REDACTED"
}
This follows the example seen here: https://github.com/Ergin008/DocuSign-REST-API-Webinar-April2013/blob/master/example2.json
After creating the envelope this way, it appears that the tags do not prefill. When I view the envelope embedded on my site, nothing is filled. I'm certain the tabLabels are correct. Everything otherwise seems to be working okay. Is there some kind of setting I'm missing?
UPDATE
Looks like it could be a bug! All I change is the role name and it works!
{
"status": "sent",
"emailBlurb": "Please sign the document.",
"emailSubject": "Please sign your agreement",
"templateId": "TEMPLATE_ID",
"templateRoles": [
{
"clientUserId": "EMAIL",
"name": "NAME",
"email": "EMAIL",
"roleName": "Signer1",
"tabs": {
"textTabs": [
{
"tabLabel": "address",
"value": "ADDRESS "
},
{
"tabLabel": "multi_address",
"value": "ADDRESSES"
}
]
}
},
{
"name": "ANOTHER NAME",
"email": "ANOTHER EMAIL",
"roleName": "Signer2"
}
]
}
And it populated! It seems if I start the role name with anything other than Signer it doesn't work. Weird!
And yes, I'm changing the role name on Docusign from Random1 to Signer2, in this case. For example, Signer3 also worked.
Your question says your submitting that JSON to the "Get Recipient View" resource:
https://demo.docusign.net/restapi/v2/accounts/ACCOUNT_ID/envelopes/ENVELOPE_ID/views/recipient)
...but that JSON looks like what you use in the "Create Envelope" request, not the "Get Recipient View" request. So, let me start by clarifying the process of facilitating Embedded/captive signing (i.e., presenting the recipient's envelope within your site). Doing so is a two-step process:
STEP 1: Create the envelope (request includes data to pre-populate fields for each recipient, if needed).
POST https://{server}/restapi/{apiVersion}/accounts/{accountId}/envelopes
See "Creating an Envelope From a Template" section that starts on p27 of the REST API guide (http://www.docusign.com/sites/default/files/REST_API_Guide_v2.pdf) for detailed info about request and response.
STEP 2: Retrieve the URL that can be used to launch the recipient's envelope (signing session).
POST https://{server}/restapi/{apiVersion}/accounts/{accountId}/envelopes/{envelopeId}/views/recipient
{
"authenticationMethod":"Email",
"clientUserId":"CLIENT_USERID_SPECIFIED_IN_REQUEST",
"email":"RECIPIENT_EMAIL",
"returnUrl":"URL_TO_REDIRECT_TO_WHEN_SIGNING_COMPLETE",
"userName":"RECIPIENT_NAME"
}
The response will contain the URL that can be used to launch the Recipient's Envelope:
{
"url":"URL_THAT_WILL_LAUNCH_ENVELOPE"
}
See the "Post Recipient View" section that starts on p160 of the REST API guide (http://www.docusign.com/sites/default/files/REST_API_Guide_v2.pdf) for more detailed info about request and response.
Now, assuming you're doing all this correctly (step 1 and step 2) -- let's get back to the issue you're reporting: difficulty pre-populating fields for the recipient. A few comments about the "Create Envelope from Template" JSON that you included in your question:
You don't need accountId in request.
You don't need to include documentId and pageNumber in the request for the tab.
You DO need to include clientUserId for the recipient in the request, if you want the recipient to sign embedded/captive within your site.
So, here's a "Create/Send Envelope From Template" example request (step 1 above) that pre-populates the tab named "FIELD_1" with the value "VALUE_A" anywhere that it appears in the envelope:
POST https://{{env}}.docusign.net/restapi/{{version}}/accounts/{{acctId}}/envelopes
{
"status" : "sent",
"emailBlurb" : "please sign",
"emailSubject" : "Please sign your document",
"templateId" : "TEMPLATE_ID",
"templateRoles" : [{
"name" : "John Doe",
"email" : "JohnsEmail#outlook.com",
"roleName" : "Signer1Role",
"clientUserId" : "123",
"tabs" :
{"textTabs":[{
"tabLabel":"\\*FIELD_1",
"value":"VALUE_A"}
]}
}]
}
Then, you'd take the Envelope Id that's returned in the response and call the "Get Recipient View" resource (step 2 above) to get the URL to launch the signing session:
POST https://{{env}}.docusign.net/restapi/{{version}}/accounts/{{acctId}}/envelopes/ENVELOPE_ID/views/recipient
{
"authenticationMethod": "Email",
"clientUserId": "123",
"userName": "John Doe",
"email": "JohnsEmail#outlook.com",
"returnUrl": "http://www.google.com"
}
Finally, one last comment (but an important one): if you're just wanting to inject the recipient's "full name" in the document -- use the "Full Name" tab when creating the Template and DocuSign will automatically inject the recipient's name in place of that tag, anywhere that it appears (instead of you using a Text Tab and having to populate it via the API request). Here's the Full Name tag in the DocuSign UI tagger view:
Another Create Envelope Example (with screenshot of data field properties):
If I submit this request:
POST https://{{env}}.docusign.net/restapi/{{version}}/accounts/{{acctId}}/envelopes
{
"emailSubject": "Please sign this",
"emailBlurb": "Please sign...thanks!",
"templateId": "TEMPLATE_ID",
"envelopeIdStamping": "false",
"templateRoles": [
{
"roleName": "Signer1",
"name": "John Doe",
"email": "JohnsEmail#outlook.com",
"recipientId": "1",
"tabs":{
"textTabs":[
{
"tabLabel":"\\*address",
"value":"123 Main Street"
},
],
}
}
],
"status": "sent"
}
And the Data Field properties (when Editing the Template via the DocuSign UI) look like this:
Then the result is that field(s) with Label = address that are assigned to Recipient Role Signer1 will be prepopulated with the value "123 Main Street" when the signer views their envelope. If this isn't working for you, I suggest that you:
Verify that the value of roleName in the API request exactly matches the Recipient value I've highlighted in the prior screenshot (in my example, "Signer1").
Verify that the value of tabLabel in the API request exactly matches the Label value I've highlighted in the prior screenshot (in my example, "address).
Note: Values are case-sensitive, so be sure values in your request are an exact match (including upper-case/lower-case) with the values in the Data Field Tag Properties.

Resources