Docusignapi 使用CreateEnvelopeFromTemplates()时删除信封选项卡

Docusignapi 使用CreateEnvelopeFromTemplates()时删除信封选项卡,docusignapi,Docusignapi,我在使用DocuSign API,我有一些问题,收件人没有得到我保存在网站用户界面上的标签。我使用DocuSign.com创建了一个模板,并将收件人设置为Recipients and routing下的Role=[testRole]Email=[]Name=[]Type=[Sign]。因为我还没有收件人。然后在发送之前使用api将收件人设置为: //Recipient Info Recipient recipient = new Recipient();

我在使用DocuSign API,我有一些问题,收件人没有得到我保存在网站用户界面上的标签。我使用DocuSign.com创建了一个模板,并将收件人设置为Recipients and routing下的Role=[testRole]Email=[]Name=[]Type=[Sign]。因为我还没有收件人。然后在发送之前使用api将收件人设置为:

        //Recipient Info
        Recipient recipient = new Recipient();
        recipient.Email = recipientEmail;
        recipient.UserName = recipientName;
        recipient.SignerName = recipientName;
        recipient.Type = RecipientTypeCode.Signer;
        recipient.RoleName = recipientRoleName;
        recipient.ID = "1";
        recipient.SignInEachLocationSpecified = true;
        recipient.RoutingOrder = 1;
        Recipient[] recipients = new Recipient[] { recipient };

        //Template reference from server ID
        TemplateReference templateReference = new TemplateReference();
        templateReference.Template = templateID;
        templateReference.TemplateLocation = TemplateLocationCode.Server;

        //Envelope Info
        EnvelopeInformation envelopeInfo = new EnvelopeInformation();
        envelopeInfo.AccountId = AccountID;
        envelopeInfo.Subject = subject;
        envelopeInfo.EmailBlurb = message;

我将recipient.RoleName设置为与我在网站UI上设置的相同的值,但收件人仍然无法获得签名选项卡。我是不是遗漏了什么?或者,如何将我使用DocuSign UI创建的空收件人与我发送给它的收件人关联起来,使其显示选项卡?

在黑暗中拍摄一段时间后,我找到了答案。我很确定问题出在接收者身上,但当我查看TemplateReference时,我发现角色分配显然是在接收者身上设置的。角色什么都不做。您必须在TemplateReference中使用以下内容进行设置:

        //Recipient Role
        var recipientRole = new TemplateReferenceRoleAssignment();
        recipientRole.RecipientID = "101";
        recipientRole.RoleName = recipientRoleName;

        //Template reference from server ID
        TemplateReference templateReference = new TemplateReference();
        templateReference.Template = templateID;
        templateReference.TemplateLocation = TemplateLocationCode.Server;
        templateReference.RoleAssignments = new TemplateReferenceRoleAssignment[] { recipientRole };