PhoneAuthentication.SenderProvidedNumbers always null in DocuSign IdCheckConfigurationName == "Phone Auth $" - docusignapi

I have created an envelope with signers and setting PhoneAuthentication this way
signer.IdCheckConfigurationName = "Phone Auth $";
RecipientPhoneAuthentication phoneAuthentication = new RecipientPhoneAuthentication
{
RecipMayProvideNumber = "true",
SenderProvidedNumbers = new List()
};
phoneAuthentication.SenderProvidedNumbers.Add(signerDto.SignerCountryCode + signerDto.SignerPhoneNumber);
signer.PhoneAuthentication = phoneAuthentication;
signer.RequireIdLookup = signerDto.RequireIdLookup ? "true" : "false";`
But when I am fetching ListRecipients - Signers- IdCheckConfigurationName == "Phone Auth $" PhoneAuthentication always null
Can you suggest why it is null?

Yes, so you are using the old way and you need to change to the new way.
You can find a detailed article on this topic on developer center.
Looks like you are using C#, the C# code looks like this:
string workflowId = phoneAuthWorkflow.WorkflowId;
EnvelopeDefinition env = new EnvelopeDefinition()
{
EnvelopeIdStamping = "true",
EmailSubject = "Please Sign",
EmailBlurb = "Sample text for email body",
Status = "Sent"
};
byte[] buffer = System.IO.File.ReadAllBytes(docPdf);
// Add a document
Document doc1 = new Document()
{
DocumentId = "1",
FileExtension = "pdf",
Name = "Lorem",
DocumentBase64 = Convert.ToBase64String(buffer)
};
// Create your signature tab
env.Documents = new List<Document> { doc1 };
SignHere signHere1 = new SignHere
{
AnchorString = "/sn1/",
AnchorUnits = "pixels",
AnchorXOffset = "10",
AnchorYOffset = "20"
};
// Tabs are set per recipient/signer
Tabs signer1Tabs = new Tabs
{
SignHereTabs = new List<SignHere> { signHere1 }
};
string workflowId = workflowId;
RecipientIdentityVerification workflow = new RecipientIdentityVerification()
{
WorkflowId = workflowId,
InputOptions = new List<RecipientIdentityInputOption> {
new RecipientIdentityInputOption
{
Name = "phone_number_list",
ValueType = "PhoneNumberList",
PhoneNumberList = new List<RecipientIdentityPhoneNumber>
{
new RecipientIdentityPhoneNumber
{
Number = phoneNumber,
CountryCode = countryAreaCode,
}
}
}
}
};
Signer signer1 = new Signer()
{
Name = signerName,
Email = signerEmail,
RoutingOrder = "1",
Status = "Created",
DeliveryMethod = "Email",
RecipientId = "1", //represents your {RECIPIENT_ID},
Tabs = signer1Tabs,
IdentityVerification = workflow,
};
Recipients recipients = new Recipients();
recipients.Signers = new List<Signer> { signer1 };
env.Recipients = recipients;

Related

DocuSign Notary API Error - NOTARY_NOT_ALLOWED

I am reviewing the Docusign Notary functionalioty through the API. But i am stuck in one point.
The API Return an exception "{"errorCode":"NOTARY_NOT_ALLOWED","message":"Notary not enabled."}"
.I am using developer account to test the above fuctionality(demo.docusign.net). Is there any additional settings there to enable Docusign Notary?
private static EnvelopeDefinition MakeEnvelope(string signerEmail, string signerName, string signerClientId, string docPdf, string accountId)
{
byte[] buffer = System.IO.File.ReadAllBytes(docPdf);
EnvelopeDefinition envelopeDefinition = new EnvelopeDefinition();
envelopeDefinition.EmailSubject = "Please sign this document";
Document doc1 = new Document();
String doc1b64 = Convert.ToBase64String(buffer);
doc1.DocumentBase64 = doc1b64;
doc1.Name = "Lorem Ipsum";
doc1.FileExtension = "docx";
doc1.DocumentId = "3";
envelopeDefinition.Documents = new List<Document> { doc1 };
Signer signer1 = new Signer
{
Email = signerEmail,
Name = signerName,
ClientUserId = signerClientId,
RecipientId = "2",
NotaryId = "1",
RoutingOrder = "1"
};
NotaryRecipient notaryRecipient = new NotaryRecipient
{
Email = "xxx#xxx.com",
Name = "xxx",
RecipientId = "1",
RoutingOrder = "1",
Tabs = new Tabs
{
NotarySealTabs = new List<NotarySeal>() { new NotarySeal { XPosition = "50", YPosition = "150", DocumentId = "3", PageNumber = "1" } },
SignHereTabs = new List<SignHere>() { new SignHere { XPosition = "300", YPosition = "150", DocumentId = "3", PageNumber = "1" } }
},
UserId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx",//accountId,
NotaryType = "remote"
};
Tabs signer1Tabs = new Tabs
{
SignHereTabs = new List<SignHere>() { new SignHere { XPosition = "150", YPosition = "150", DocumentId = "3", PageNumber = "1" } }
};
signer1.Tabs = signer1Tabs;
Recipients recipients = new Recipients
{
Signers = new List<Signer> { signer1 },
Notaries = new List<NotaryRecipient> { notaryRecipient }
};
envelopeDefinition.Recipients = recipients;
envelopeDefinition.Status = "sent";
return envelopeDefinition;
}
did I missed any thing?
And I also added Notary Public in the corresponding account
The code is a bit off. You need to do this (see blog post on the topic):
var notaryHost = new NotaryHost
{
Name = "Nadia Notary",
Email = "nadianotary#domain.com",
DeliveryMethod = "email",
RecipientId = "2",
Tabs = new Tabs { NotarizeTabs = notarizeTabs }
};
// InPersonSigner is used here even if the signer doesn't sign in person
var inPersonSigner = new InPersonSigner
{
NotaryHost = notaryHost,
Name = "Eddie End User",
Email = "endusersigner#domain.com",
RecipientId = "1",
InPersonSigningType = "notary",
Tabs = new Tabs { SignHereTabs = signHereTabs }
};
var inPersonSigners = new List<InPersonSigner>();
inPersonSigners.Add(inPersonSigner);
var recipients = new Recipients{ InPersonSigners = inPersonSigners };
PS
It may be that you are trying to use the beta Remote Online Notary feature, and not the more established eNotary that is part of eSign. If that was your intention, you may not be able to do this, as it's a closed beta and not open yet to everyone.

Change "Via" Name In DocuSign Envelope Email

Currently using the DocuSign nodejs documentation to send Envelope to a user who fills out an online form. However the email that comes back from Docusign sending looks like this...
Andrew Stanton via DocuSign dse_NA3#docusign.net
However I want to adjust this to look like it comes from business instead of the name of the owner of the DocuSign account. Something like this...
BUSINESS NAME via DocuSign <dse_NA3#docusign.net
Is this an option that is available to set within the docusign node js package? This is how I currently have my nodejs code setup...
/**
* Creating Docusign Envelope
*
* #param pdfPath = Document getting sent for signing
* #param email
* #param firstName
* #param lastName
*/
export async function sendEnvelope(pdfPath, email, firstName, lastName) {
// Signer Information:
const signerName = `${firstName} ${lastName}`;
const signerEmail = email;
/**
* The envelope is sent to the provided email address.
* One signHere tab is added.
* The document path supplied is relative to the working directory
*/
const apiClient = new docusign.ApiClient();
const { basePath, accessToken } = await getAuthInfo();
apiClient.setBasePath(basePath);
apiClient.addDefaultHeader("Authorization", "Bearer " + accessToken);
// Set the DocuSign SDK components to use the apiClient object
docusign.Configuration.default.setDefaultApiClient(apiClient);
// Create the envelope request
const envDef = new docusign.EnvelopeDefinition();
//Set the Email Subject line and email message
envDef.emailSubject =
"Please sign this contract with BUSINESS NAME.";
envDef.emailBlurb =
"Thank you for providing your listing with Dade Auctions Incorporated. Please sign this contract.";
// Read the file from the document and convert it to a Base64String
const pdfBytes = fs.readFileSync(pdfPath),
pdfBase64 = pdfBytes.toString("base64");
// Create the document request object
const doc = docusign.Document.constructFromObject({
documentBase64: pdfBase64,
fileExtension: "pdf", // You can send other types of documents too.
name: "DADE Auctions Listing Agreement",
documentId: "1",
});
// Create a documents object array for the envelope definition and add the doc object
envDef.documents = [doc];
// Create the signer object with the previously provided name / email address
const signer = docusign.Signer.constructFromObject({
name: signerName,
email: signerEmail,
routingOrder: "1",
recipientId: "1",
});
// Create the signHere tab to be placed on the envelope
const signHere = docusign.SignHere.constructFromObject({
documentId: "1",
recipientId: "1",
tabLabel: "SignHereTab",
anchorString: "Seller (Sign Here)",
anchorXOffset: "-30",
anchorYOffset: "-20",
anchorIgnoreIfNotPresent: "false",
anchorUnits: "pixels",
});
const signerDate = docusign.DateSigned.constructFromObject({
recipientId: "1",
anchorString: "Seller (Sign Here)",
anchorXOffset: "45",
anchorYOffset: "20",
});
const initialHere = docusign.InitialHere.constructFromObject({
documentId: "1",
recipientId: "1",
tabLabel: "SignHereTab",
anchorString: "Initial:",
anchorXOffset: "45",
anchorYOffset: "0",
anchorIgnoreIfNotPresent: "false",
anchorUnits: "pixels",
});
// Create the overall tabs object for the signer and add the signHere tabs array
// Note that tabs are relative to receipients/signers.
signer.tabs = docusign.Tabs.constructFromObject({
signHereTabs: [signHere],
initialHereTabs: [initialHere],
dateSignedTabs: [signerDate],
});
// Add the recipients object to the envelope definition.
// It includes an array of the signer objects.
envDef.recipients = docusign.Recipients.constructFromObject({
signers: [signer], //dadeSigner removed
});
// Set the Envelope status. For drafts, use 'created' To send the envelope right away, use 'sent'
envDef.status = "sent";
// Send the envelope
// The SDK operations are asynchronous, and take callback functions.
const envelopesApi = new docusign.EnvelopesApi();
const createEnvelopePromise = promisify(envelopesApi.createEnvelope).bind(
envelopesApi
);
let results = undefined;
try {
results = await createEnvelopePromise(ACCOUNT_ID, {
envelopeDefinition: envDef,
});
} catch (e) {
console.log("An exception occurred.", e);
const body = e.response && e.response.body;
if (body) {
return { body, status: e.response.status };
} else {
// Not a DocuSign exception
throw e;
}
}
// Envelope has been created:
if (results) {
return { body: results, signerName, signerEmail };
}
return null;
}
Any help on how to switch the name of the From email address that gets automatically sent would be helpful. Thank you!
The name and email address corresponding to the sending DocuSign user account will always be shown on/for sent envelopes. You can setup multiple users within your DocuSign account and choose which one you use when authenticating and that will be used for the sender name/email address values.
You could setup a Service Auth / JWT impersonation unless the person who you would like to be listed as the sender is present to authenticate themselves for Auth Code Grant.

Docusign composite template not being received by recipients but is shown on DS inbox/sent

I'm following the recipe that can be found here:
https://developers.docusign.com/esign-rest-api/code-examples/code-example-adding-document-template#run-the-example
But I found that despite the envelope is shown as sent on the docusign inbox, the recipients won't receive it, here's the code...
const tabs = getTabsMethodWorkingForStandaloneTemplates({
name: "name",
email: "name#email.com"
});
// Create a signer recipient for the signer role of the server template
let signer1 = docusign.Signer.constructFromObject({
email: args.signerEmail,
name: args.signerName,
roleName: "signer",
recipientId: "1",
// Adding clientUserId transforms the template recipient
// into an embedded recipient:
clientUserId: args.signerClientId,
tabs
});
// Recipients object:
let recipientsServerTemplate = docusign.Recipients.constructFromObject({
signers: [signer1],
});
// create a composite template for the Server Template
let compTemplate1 = docusign.CompositeTemplate.constructFromObject({
compositeTemplateId: "1",
serverTemplates: [
docusign.ServerTemplate.constructFromObject({
sequence: 1,
templateId: args.templateId
})
],
// Add the roles via an inlineTemplate
inlineTemplates: [
docusign.InlineTemplate.constructFromObject({
sequence: 1,
recipients: recipientsServerTemplate
})
]
});
//const compTemplate2 = getCompositeTemplateFromHTML(args);
const eventNotification = new docusign.EventNotification();
eventNotification.url = 'http://pj.pagekite.me';
eventNotification.includeDocuments = true;
eventNotification.loggingEnabled = true;
eventNotification.envelopeEvents = getEnvelopeEvents();
// create the envelope definition
let env = docusign.EnvelopeDefinition.constructFromObject({
status: "sent",
compositeTemplates: [
compTemplate1,
// compTemplate2
],
eventNotification
});
try {
// Step 2. call Envelopes::create API method
// Exceptions will be caught by the calling function
let results = await envelopesApi.createEnvelope(
args.accountId,
{envelopeDefinition: env}
);
let envelopeId = results.envelopeId;
console.log(`Envelope was created. EnvelopeId ${envelopeId}`);
} catch (e) {
debugger
}
You have clientUserId in there. That means embedded signing. Remove that and an email will be sent for remote signing. These two are mutual exclusive. Can't have them both.

Creating PO receipt (Return) throws error "An error occurred while processing the field Vendor Ref. value <> has already been used"

i am using Screen based API and it was working, recently started getting error saying the vendor ref exists on the document.
I noticed that the webservice call is somehow trying to create the document 2 times and on the second time it gets this error.
Following is the code, and i cant figure out what is wrong.
PO302000Content ReturnSchema;
ReturnSchema = context.PO302000GetSchema();
context.PO302000Submit(new Command[] { ReturnSchema.Actions.Insert });
//HEADER
AcumaticaInterface.apitest.Command[] Document = new AcumaticaInterface.apitest.Command[]
{
new Value
{
Value = interfaceStatus.Doc1Type,
LinkedCommand = ReturnSchema.DocumentSummary.Type
},
ReturnSchema.Actions.Insert,
new Value
{
Value = BPCode,
LinkedCommand = ReturnSchema.DocumentSummary.Vendor,
Commit = true
},
new Value
{
Value = BPRefNbr ,
LinkedCommand = ReturnSchema.DocumentSummary.VendorRef
},
new Value
{
Value = PostDate.HasValue ? ((DateTime)PostDate.Value).ToLongDateString() : "",
LinkedCommand = ReturnSchema.DocumentSummary.Date
},
new Value
{
Value = Comments,
LinkedCommand = ReturnSchema.DocumentSummary.NoteText
},
new Value
{
Value = "TEST VALUE",
LinkedCommand = ReturnSchema.DocumentSummary.VendorRef
}
};
context.PO302000Submit(Document);
//LINE
AcumaticaInterface.apitest.Command[] Docline = new AcumaticaInterface.apitest.Command[]
{
ReturnSchema.DocumentDetails.ServiceCommands.NewRow,
new Value
{
Value = line.ItemID,
LinkedCommand = ReturnSchema.DocumentDetails.InventoryID
},
new Value
{
Value = OutletCode,
LinkedCommand = ReturnSchema.DocumentDetails.Warehouse
},
new Value
{
Value = line.Uom,
LinkedCommand = ReturnSchema.DocumentDetails.UOM ,
},
new Value
{
Value = line.Qty.ToString(),
LinkedCommand = ReturnSchema.DocumentDetails.ReceiptQty ,
Commit = true
},
new Value
{
Value = line.Price.ToString(),
LinkedCommand = ReturnSchema.DocumentDetails.UnitCost,
Commit = true
},
new Value
{
Value = line.DiscPct.ToString(),
LinkedCommand = ReturnSchema.DocumentDetails.DiscountPercent,
Commit = true
},
new Value
{
Value = line.LineRemarks,
LinkedCommand = ReturnSchema.DocumentDetails.NoteText ,
Commit = true
}
};
Document = Document.Concat(Docline).ToArray();
//save
AcumaticaInterface.apitest.Command[] save = new AcumaticaInterface.apitest.Command[] {
ReturnSchema.Actions.Save,
ReturnSchema.DocumentSummary.Type,
ReturnSchema.DocumentSummary.ReceiptNbr
};
Document = Document.Concat(save).ToArray();
//EXCEPTION HERE
var ReturnDoc = context.PO302000Submit(Document)[0];
Found a solution
After i submit the header data, I cleared the Commands. But its strange that it was working before.
context.PO302000Submit(Document);
Document = new Command[] { };

Workflow for embedded view

I'd like to have an email sent to a secondary recipient so they can sign once the first recipient has signed. How would I implement this? Here's what I have
signer.Tabs = new Tabs();
signer.Tabs.SignHereTabs = new List<SignHere>();
var signHere = new SignHere();
signHere.DocumentId = "1";
signHere.PageNumber = "1";
signHere.RecipientId = "1";
signHere.AnchorUnits = "pixels";
signHere.AnchorXOffset = "150";
signHere.AnchorYOffset = "5";
signHere.AnchorString = "PARTICIPANT SIGNS";
signHere.Optional = "true";
signer.Tabs.SignHereTabs.Add(signHere);
envDef.Recipients = new Recipients();
envDef.Recipients.Signers = new List<Signer>();
envDef.Recipients.Signers.Add(signer);
EnvelopeSummary envelopeSummary = envelopesApi.CreateEnvelope(accountId, envDef);
var viewOptions = new RecipientViewRequest()
{
//ReturnUrl = "https://"
ReturnUrl = "https://www.docusign.com/devcenter",
ClientUserId = clientId, // must match clientUserId set in step #2!
AuthenticationMethod = "email",
UserName = user.FullName,
Email = user.Email
};
The user object above is just a custom class with user information from our system. If I just add another signed with a higher clientuserid will that automatically send the email to that user after the first has signed?
Specifying the clientUserId means the recipient is considered as an embedded recipient. No emails will be sent an embedded recipient.
For your use-case add another recipient without the clientUserId and a higher routing order. The second recipient will automatically receive an email after the first recipient finishes signing.
Note: Use different anchor strings for each recipient.
public void CreateEnvelopeWithTwoRecipients()
{
string accountID = Init(); //Initialization Code
byte[] fileBytes = System.IO.File.ReadAllBytes(#"C:\temp\Agreement.pdf");
var envDef = new EnvelopeDefinition()
{
EmailSubject = "My Envelope Subject",
Status = "sent",
Documents = new List<Document>()
{
new Document()
{
DocumentBase64 = System.Convert.ToBase64String(fileBytes),
Name = "Contract",
DocumentId = "1"
}
},
Recipients = new Recipients()
{
Signers = new List<Signer>()
{
new Signer()
{
Email = "janedoe#acme.com",
Name = "Jane Doe",
RecipientId = "1",
RoutingOrder = "1",
clientUserId = "10000"
Tabs = new Tabs()
{
SignHereTabs = new List<SignHere>()
{
new SignHere()
{
DocumentId = "1",
AnchorXOffset = "150",
AnchorXOffset = "5",
AnchorString = "PARTICIPANT SIGNS",
AnchorUnits = "pixels",
Optional = "true"
}
}
}
},
new Signer()
{
Email = "johnsmith#acme.com",
Name = "john smith",
RecipientId = "2",
RoutingOrder = "2",
Tabs = new Tabs()
{
SignHereTabs = new List<SignHere>()
{
new SignHere()
{
DocumentId = "1",
AnchorXOffset = "150",
AnchorXOffset = "5",
AnchorString = "Second PARTICIPANT SIGNS",
AnchorUnits = "pixels",
Optional = "true"
}
}
}
}
}
}
};
EnvelopesApi envelopesApi = new EnvelopesApi();
EnvelopeSummary envelopeSummary = envelopesApi.CreateEnvelope(accountID, envDef);
}

Resources