【问题标题】:How to send docusign draft envelope to recipient in sequence?如何将docusign草稿信封按顺序发送给收件人?
【发布时间】:2020-09-08 13:28:44
【问题描述】:

这是我用来将草稿信封发送给签名处理程序的完整流程,以便签名处理程序可以在发送给其他签名者收件人之前进行修改:

//获取访问令牌:

private void GetAccessToken()
 {
    var apiClient = new ApiClient();
    string ik = integrationKey;
    string userId = userId;
    string authServer = authServer;
    string fileContents = await FileHelper.ReadFileContentAsString(RSAKeyPemFile);

    //Request for access token
    OAuth.OAuthToken authToken = apiClient.RequestJWTUserToken(ik,
                    userId,
                    authServer,
                    Encoding.UTF8.GetBytes(fileContents),
                    1);


    //Get userinfo for AccountId and BaseURI
    string accessToken = authToken.access_token;
    apiClient.SetOAuthBasePath(authServer);
    OAuth.UserInfo userInfo = apiClient.GetUserInfo(authToken.access_token);
    Account acct = null;

    var accounts = userInfo.Accounts;
    {
        acct = accounts.FirstOrDefault(a => a.IsDefault == "true");
    }
    string accountId = acct.AccountId;
    string baseUri = acct.BaseUri + "/restapi";

    //Set details to configuration object which would be used for sending envelope request
    this.accessToken = accessToken;
    this.accountId = accountId;
    this.baseUri = baseUri;
}

//创建信封

private EnvelopeDefinition MakeEnvelope()
{

    // create the envelope definition
    EnvelopeDefinition env = new EnvelopeDefinition();
    env.EmailSubject = "Please sign this document";

    //Get document extension
    Document documentToSign = new Document
    {
        DocumentBase64 = Convert.ToBase64String(documentBytes),
        Name = documentName,
        FileExtension = documentExtension,
        DocumentId = documentId
    };

    // The order in the docs array determines the order in the envelope
    env.Documents = new List<Document> { documentToSign };

    var routingOrder = 1;
    var signatureHandler = new Editor
    {
        Email = signatureHandler.mail,
        Name = signatureHandler.displayName,
        RecipientId = routingOrder.ToString(),
        RoutingOrder = routingOrder.ToString()
    };

    routingOrder++;

    List<Signer> signers = new List<Signer>();
    foreach (var signer in signerList)
    {
        signers.Add(new Signer { Name = signerList.displayName, Email = signerList.mail, RoleName = signerList.jobTitle, RecipientId = routingOrder.ToString(), RoutingOrder = routingOrder.ToString() });
        routingOrder++;
    }

    // Add the recipients to the envelope object
    Recipients recipients = new Recipients
    {
        Editors = new List<Editor> { signatureHandler },
        Signers = signers
    };

    //Attache all recipients to envelope
    env.Recipients = recipients;

    env.EventNotification = eventNotification;

    env.Status = "created";

    return env;
}

//发送草稿信封

public void SendEnvelope()
{
    EnvelopeDefinition env = MakeEnvelope();
    var config = new Configuration(baseUri);

    var apiClient = new ApiClient(baseUri);
    apiClient.Configuration = config;
            
    EnvelopesApi envelopesApi = new EnvelopesApi(apiClient);
    EnvelopeSummary result = await envelopesApi.CreateEnvelopeAsync(accountId, env);
}

但是每次在管理员帐户草稿下的草稿信封而不是签名处理程序(在这种情况下是编辑器)。我做错了什么?

【问题讨论】:

  • 您希望编辑器能够进行哪些具体更改? DocuSign 不支持共享草稿信封,因此如果最终目标是让一个用户创建一个信封并让另一个用户发送它,那么您将需要以某种方式妥协。

标签: c# docusignapi


【解决方案1】:

您希望editor 收件人管理一些后来的收件人。没关系。

但是editor 在处于sent 状态之前不会收到信封。您目前持有created 状态的信封,即草稿。

尝试改变

env.Status = "created";

env.Status = "sent";

添加

关于

但编辑器仍然无法更改信封请求。它说即使他拥有 DS Admin profile 权限,也没有足够的权限进行更改。我要做的是,信封应该去编辑草稿(应该可以修改)并且应该可以修改。

很遗憾,我对editor 收件人类型没有任何经验。 (我不清楚您所说的“修改”信封是什么意思——更改文件?更改其他收件人?还有别的吗?

检查编辑使用的姓名和电子邮件地址是否与他们登录 DocuSign 时使用的姓名和电子邮件地址完全相同。

更重要的是:

仅使用 DocuSign 网络应用程序(无 API)试用您的工作流程。检查信封寄出后,编辑可以为所欲为。

然后使用 API 日志记录准确查看 DocuSign Web 应用程序如何设置编辑器收件人的属性。然后,您可以在您的 API 应用程序中复制它。

【讨论】:

  • 这有助于将envelope 直接发送到编辑的收件箱,但editor 仍然无法更改envelope 请求。它说即使他拥有DS Admin 个人资料权限,也没有足够的权限进行更改。我要做的是,envelope 应该去编辑草稿(应该可以修改)并且应该可以修改。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-10-13
  • 2015-11-17
相关资源
最近更新 更多