[英]Can not create a sender view for the envelope created by template Id in docusign
I am trying to create an embedded view of an Envelope that I created using a TempplateId
of a template created at my docusign account but the envelopesApi.CreateEnvelope
doesn't work. 我正在尝试创建一个信封的嵌入式视图,该视图是使用在docusign帐户中创建的模板的
TempplateId
创建的,但是envelopesApi.CreateEnvelope
不起作用。
Here's my method that creates the envelope for a User taking in the template Id 这是我的方法,用于为使用模板ID的用户创建信封
private string MakeEnvelope(string signerEmail, string signerName, string templateId)
{
EnvelopesApi envelopesApi = new EnvelopesApi();
// Data for this method
// signerEmail
// signerName
// ccEmail
// ccName
// templateId
EnvelopeDefinition env = new EnvelopeDefinition
{
TemplateId = templateId,
Status = "created"
};
TemplateRole signer1 = new TemplateRole();
signer1.Email = signerEmail;
signer1.Name = signerName;
signer1.RoleName = "Customer";
//Company tab for signer
Company companyTab = new Company
{
Value = "Systems Limited",
TabLabel = "0b640933-9224-48e7-b8bc-adf388b63ac5"
};
Company[] companyTabs = new Company[] { companyTab };
signer1.Tabs = new Tabs { CompanyTabs = new List<Company>(companyTabs) };
//Company tab for signer
env.TemplateRoles = new List<TemplateRole> { signer1 };
var options = new ReturnUrlRequest();
options.ReturnUrl = returnUrl;
EnvelopeSummary envelopeSummary = envelopesApi.CreateEnvelope(accountId, env);
ViewUrl recipientView = envelopesApi.CreateSenderView(accountId, envelopeSummary.EnvelopeId, options);
return recipientView.Url.ToString();
}
it gives this error: 它给出了这个错误:
"The recipient you have identified is not a valid recipient of the specified envelope."
can someone please help me with this? 有人可以帮我吗?
An integration Key (API error message uses the old term "integrator key") must be used in the same environment. 必须在同一环境中使用集成密钥(API错误消息使用旧术语“集成器密钥”)。 Did you create a Developer Sandbox integration Key?
您是否创建了开发人员沙盒集成密钥? have you used it to obtain a token using OAuth consent flow?
您是否使用它通过OAuth同意流程获取令牌? Typically this error happens when you use the wrong key or point to the wrong environment
通常,当您使用错误的密钥或指向错误的环境时,会发生此错误
It looks like you're not configuring your EnvelopesApi client, so there's no authentication info in the API call that's firing. 似乎您没有配置EnvelopesApi客户端,因此触发的API调用中没有身份验证信息。
If you've already done authentication on an ApiClient, you can pass that configuration into the EnvelopesApi client like this: 如果您已经在ApiClient上进行了身份验证,则可以将该配置传递给EnvelopesApi客户端,如下所示:
EnvelopesApi envelopesApi = new EnvelopesApi(apiClient.Configuration);
If you don't have authentication set up at all, I'd recommend referencing the auth code grant launcher: https://github.com/docusign/eg-03-csharp-auth-code-grant-core 如果您根本没有设置身份验证,建议您参考身份验证代码授予启动器: https : //github.com/docusign/eg-03-csharp-auth-code-grant-core
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.