Docusign: disabling sender's ability to edit recipients - docusignapi

I'm using the Docusign REST APi v2 to set up docusign links for "senders" to receive links which open the docusign sender view console to place signature tags. And also to provide recipients their links to open the signing/recipient console.
We want to lock down what the senders can do as much as possible since everything the console needs will be provided to the API from our web site. We managed to go into the Docusign sandbox's preferences and munder the features menu, we disabled various tag options and custom tagging.
I have only one thing left I'd like to do; Disable the ability for the sending console to change recipient (that to/from area at the top of the console).
The users of our console only need to place the tags and hit send; we don't want them messing with the recipients themselves.
In the same features screen I disabled some features named:
Enable Send To Address Recipients
Enable Send To Manage Envelope
Enable Send To Manage Recipients
It did not have the intended effect.
Is this possible to disable this area?

You might be able to accomplish this using one of the additional recipient types such as the editor recipient.
Editors can modify tabs of an envelope and can also edit recipient information, however you can stop them from modifying the recipient name and email through additional body parameters canEditRecipientEmails and canEditRecipientNames.
Editor Recipient type from API docs.

You can use composite templates to perform the situation you described in one of your comments: 'Is there a way to create a template that's just 100% "blank: with no documents or recipients added and use that do build an envelope add a new document to that envelope?? '
Using composite templates allows you to specify a template ID and then override the underlying PDF bytes. You can create a new template and upload a blank PDF. Make sure there are no signers and then set the option to not allow editing recipients. Then specify the recipient in your JSON when creating the envelope (by the way, this is a multipart form with the boundary set to MY_BOUNDARY):
--MY_BOUNDARY
Content-Type: application/json
Content-Disposition: form-data
{
"emailSubject":"test subject",
"emailBlurb":"test blurb",
"compositeTemplates":[
{
"serverTemplates":[
{
"sequence":1,
"templateId":"<blank pdf template>"
}
],
"inlineTemplates":[
{
"sequence":1,
"recipients":{
"signers":[
{
"email":"email#domain.com",
"name":"first last",
"recipientId":"1",
"roleName":"Signer",
"clientUserId":"1"
}
]
}
}
],
"document":{
"documentId":"1",
"name":"test1.pdf"
}
}
],
"status":"created"
}
--MY_BOUNDARY
Content-Type: application/pdf
Content-Disposition: file; filename="test1.pdf"; documentId="1";
Content-Transfer-Encoding: base64
<pdf bytes>
--MY_BOUNDARY--

You can achieve this by setting below attribute at envelope level[EnvelopeDefinition.class] i.e.
#ApiModelProperty(example = "null", value = "When set to **true**, prevents senders from changing, correcting, or deleting the recipient information for the envelope.")
#JsonProperty("recipientsLock")
public String getRecipientsLock() {
return recipientsLock;
}
public void setRecipientsLock(String recipientsLock) {
this.recipientsLock = recipientsLock;
}

Related

docuSign - envelopeViews : createRecipient

ERROR: Content Type specified is not supported.
Hi there, I am new to DocuSign and I am trying to learn the implementation from last couple of days. What I did so far is, created a developer account and created a QuickStart project.
Goal
I want to integrate the DocuSign API's in my application, but I don't really want the user to leave my application. I just want to make use of DocuSign within my app. - Embedded Signing
What I did?
I successfully created an envelope with a sample document and after that I have to get that URL to view (for Recipient).
So I called the below API:
** EnvelopeViews: createRecipient**
** POST - {{baseUrl}}/v2.1/accounts/{{accountId}}/envelopes/{{envelopeId}}/views/recipient**
All the details, like accountId, envelopeId are correct, along with that the request body that I pass with this is:
Request Body
{
"authenticationMethod": "none",
"clientUserId": "bcc49234-f30b-XXXX-XXXX-XXXXXXXXXXXX",
"email": "abc#gmail.com",
"recipientId": "007",
"returnUrl":"http://localhost",
"userName": "user name"
}
Note: * clientUserId is my Integration Key (please let me know if this is what I need to pass here or something else).*
Response
{
"errorCode": "INVALID_CONTENT_TYPE",
"message": "Content Type specified is not supported."
}
Note: Apart from the solution, please provide any link(s) to resources where I can easily see the implementation(as in my use case).
Umair,
First clientUserId is a bit of a confusing term, it's not the IK (Integration Key) but any string you want. It is unique to the signer and the envelope. You choose it.
You can find a detailed example of this with code in 8 languages on the DocuSign Developer Center How To Request Signature Through your app page.
I'm not clear how you make the API calls, if you are using postman, there are headers that needs to be set. One of them is called Content-Type and it has to be set to text/plain.

DocuSign API - Reset/Unlock RecipientAuthenticationStatus

I'm using the DocuSign API to electronically sign documents within my app. I'm using the access code authentication feature, for some additional security; however, I am trying to 'Unlock' a signer (via the API) that has input the wrong access code too many times, without voided and creating a new envelope, or using the DocuSign Admin interface.
I don't care if I have to resend the initial email, I just want to be able to conserve my client's total envelope count. It's also important (if there are multiple signers) that I don't force one signer to have to sign multiple times, if they completed their signatures prior to signer2's authentication error.
I have attempted a POST to:
/v2/accounts/{accountId}/envelopes/{envelopeId}?resend_envelope=true
I have also sought a solution using the docusign-java-client:
Recipients recipients = envelopesApi.listRecipients(accountId, envelopeId);
List<Signer> signers = recipients.getSigners();
for (Signer signer : signers) {
signer.setRecipientAuthenticationStatus(null);
}
I still get the below response
"recipientAuthenticationStatus": {
"accessCodeResult": {
"status": "Failed",
"eventTimestamp": "2018-01-15T23:49:15.8600000Z"
}
I'm able to "Resend" via the DocuSign admin GUI, and everything works as expected...
Is there any way that I'm able "reset/unlock" this authentication feature programatically, through the API?
You can use below PUT endpoint
PUT /restapi/v2/accounts/<accountId>/envelopes/<envelopeId>?resend_envelope=true
Body as:
{
}
This should send another email to the signer who failed the authentication, and that user will again get option to enter the access code.
I think you will need to delete and then re-add the recipient (signer). That makes the signer become a new recipient.
However, doing so means you'll need to re-create everything about the signer: their document tabs/fields, etc.
I can't imagine that it is less expensive to simply void/resend the envelope than to spend a developer's time to work on this issue.
If this scenario is occurring a lot, then perhaps think about providing better training to your signers with respect to using the access code feature.
Per the documentation found here
I must include the json or xml with the request (if the authentication method failed). I assumed incorrectly that if there was only one recipient, then I would NOT have to specify. If you just want to resend the envelope, you don't need to include and signer data.
Such as:
{"signers" :
[{"email":"testEmail#gmail.com",
"name":"FirstName LastName",
"recipientId":"1"
}]
}
You should then get something like the below response:
{"recipientUpdateResults":
[{
"recipientId": "1",
"errorDetails":
{
"errorCode": "SUCCESS",
"message": ""
}
}]
}

Getting the email id from the Outlook REST API when sending email

I am trying to use the Microsoft Rest API to send emails on behalf of our users. When I create a message as a draft, I get back an ID that I can use in future requests for editing, deleting, viewing the full conversation (after it is sent), etc.
I do not want to save it as a draft since I have no reason to, I just want to send it directly. After it is sent, I would still like to view the full conversation. However, if I just send the email (using the /sendmail endpoint), I do not get that ID. Is there anyway to get it? Here is my request:
POST https://outlook.office.com/api/v2.0/Users/email/sendmail
{
"Message": {
"Subject": "Test",
"Importance": "Normal",
"ToRecipients": [{
"EmailAddress": {
"Address": "<email>",
"Name": "<name>"
}
}],
"Sender": {
"EmailAddress": {
"Address": "<email",
"Name": "<name>"
}
},
"Body": {
"ContentType": "HTML",
"Content": "<html>\\n<head>\\n <style>\\n p { color: red; }\\n </style> \\n</head>\\n<body>\\n <p>Test</p>\\n</body>\\n</html>\\n"
}
},
"SaveToSentItems": "true"
}
The HTTP response code is 202, the email sends, but the body is empty (no content, whatsoever).
I don't think this matters, since I can recreate this in Postman, but I am running this in Nodejs using the node-outlook package.
Emails in Exchange via REST and EWS are submitted for transport, but the actual send and subsequent save to the sent items folder are done async. This is why you don't get the id. Transport is who actually writes the email to the sent items folder, not REST.
If you really need to find the item after it has been saved to the sentItems folder, set something like the PR_SEARCH_KEY and then do a view of the sent items folder and seek to that search key value.
Also note when you save a draft, the id that you get back will be different than the id of the item in the sent items folder because the folder Id is part of the id of the item, so that id wouldn't help you anyways.
I don't know which rest api version are you using (i'm using v2.0) but i will try to explain this issue. Sorry for my english i advance.
You have 2 ways to reply a message: on the fly way or the complete way.
On the fly way
Its the easy way, just send a post request to
https://outlook.office.com/api/v2.0/me/messages/{message_id}/reply
or
https://outlook.office.com/api/v2.0/me/messages/{message_id}/replyall
and with the body
{
"Comment": "This is your message in plain text or html code"
}
and thats all.
The problem with this methos that you can only send plain text or HTML, no attachments or anything else. If that's all you need this is your best option.
The complete way
If you need to send an attachment or perform any other action you need to perform these 3 steps:
1. Create a draft from the message you want to reply
Send a post request to
https://outlook.office.com/api/v2.0/me/messages/{message_id}/createreply
This will give you an json object save the "Id" property {draft_id} of this draft for later use.
2. Update the draft
Send a patch request to
https://outlook.office.com/api/v2.0/me/messages/{draft_id}
and with the body
{
"Body": {
"ContentType": "HTML or Text",
"Content": "Your response in plain text or html"
}
}
or any other parameter you want to change.
3. Send the draft
Send a post request to
https://outlook.office.com/api/v2.0/me/messages/{draft_id}/send
And thats it.
If you need more info abut this check https://msdn.microsoft.com/en-us/office/office365/api/mail-rest-operations

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"
}
]
}
}

Delete Envelope in created state

How can I delete a draft envelope using REST API? (status=created). I want to be able to destroy the envelope as it needs changes to subject and email blurb which I have been told is not possible via REST API after the creation of the envelope.
To Delete through the DocuSign Console:
You can delete an envelope from your Drafts folder by navigating to that folder, selecting the envelope(s) in question, and deleting through the UI.
To Delete through the DocuSign REST API:
This is not well documented at the moment but this can be accomplished by using the MoveEnvelope() call and moving it into your Recycle Bin folder. The following page from the REST API guide describes the call you need make:
DocuSign REST API Guide - Move Envelopes
The details of the call are as follows:
URL:
/accounts/{accountId}/folders/{folderId}
Method:
PUT
Body:
{
"envelopeIds": [
"sample string 1",
"sample string 2"
],
"fromFolderId": "sample string 1"
}
As with all other calls, this can be formatted in JSON or XML. If using XML request bodies, use the following:
<envelopeMoveRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.docusign.com/restapi">
<envelopeIds xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d2p1:string>sample string 1</d2p1:string>
<d2p1:string>sample string 2</d2p1:string>
</envelopeIds>
<fromFolderId>sample string 1</fromFolderId>
</envelopeMoveRequest>

Resources