Skip to main content
Solved

UNSPECIFIED_ERROR


Forum|alt.badge.img+2

Hi all, I want to create envelope but I receive the following error: errorCode":"UNSPECIFIED_ERROR","message":"Cannot find recipient with ID '1'.

The code:

EnvelopeDefinition envelopeDefinition = new EnvelopeDefinition();envelopeDefinition.setTemplateId(properties.getTemplateId());TemplateRole signer = new TemplateRole();signer.setEmail(“test@gmail.com”);signer.setName(“Test Test”);signer.clientUserId(“123456789”);signer.setRoleName("signer");Tabs tabs = fillTabs();signer.setTabs(tabs);envelopeDefinition.setTemplateRoles(List.of(signer));envelopeDefinition.setStatus("sent");

 

EnvelopesApi envelopesApi = new EnvelopesApi(getApiClient());EnvelopeSummary summary = envelopesApi.createEnvelope(accountId, envelopeDefinition);

Is there something I do wrong? What can be a reason for this error?

Best answer by JohnSantos

@Radi 

The error message "Cannot find recipient with ID '1'" typically indicates an issue with how the recipient information is being defined or referenced in the envelope creation process. Based on your provided code, there are a few areas to check and correct:

  1. Ensure Correct Usage of clientUserId: The clientUserId is used for embedded signing scenarios. If the recipient is not an embedded signer, you don't need to set this value. If it's necessary, ensure it's correctly set.

  2. Check Template Role and IDs: Verify that the role name used in your code matches exactly with the role defined in your template. Ensure the role name "signer" matches what's in the template.

  3. Proper Initialization of Tabs: The fillTabs() function should return a properly initialized Tabs object. Ensure that this function correctly sets up all necessary tabs.

View Original
Is this content helpful?

2 replies

JohnSantos
Valued Contributor
Forum|alt.badge.img+18
  • Valued Contributor
  • 975 replies
  • Answer
  • May 22, 2024

@Radi 

The error message "Cannot find recipient with ID '1'" typically indicates an issue with how the recipient information is being defined or referenced in the envelope creation process. Based on your provided code, there are a few areas to check and correct:

  1. Ensure Correct Usage of clientUserId: The clientUserId is used for embedded signing scenarios. If the recipient is not an embedded signer, you don't need to set this value. If it's necessary, ensure it's correctly set.

  2. Check Template Role and IDs: Verify that the role name used in your code matches exactly with the role defined in your template. Ensure the role name "signer" matches what's in the template.

  3. Proper Initialization of Tabs: The fillTabs() function should return a properly initialized Tabs object. Ensure that this function correctly sets up all necessary tabs.


Forum|alt.badge.img+2
  • Author
  • Newcomer
  • 1 reply
  • May 23, 2024

Thank you very much! It was the value of clientUserId.