gpt4 book ai didi

docusignapi - 我可以在嵌入式文档签名表单上预填写其他字段吗?

转载 作者:行者123 更新时间:2023-12-03 07:45:06 28 4
gpt4 key购买 nike

我想在与嵌入式签名一起使用的模板文档中预填充一些字段。我正在使用c#。我通过 DocuSign 模板向导添加了数据字段,并且想知道如何从 c-sharp 中的嵌入式签名代码中预填充数据字段?就我而言,我在模板中添加了出生日期和电话数据字段,并希望在提取文档进行签名时在 XML 中传递值。这是我所拥有的:

 string requestBody = "<envelopeDefinition xmlns=\"http://www.docusign.com/restapi\">" +
"<accountId>" + accountId + "</accountId>" +
"<status>sent</status>" +
"<emailSubject>Electronic Release of Information</emailSubject>" +
"<emailBlurb>Please sign the release of information form</emailBlurb>" +
"<templateId>" + System.Configuration.ConfigurationManager.AppSettings.Get("DocusignTempId") + "</templateId>" +
"<templateRoles>" +
"<templateRole>" +
"<email>" + pUserEmail + "</email>" + // NOTE: Use different email address if username provided in non-email format!
"<name>" + pUserName + "</name>" + // username can be in email format or an actual ID string
"<tabs>" +
"<textTabs>" +
"<textTab>" +
"<tabLabel>DOB</tabLabel>" +
"<value>" + pDOB + "</value>" +
"</textTab>" +
"<textTab>" +
"<tabLabel>Telephone</tabLabel>" +
"<value>" + pTelephone + "</value>" +
"</textTab>" +
"</textTabs>" +
"</tabs>" +
"<roleName>Signer</roleName>" +
"<clientUserId>1</clientUserId>" +
"</templateRole>" +
"</templateRoles>" +
"</envelopeDefinition>";

在演示网站上,我在模板上创建了 2 个数据字段:数据字段:标签:出生日期,数据字段:标签:电话

需要知道我做错了什么。签名部分和其他一切都工作正常。

最佳答案

我有一些代码可以做到这一点,但它使用的是 JSON(而不是 XML)。这是:

        //
// DocuSign Step 1. Login
//
, function(next) {
var options = {
"method": "GET"
, "headers": {
"X-DocuSign-Authentication": dsAuthHeader
, "content-type": "application/json"
, "accept": "application/json"
}
, "uri": "https://demo.docusign.net/restapi/v2/login_information"
};

request(options, function(err, res, body) {
console.log("Login Result: \r\n", JSON.parse(body))
baseUrl = JSON.parse(body).loginAccounts[0].baseUrl;

next(null);
});

}

//
// DocuSign Step 2. Request Signature From Template
//
, function(next) {
var uri = baseUrl + "/envelopes"
, options = {
"method": "POST"
, "headers": {
"X-DocuSign-Authentication": dsAuthHeader
, "content-type": "application/json"
, "accept": "application/json"
}
, "uri": uri
, "body" : JSON.stringify({
"emailSubject": "Patient Intake form from Human API"
, "templateId": templateId
, "templateRoles": [{
"email": humanEmail
, "name": humanName
, "roleName": templateRoleName
, "clientUserId": 1
, "tabs" : {
"textTabs" : [{
tabLabel : "Email Address",
value : humanEmail
}
, {
tabLabel : "Name",
value : humanName
}
, {
tabLabel : "Height",
value : height
}
, {
tabLabel : "Weight",
value : weight
}
,{
tabLabel : "Address 1",
value : '1212 Victoria Lane'
}
,{
tabLabel : "Address 2",
value : 'San Francisco, CA, 94109'
}

]
}
}]
,"status": "sent"
})
};

request(options, function(err, res, body) {
console.log("Request Envelope Result: \r\n", JSON.parse(body));
next(null, body);
})
}

//
// DocuSign Step 3. Get Send View
//
, function(body, next) {
var envelopeUri = JSON.parse(body).uri
, options = {
"method": "POST"
, "headers": {
"X-DocuSign-Authentication": dsAuthHeader
, "content-type": "application/json"
, "accept": "application/json"
}
, "uri": baseUrl + envelopeUri + "/views/recipient"
, "body": JSON.stringify({
"authenticationMethod": "email",
"email": humanEmail,
"returnUrl": "http://humanapi.co/",
"userName": humanName,
"clientUserId": "1"
})
};

request(options, function(err, res, body) {
console.log("Get Embedded View: \r\n", JSON.parse(body));
response.render('docusign', { signing_url: JSON.parse(body).url });
});
}

我知道这并不完全是您正在寻找的(C# + XML),但也许您可以获取此 JSON 并将其放入 C# 请求中?让我知道。

关于docusignapi - 我可以在嵌入式文档签名表单上预填写其他字段吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17732550/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com