私はDocusignとインパルス署名者を使用して埋め込み署名します。私の.Netウェブサイトはログインしてdocusignテンプレートを開き、残りのapiを介してdocusignドキュメントのタグに値を渡すことができるはずです。しかし、残りのapiを介して "フルネーム"と "会社"ポピュレートされていません。テンプレートのロール名の名前は「Signer1」であり、またそれは、フリーフォームの署名を示しているaction.Checkとしてロール名Docusign apiはインサイド署名者として署名を埋め込んでいます - C#app - タグは残りのapiによって渡された値を設定せず、ドキュメントは自由形式の署名になります
のためのスクリーンショットのために、このパスを「人ログイン」を使用します。ドキュメントの左側に「FIELDS」があり、フォーム上にドラッグ&ドロップする必要があります(これらのフィールドに値が設定されています)。
しかし、私は左のフリーフォームフィールドを見たくありません。 私は、inperson署名者のためにタグ値を文書に渡したいだけで、文書に表示する必要があります。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Collections;
using System.Web;
using System.Web.UI;
using System.IO;
using System.Net;
using System.Xml;
using System.Text;
using RestSharp;
using Newtonsoft.Json;
using System.Web.UI.WebControls;
using System.Collections.Specialized;
using log4net;
using DocuSign.eSign.Api;
using DocuSign.eSign.Model;
using DocuSign.eSign.Client;
namespace TestProject
{
public partial class Home : System.Web.UI.Page
{
protected void getDocusign()
{
string username = "****";
string password = "****";
string integratorKey = "****************************";
string templateId = "*******************************";
string roleName = "Signer1";
string url = "https://demo.docusign.net/restapi/v2/login_information";
string baseURL = ""; // we will retrieve this
string accountId = ""; // will retrieve
string envelopeId = ""; // will retrieve
string uri = ""; // will retrieve
try
{
string authenticateStr =
"<DocuSignCredentials>" +
"<Username>" + username + "</Username>" +
"<Password>" + password + "</Password>" +
"<IntegratorKey>" + integratorKey + "</IntegratorKey>" +
"</DocuSignCredentials>";
//
// STEP 1 - Login
//
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
request.Headers.Add("X-DocuSign-Authentication", authenticateStr);
request.Accept = "application/xml";
request.Method = "GET";
HttpWebResponse webResponse = (HttpWebResponse)request.GetResponse();
StreamReader sr = new StreamReader(webResponse.GetResponseStream());
string responseText = sr.ReadToEnd();
using (XmlReader reader = XmlReader.Create(new StringReader(responseText)))
{
while (reader.Read())
{ // Parse the xml response body
if ((reader.NodeType == XmlNodeType.Element) && (reader.Name == "accountId"))
accountId = reader.ReadString();
if ((reader.NodeType == XmlNodeType.Element) && (reader.Name == "baseUrl"))
baseURL = reader.ReadString();
}
}
//
// STEP 2 - Request Envelope Result
//
// Construct an outgoing XML request body
string requestBody = "<envelopeDefinition xmlns=\"http://www.docusign.com/restapi\">" +
"<accountId>" + accountId + "</accountId>" +
"<status>sent</status>" +
"<emailSubject>Company Notice - Signature Request</emailSubject>" +
"<emailBlurb>Testing from Sandy</emailBlurb>" +
"<templateId>" + templateId + "</templateId>" +
"<templateRoles>" +
"<templateRole>" +
"<email>" + "[email protected]" + "</email>" + // NOTE: Use different email address if username provided in non-email format!
"<name>" + "George Keane" + "</name>" + // username can be in email format or an actual ID string
"<roleName>" + roleName + "</roleName>" +
"<clientUserId>9</clientUserId>" +
"<tabs>" +
"<textTabs>" +
"<text>" +
"<tabLabel>" + "Full Name" + "</tabLabel>" +
"<value>" + "George Keane" + " </value>" +
"</text>" +
"<text>" +
"<tabLabel>" + "Company" + "</tabLabel>" +
"<value>" + "Dell" + " </value>" +
"</text>" +
"</textTabs>" +
"</tabs>" +
"</templateRole>" +
"</templateRoles>" +
"</envelopeDefinition>";
// append "/envelopes" to baseUrl and use in the request
request = (HttpWebRequest)WebRequest.Create(baseURL + "/envelopes");
request.Headers.Add("X-DocuSign-Authentication", authenticateStr);
request.ContentType = "application/xml";
request.Accept = "application/xml";
request.ContentLength = requestBody.Length;
request.Method = "POST";
// write the body of the request
byte[] body = System.Text.Encoding.UTF8.GetBytes(requestBody);
Stream dataStream = request.GetRequestStream();
dataStream.Write(body, 0, requestBody.Length);
dataStream.Close();
// read the response
webResponse = (HttpWebResponse)request.GetResponse();
sr = new StreamReader(webResponse.GetResponseStream());
responseText = sr.ReadToEnd();
using (XmlReader reader = XmlReader.Create(new StringReader(responseText)))
{
while (reader.Read())
{ // Parse the xml response body
if ((reader.NodeType == XmlNodeType.Element) && (reader.Name == "envelopeId"))
envelopeId = reader.ReadString();
if ((reader.NodeType == XmlNodeType.Element) && (reader.Name == "uri"))
uri = reader.ReadString();
}
}
//
// STEP 3 - Get the Embedded Console Sign View
//
// construct another outgoing XML request body
string reqBody = "<recipientViewRequest xmlns=\"http://www.docusign.com/restapi\">" +
"<authenticationMethod>email</authenticationMethod>" +
"<email>" + "[email protected]" + "</email>" + //+ username + // NOTE: Use different email address if username provided in non-email format!
"<returnUrl>http://www.docusign.com</returnUrl>" + // username can be in email format or an actual ID string
"<clientUserId>9</clientUserId>" +
"<userName>" + "George Keane" + "</userName>" +
"</recipientViewRequest>";
// append uri + "/views/recipient" to baseUrl and use in the request
request = (HttpWebRequest)WebRequest.Create(baseURL + uri + "/views/recipient");
request.Headers.Add("X-DocuSign-Authentication", authenticateStr);
request.ContentType = "application/xml";
request.Accept = "application/xml";
request.ContentLength = reqBody.Length;
request.Method = "POST";
// write the body of the request
byte[] body2 = System.Text.Encoding.UTF8.GetBytes(reqBody);
Stream dataStream2 = request.GetRequestStream();
dataStream2.Write(body2, 0, reqBody.Length);
dataStream2.Close();
// read the response
webResponse = (HttpWebResponse)request.GetResponse();
sr = new StreamReader(webResponse.GetResponseStream());
responseText = sr.ReadToEnd();
using (XmlReader reader = XmlReader.Create(new StringReader(responseText)))
{
while (reader.Read())
{ // Parse the xml response body
if ((reader.NodeType == XmlNodeType.Element) && (reader.Name == "url"))
url = reader.ReadString();
}
}
Console.WriteLine("Embeded View Result --> " + responseText);
System.Diagnostics.Process.Start(url);
}
catch (WebException e)
{
using (WebResponse response = e.Response)
{
HttpWebResponse httpResponse = (HttpWebResponse)response;
Console.WriteLine("Error code: {0}", httpResponse.StatusCode);
using (Stream data = response.GetResponseStream())
{
string text = new StreamReader(data).ReadToEnd();
Console.WriteLine(text);
}
}
}
}
}
}
[enter image description here][1]
[1]: https://i.stack.imgur.com/iGx0U.jpg