Reputation: 29
I will be using my app credentials to create a document which should be edited by a editor recipient and should be signed by a signer recipient. It is failing with the below error though the recipient editor has a docusign account.
com.docusign.esign.client.ApiException: {
"errorCode": "EDITOR_MUST_HAVE_ACCOUNT",
"message": "The recipient Editor must be an existing DocuSign account member."
}
Below is my code -
EnvelopeDefinition envDef = new EnvelopeDefinition();
envDef.setEmailSubject(referral.getEmailSubject());
//Envelope events - Sent, Delivered, Completed, Declined, or Voided
//Recipient events - Sent, Delivered, Completed, Declined, AuthenticationFailed, and AutoResponded
envDef.setDocuments(getDocuments());
Tabs tabs = new Tabs();
tabs.setTextTabs(getTextTabs(referral));
EventNotification eventNotification = new EventNotification();
eventNotification.setLoggingEnabled("true");
eventNotification.setUrl("https://staging.agentdesks.com/v1.0/postbox/docusign/crs/event");
List<EnvelopeEvent> events = new ArrayList<>();
EnvelopeEvent event1 = new EnvelopeEvent();
event1.setEnvelopeEventStatusCode("completed");
events.add(event1);
EnvelopeEvent event2 = new EnvelopeEvent();
event2.setEnvelopeEventStatusCode("declined");
events.add(event2);
EnvelopeEvent event3 = new EnvelopeEvent();
event3.setEnvelopeEventStatusCode("voided");
events.add(event3);
eventNotification.setEnvelopeEvents(events);
envDef.setEventNotification(eventNotification);
Recipients recipients = new Recipients();
Editor editor = new Editor();
editor.setName(referral.getSender().getFirstname());
editor.setRecipientId(String.valueOf(referral.getSender().getIdFromMysql()));
editor.setEmail(referral.getSenderEmail());
editor.setClientUserId(String.valueOf(referral.getSender().getIdFromMysql()));
editor.setRoutingOrder("1");
editor.setRoleName("editor 1");
editor.setRequireIdLookup("false");
editor.setEmbeddedRecipientStartURL("www.google.com");
recipients.setEditors(new ArrayList<>(Arrays.asList(editor)));
Signer signer = new Signer();
signer.setName(referral.getReceiver().getFirstname());
signer.setEmail(referral.getReceiver().getEmail());
signer.setRecipientId(String.valueOf(referral.getReceiver().getIdFromMysql()));
signer.setTabs(tabs);
signer.setClientUserId(String.valueOf(referral.getReceiver().getIdFromMysql()));
signer.setRoutingOrder("2");
signer.setRoleName("signer 2");
recipients.setSigners(new ArrayList<>(Arrays.asList(signer)));
envDef.setRecipients(recipients);
envDef.setStatus("sent");
EnvelopeSummary envelopeSummary =
docusign.envelopeApi.createEnvelope(docusign.getAccountId(), envDef);
Upvotes: 3
Views: 323
Reputation: 1244
Vaibhav is right and this is not a bug. Although the error itself isn't explicit, it is correct; an embedded signer is inherently a non-accounted DocuSign user, yet the requirement for an editor is they are accounted.
Upvotes: 1
Reputation: 346
I got the same error with node SDK. I think an error here makes sense. Although the error message should be different.
clientUserId is specified for embedded recipients where authentication is not handled by DocuSign and hence the receiver may not be a DocuSign user - Docs. Whereas an editor type recipient mandates a DocuSign account. Hence even if you were able to send clientUserId and get an embedded viewUrl in response, it would take you to DocuSign login page followed by envelope editor http://prntscr.com/cyvg96.
Or, I might be wrong and this is just a DocuSign bug. Just my thoughts.
Upvotes: 2