[英]How to send docusign draft envelope to recipient in sequence?
這是我用來將草稿信封發送到簽名處理程序的完整流程,以便簽名處理程序可以在發送給其他簽名者收件人之前進行修改:
//獲取訪問令牌:
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);
}
但是每次在管理員帳戶下草稿信封而不是簽名處理程序(在這種情況下是編輯器)。 我做錯了什么?
您希望editor
收件人管理一些后來的收件人。 沒關系。
但是editor
不會收到信封,直到它處於已sent
狀態。 您當前持有的信封處於created
狀態,即草稿。
嘗試改變
env.Status = "created";
到
env.Status = "sent";
關於
但編輯器仍然無法對信封請求進行更改。 它說即使他擁有 DS 管理員配置文件權限,也沒有足夠的權限進行更改。 我想要做的是,信封應該去編輯草稿(應該可以做修改)並且應該可以做修改。
不幸的是,我對editor
收件人類型沒有任何經驗。 (我不清楚你所說的“修改”信封是什么意思——改變文件?改變其他收件人?別的什么?
檢查編輯器使用的姓名和電子郵件地址是否與他們用於登錄 DocuSign 的名稱和電子郵件地址完全相同。
僅使用 DocuSign Web 應用程序(無 API)試用您的工作流程。 檢查信封發送后,編輯器可以為所欲為。
然后使用 API 日志記錄准確查看 DocuSign Web 應用程序如何設置編輯器收件人的屬性。 然后,您可以在 API 應用程序中復制它。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.