I have two recipients in my template that need to be witnessed. My requirement is to, keep the second recipient optional. That means I want to specify one or two recipients. I could create the envelope without the optional recipient, if the recipients don't need to be witnessed. As soon as I change the template so that they require a witness, I receive this error unless both are specified,
One or more errors occurred. (Error calling CreateEnvelope: {"errorCode":"WITNESS_FOR_SIGNER_ID_INVALID","message":"The witness host signer Id is not valid. Witness recipient id = 4"})
I'm using CompositeTemplates
to create the template.
EnvelopeDefinition env = new EnvelopeDefinition {
CompositeTemplates = compositeTemplates,
Status = "created"
};
var apiClient1 = new ApiClient(acct.BaseUri "/restapi");
apiClient1.Configuration.DefaultHeader.Add("Authorization", "Bearer " accessToken.access_token);
EnvelopesApi envelopesApi = new EnvelopesApi(apiClient1);
EnvelopeSummary results = envelopesApi.CreateEnvelope(acct.AccountId, env, new EnvelopesApi.CreateEnvelopeOptions { mergeRolesOnDraft= "true"});
So how can I create envelope with optional recipients that need to be witnessed?
CodePudding user response:
If the template includes a recipient that is not optional, then when you create an envelope from this template - you must include that recipient.
To support your scenario, remove the witness recipient from the template. You can then use your code to add the witness when you want it