当我创建一个带有字段的文档模板时,如果我使用 API 将其发送给其他人,字段会消失吗? [英] When I create a docusign template with fields, that if I send it to other people using API the fields disappear?

查看:15
本文介绍了当我创建一个带有字段的文档模板时,如果我使用 API 将其发送给其他人,字段会消失吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

ApiClient apiClient = new ApiClient("https://demo.docusign.net/restapi");列表<字符串>scopes = new List{OAuth.Scope_SIGNATURE,OAuth.Scope_IMPERSONATION};docuSign_JWT testConfig = new docuSign_JWT();testConfig.ApiClient = new ApiClient(testConfig.Host);//如果这是第一次登录 - 获得用户同意 - 这是一次性步骤.Uri oauthURI = testConfig.ApiClient.GetAuthorizationUri(testConfig.IntegratorKey, scopes, RedirectURI, OAuth.CODE, testState");Process.Start(oauthURI.ToString());var privateKeyStream = System.Text.Encoding.UTF8.GetBytes(File.ReadAllText(testConfig.PrivateKeyFilename));OAuth.OAuthToken tokenInfo = testConfig.ApiClient.RequestJWTUserToken(testConfig.IntegratorKey, testConfig.UserId, testConfig.OAuthBasePath, privateKeyStream, testConfig.ExpiresInHours);apiClient = new ApiClient("https://demo.docusign.net/restapi");apiClient.Configuration.DefaultHeader.Add("Authorization", "Bearer" + tokenInfo.access_token);EnvelopeDefinition 信封定义 = 新信封定义();信封定义.EmailSubject = "请签署此文件";信封定义.TemplateId = "***************";DocuSign.eSign.Model.TemplateRole cc1 = new DocuSign.eSign.Model.TemplateRole();cc1.Email = "Email1 默认模板收件人";cc1.Name = "姓名";cc1.RoleName = "员工";DocuSign.eSign.Model.TemplateRole cc2 = new DocuSign.eSign.Model.TemplateRole();cc2.Email = "Email2 新邮箱 ID";cc2.Name = "Name2";cc2.RoleName = "员工";DocuSign.eSign.Model.TemplateRole cc3 = new DocuSign.eSign.Model.TemplateRole();cc3.Email = "Email3 新电子邮件 ID";cc3.Name = "Name3";cc3.RoleName = "员工";列表templateRoles = new List();templateRoles.Add(cc1);templateRoles.Add(cc2);templateRoles.Add(cc3);信封定义.TemplateRoles = templateRoles;信封定义.状态=已发送";EnvelopesApi EnvelopesApi = new EnvelopesApi(apiClient);EnvelopeSummary 信封Summary = 信封Api.CreateEnvelope(ConfigurationManager.AppSettings[accountID"], 信封定义);

<块引用>

以上是我发送docuSign模板文档的代码.但是只有默认收件人才能获取带有字段的文档,其他收件人只能获取没有字段的 pdf 文件.如何将带有字段的模板文档发送给所有收件人.下面是模板字段 img谢谢

ApiClient apiClient = new ApiClient("https://demo.docusign.net/restapi");
        List<string> scopes = new List<string>
        {
            OAuth.Scope_SIGNATURE,
            OAuth.Scope_IMPERSONATION
        };
        docuSign_JWT testConfig = new docuSign_JWT();
        testConfig.ApiClient = new ApiClient(testConfig.Host);

        // If this is the first time logging in - Get Consent from the user - this is a onetime step.
        Uri oauthURI = testConfig.ApiClient.GetAuthorizationUri(testConfig.IntegratorKey, scopes, RedirectURI, OAuth.CODE, "testState");
        Process.Start(oauthURI.ToString());
        var privateKeyStream = System.Text.Encoding.UTF8.GetBytes(File.ReadAllText(testConfig.PrivateKeyFilename));
        OAuth.OAuthToken tokenInfo = testConfig.ApiClient.RequestJWTUserToken(testConfig.IntegratorKey, testConfig.UserId, testConfig.OAuthBasePath, privateKeyStream, testConfig.ExpiresInHours);
        apiClient = new ApiClient("https://demo.docusign.net/restapi");
        apiClient.Configuration.DefaultHeader.Add("Authorization", "Bearer " + tokenInfo.access_token);

        EnvelopeDefinition envelopeDefinition = new EnvelopeDefinition();
        envelopeDefinition.EmailSubject = "Please sign this document";
        envelopeDefinition.TemplateId = "***************";

        DocuSign.eSign.Model.TemplateRole cc1 = new DocuSign.eSign.Model.TemplateRole();
        cc1.Email = "Email1 default template recipient";
        cc1.Name = "Name";
        cc1.RoleName = "Staff";

        DocuSign.eSign.Model.TemplateRole cc2 = new DocuSign.eSign.Model.TemplateRole();
        cc2.Email = "Email2 new email ID";
        cc2.Name = "Name2";
        cc2.RoleName = "Staff";

        DocuSign.eSign.Model.TemplateRole cc3 = new DocuSign.eSign.Model.TemplateRole();
        cc3.Email = "Email3 new Email ID";
        cc3.Name = "Name3";
        cc3.RoleName = "Staff";

       
        List<DocuSign.eSign.Model.TemplateRole> templateRoles = new List<DocuSign.eSign.Model.TemplateRole>();    
        templateRoles.Add(cc1);
        templateRoles.Add(cc2);
        templateRoles.Add(cc3);

        envelopeDefinition.TemplateRoles = templateRoles;
        envelopeDefinition.Status = "sent";

        EnvelopesApi envelopesApi = new EnvelopesApi(apiClient);
        EnvelopeSummary envelopeSummary = envelopesApi.CreateEnvelope(ConfigurationManager.AppSettings["accountID"], envelopeDefinition);

Above is my code to send docuSign template document. But only default recipient get document with fields, other recipient get only pdf file without fields. How to send template document with fields to all recipient. below is template fields img Thank you

enter image description here

解决方案

It looks like all three of your recipients have the same RoleName, which means there's going to be an issue mapping each recipient to their role.

Template Role Names should be unique, and their definition in the API call need to match exactly what is present in the template. When setting up roles to be populated by through the API, it's also important to make sure that only the RoleName field is filled out. If a template has a "burned in" name and email address, you won't be able to populate them in your API call.

Can you grab a screenshot of how the recipients are set up on the template in the web console? Like this:

这篇关于当我创建一个带有字段的文档模板时,如果我使用 API 将其发送给其他人,字段会消失吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆