How do I set up multiple in-person signers via DocuSign's eSignature API? - docusignapi

Currently my app is able to create the envelope, and the recipient view, grab the url and redirect the browser to the signing session. What happens then is the first signer can sign, and will be redirected back to my app when they finish signing. Then the host gets an email to start the hosting session for the second signer.
Instead, what I'd like to have happen is the first signer signs, then the second signer signs, then redirected back to my app. Is this possible?
Thanks.
This is my request to create the envelope with a custom document, and a template that was previously created. The custom document will only be signed by the second signer. The template will be signed by the first signer, then the second signer.
{
'emailSubject': emailSubject,
'emailBlurb': emailBlurb,
'status': 'sent',
'envelopeIdStamping': 'false',
'compositeTemplates': [{
'document': {
'documentId': '1',
'name': fileName,
'documentBase64': base64File
},
'inlineTemplates': [{
'sequence': '1',
'recipients': {
'inPersonSigners': [{
'hostEmail': hostEmail,
'hostName': hostName,
'inPersonSigningType': 'inPersonSigner',
'recipientId': '2',
'requireIdLookup': 'false',
'routingOrder': '2',
'signerEmail': signer2Email,
'signerName': signer2Name,
'tabs': {
'signHereTabs': [{
'documentId': '1',
'anchorString': signatureAnchorString
}],
'initialHereTabs': [{
'documentId': '1',
'anchorString': initialAnchorString
}]
} //Tabs
}] //Signers
} //Recipients
}] //Inline Templates
}, //Documents
'serverTemplates': [{
'sequence': '1',
'templateId': templateId
}],
'inlineTemplates': [{
'sequence': '2',
'recipients': {
'inPersonSigners': [{
'hostEmail': hostEmail
'hostName': hostName
'inPersonSigningType': 'inPersonSigner',
'signerEmail': signer1Email,
'signerName': signer1Name,
'recipientId': '1',
'requireIdLookup': 'false',
'routingOrder': '1',
'roleName': signer1Role
},
{
'hostEmail': hostEmail,
'hostName': hostName,
'inPersonSigningType': 'inPersonSigner',
'signerEmail': signer2Email,
'signerName': signer2Name,
'recipientId': '2',
'requireIdLookup': 'false',
'routingOrder': '2',
'roleName': signer2Role
}] //inPersonSigners
} //Recipients
}] //inlineTemplates
} //Template Document
This is my request for the recipient's view.
let viewRequest = {
'returnUrl': myappsUrl,
'authenticationMethod': 'none',
'email': hostEmail
'userName': hostName
}

So, here you have an opportunity to redirect to some URL, right?
let viewRequest = {
'returnUrl': myappsUrl,
'authenticationMethod': 'none',
'email': hostEmail
'userName': hostName
}
myappsURL is a URL that goes to your code. The code in there should be doing this:
Generating the same type of embedded URL for the second signer (with a different returnURL) . Same as you did for first.
Redirecting browser to the URL that was generated in 1.
This will allow you to do what you asked

Related

Docusign Text Tabs in template not populating

I am using docusign (production account) to allow users to sign documents. I am trying to add data to textTabs that I create through the docusign dashboard. So say if I add a text box and call it nbShares, the below code does not populate the box. All the boxes I add in the dashboard such as signature, text, checkboxes etc are not shown in the generated link. I get no API errors either. I also tried to create customFields, and pass data to them as textTab - however this did not work either.
I think I may misunderstand the flow, I add all recipients and signers programatically - is that why I cant see the placeholders/buttons I add? I have also allowed collaboration in the fields I add, made them mandatory - yet they still do not appear.
Would really appreciate some help on this. This is my envelope definition - Im using the node sdk along with ts types.
const makeEnvelopeDefinition = async (
templateName: string,
user: User,
dealId?: string,
): Promise<EnvelopeDefinition> => {
const personToSign: Signer = {
email: user.email,
name: user.name,
roleName: 'Signer',
// Should this work?
tabs: {
textTabs: [
{ tabLabel: 'nbShares', value: '1000' },
],
},
clientUserId: DOCUSIGN_CLIENT_USER_ID,
recipientId: '1',
}
const compositeTemplate: CompositeTemplate = {
serverTemplates: [
{ sequence: '1', templateId: 'remote-template-id' },
],
inlineTemplates: [
{
sequence: '1',
recipients: {
signers: [personToSign],
certifiedDeliveries: [
{
email: 'someemail#something.com',
recipientId: '77',
name: 'Receipt of transaction',
},
{
email: user.email,
recipientId: '771',
name: user.name,
},
],
},
},
],
}
// create the envelope definition
const envelope: EnvelopeDefinition = {
emailSubject: 'Review signed document',
status: 'sent',
compositeTemplates: [compositeTemplate],
}
return envelope
}
For me the solution was changing my signer to this
const personToSign: Signer = {
email: user.email,
name: user.name,
clientUserId: await getDocusignConfig().DOCUSIGN_CLIENT_USER_ID,
recipientId: '1',
routingOrder: '1', // Was missing this
roleName: 'Signer', // Must match signer specified on docusign dashboard
tabs: {
textTabs: [
{
xPosition: '150',
yPosition: '200',
name: 'First Name',
tabLabel: 'name', // Must match the dataLabel name specified on docusign
value: 'Test',
},
],
},
}
And enabling this setting 'When an envelope is sent, write the initial value of the field for all recipients' in 'Signing Settings' on docusign.

How does admin. messaging. AndroidNotification need to be configured for localization?

In the firebase documentation I found that admin. messaging. AndroidNotification has properties to provide localization to your notifications. Or at least that is what I understand from it.
https://firebase.google.com/docs/reference/admin/node/admin.messaging.AndroidNotification
In the docs they have bodyLocArgs and bodyLocKey to localize the body and titleLocArgs and titleLocKey. How do these need to be configured in order to localize my notification?
So let's say my client (the android device) is using en_US as his current language. Is my clients locale used to localize the notification?
This is what my current message
const translator = deviceData.language !== 'nl' ? languages.en : languages.nl;
const title = `${translator['messageTitle' as keyof typeof translator]} ${group.displayName}`;
const body = `${sender.displayName} ${translator[type as keyof typeof translator]}`;
const systemTrayNotification: TokenMessage = {
token: deviceData.cloudMessagingToken,
notification: {
title: title,
body: body,
},
data: {
title: title,
body: body,
senderId: sender.id,
senderDisplayName: sender.displayName,
groupId: group.id,
type: 'groupMessage',
messageType: type,
sentAt: new Date().toISOString(),
},
android: {
priority: 'high',
notification: {
priority: 'max',
channelId: '59054',
clickAction: 'FLUTTER_NOTIFICATION_CLICK',
tag: 'groupMessage',
defaultSound: true,
defaultVibrateTimings: true,
bodyLocArgs: //what do I do here?,
bodyLocKey: //what do I do here?
titleLocArgs: //what do I do here?,
titleLocKey: //what do I do here?
}
},
apns: {
payload: {
aps: {
category: 'groupMessage',
headers:{
"apns-priority":"10"
},
alert: {
title: title,
body: body,
},
aps: {
sound: 'default',
},
customData: {
title: title,
body: body,
senderId: sender.id,
senderDisplayName: sender.displayName,
groupId: group.id,
type: 'groupMessage',
messageType: type,
sentAt: new Date().toISOString(),
}
}
},
}
}
Use like this.
body: jsonEncode({
'notification': <String, dynamic>{
'title_loc_key': 'BOOKING_RECEIVED_PUSH_SUBTITLE',
'title_loc_args': [booking.shopName],
'body_loc_key': 'BOOKING_RECEIVED_PUSH_BODY',
'body_loc_args': [
customerName,
'',
bookingStart
], //, bookingDate, bookingStart]),
'sound': 'true',
'mutable_content': 'true',
'content_available': 'true'
},
'priority': 'high',
'data': <String, dynamic>{
'click_action': 'FLUTTER_NOTIFICATION_CLICK',
'id': '1',
'status': 'done'
},
'to': customerFCMToken
})).whenComplete(() {
print('sendBookingReceived(): message sent');
}).catchError((e) {
print('sendBookingReceived() error: $e');
});
try this and let me know if it is working or not.

Amazon Cognito - AdminCreateUser - how to not skip email verification

I am using Amazon Cognito user pool and AdminCreateUser api to create a new user so that we don't allow users to sign themselves up. It works great but it seems that email verification step is being skipped so when making an api call, I needed to set email_verified attribute to true to make reset password flow to work.
Can I make email verification to happen before sending out an inviatation email?
const params = {
DesiredDeliveryMediums: ['EMAIL'],
UserAttributes: [
{
Name: 'email',
Value: email
},
{
Name: 'email_verified',
Value: 'True'
},
],
Username: email,
UserPoolId: userPoolId,
}
cognitoIdentityService.adminCreateUser(params, function(err, data) {
// ...
To prevent backend to send verification email, set MessageACtion="SUPPRESS"
response = client.admin_create_user(
UserPoolId='USER_POOL_ID',
Username='USERNAME',
TemporaryPassword='PASSWORD',
UserAttributes=[
{
'Name': 'email',
'Value': 'email#example.com'
},
{
'Name': 'email_verified',
'Value': 'true'
}
],
MessageAction='SUPPRESS'
)

how to get the particular value from the response array received after wallet creation in bitgo Js

This is my array and want to get values from it:
{ wallet:
Wallet {
bitgo:
BitGo {
_baseUrl: 'https://test.bitgo.com',
env: 'test',
_baseApiUrl: 'https://test.bitgo.com/api/v1',
del: [Function] },
baseCoin:
BaseCoin {
network: [Object],
coinKeychains: [Keychains] },
_wallet:
{ id: '5b055bae749a9ba207410c65ff58c325',
users: [Array],
coin: 'tltc',
label: 'My Test Wallet',
m: 2,
n: 3,
pendingApprovals: [] } },
userKeychain:
{ id: '47i3ygdhfhdhjfj84378r'
users: [ '3w65gsdhfgshg93w2r2839'],
pub: 'zsnadfsheg94t854tidghfhdhgdhh kladjfghgdhfhdhfghdhhfghgh',
ethAddress: '0xzxder4tewre79618eceret3a2eabf6c8',
encryptedPrv: '{}',
prv: ' },
backupKeychain:
{ id: '54idhjfhdj9a9ba207410c505912c1b1',
users: [ '90jdfjgbja7007sdjbgjffc7a5065006' ],
pub: '',
ethAddress: '0x753ce0sdfvsdsgdf8baef8sdfesdfssfs2bdd8cb',
prv: '',
source: 'backup' },
bitgoKeychain:
{ id: '5b055bad39230ccc07814e0589388100',
users: [ '5ac1fd5563fa7007d5a17fc7a5065006' ],
pub: '',
ethAddress: '0xbfdgfdgdfdgfhfgtr6756ghfghfg719320fcc7e',
isBitGo: true },
}
// here want to get userKeychain, backupKeychain and bitgoKeychainPlease help how to fetch the this value. Is there any function to access this values or need any parsing method in bitgo Js.
You can get it using like : wallet.wallet._wallet.id
This will give you the wallet id.To get the userKeychain value use like wallet.userKeychain

Load Email messages attached to transaction Suitescript 2.0

I'm trying to load up all of the emails that have been sent from a transaction via SuiteScript 2.0.
When I run
record.getSublists()
it returns the following:
["item","activeworkflows","workflowhistory","custom8","messages","contacts","activities","usernotes","systemnotes","mediaitem","links","cases","partners","events","calls","tasks"]
However, when I then try to run the following:
record.getSublist('messages');
I receive an error.
I need to be able to check the date of the last email sent so I can determine whether or not to send a follow-up email.
The approach I typically take is to use the Search API to get this type of information:
require(['N/search'], function(search) {
var result = search.create({
type: 'transaction',
filters: [
['internalid', search.Operator.ANYOF, id], 'AND',
['mainline', search.Operator.IS, 'T'], 'AND',
['messages.messagetype', search.Operator.ANYOF, 'EMAIL'], 'AND',
['messages.isincoming', search.Operator.IS, 'F']
],
columns: [
search.createColumn({name: 'internalid', summary: search.Summary.GROUP}),
search.createColumn({name: 'messagedate', join: 'messages', summary: search.Summary.MAX}),
],
}).run().getRange({ start: 0, end: 1 });
var dateOfLastEmail = result[0].getValue({ name: 'messagedate', join: 'messages', summary: search.Summary.MAX });
});

Resources