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

时间:2013-11-18 19:34:39

标签: docusignapi

我正在使用DocuSign API并且我在收件人没有获取我保存在网站上的标签时遇到了一些问题。我使用DocuSign.com创建模板并将收件人设置为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创建的空收件人与收件人联系我发送邮件以使其显示标签?

1 个答案:

答案 0 :(得分:0)

在黑暗中拍摄一段时间后想出来。我很确定问题出现在收件人中,但是当我看一下TemplateReference时,我发现了RoleAssignments,显然是在Recipient中设置的.Role什么也没做。您必须使用以下内容在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 };