发送nodejs sdk之前,填充预填充图
我们如何使用DocuSign的Nodejs SDK填充预填充图? 这是流程。我在第5号失败。
- 从项目数据库中获取数据。
- DocuSign身份验证以获取 AccountId
- 从模板创建信封草稿// {状态:“创建”}我可以确认它是我帐户中的草稿。
- 获取 kenloveedid 。
- 使用 AccountIdId 和 ChempectedId 编辑字段的EnlovingApi.CreateDocumentTabs。
这是代码。我不确定我是否正在使用错误的API,但这是我发现的最接近的API。但是,它返回“不良请求”。
这是我的代码失败:
if (envelopeId) {
console.log(accountId, envelopeId, tabs);
const res = await envelopesApi
.createDocumentTabs(accountId, envelopeId, '1', getTabs("hello"));
console.log(res);
}
我尝试了标签的差异格式,这是我在getTabs(projname:string)funtion上尝试的一些。
a)
const prefillTabs = {
textTabs: [
{
'anchorString': '/koujimei/',
'anchorUnits': 'pixels',
'anchorXOffset': '20',
'anchorYOffset': '10',
'scaleValue': '1.5',
'name': 'projName',
'value': projName,
},
],
};
return JSON.stringify(prefillTabs)
b)这个与文档相匹配吗?
const prefillTabs = {
prefillTabs: {
textTabs: [
{
'anchorString': '/koujimei/',
'anchorUnits': 'pixels',
'anchorXOffset': '20',
'anchorYOffset': '10',
'scaleValue': '1.5',
'name': 'projName',
'value': projName,
},
],
},
};
return JSON.stringify(prefillTabs);
c)
const prefillTabs = {
tabs: {
prefillTabs: {
textTabs: [
{
'anchorString': '/koujimei/',
'anchorUnits': 'pixels',
'anchorXOffset': '20',
'anchorYOffset': '10',
'scaleValue': '1.5',
'name': 'projName',
'value': projName,
},
],
},
},
};
return JSON.stringify(prefillTabs);
我还尝试直接使用无弦的对象,但是Typescript表示它需要字符串。
文档还说第四个参数是可选的,但仍然失败了“不良请求”。
const res = await envelopesApi
.createDocumentTabs(accountId, envelopeId, '1');
How do we populate prefillTabs using docusign's nodejs sdk?
Here is the flow.I am failing at No. 5.
- Fetch data from the projects database.
- Docusign authentication to get accountId
- Create envelope draft from template // {status: "created"} I can confirm that it is draft in my account.
- Get the envelopedId.
- use envelopeAPI.createDocumentTabs with accountId and envelopedId to edit fields.
Here is the code. I am not sure if I am using the wrong API, but it is the closest I found. However it returns "Bad Request".
Here is my code that is failing :
if (envelopeId) {
console.log(accountId, envelopeId, tabs);
const res = await envelopesApi
.createDocumentTabs(accountId, envelopeId, '1', getTabs("hello"));
console.log(res);
}
I tried diffent format for the tabs here are some I tried at my getTabs(projName: string) funtion.
A)
const prefillTabs = {
textTabs: [
{
'anchorString': '/koujimei/',
'anchorUnits': 'pixels',
'anchorXOffset': '20',
'anchorYOffset': '10',
'scaleValue': '1.5',
'name': 'projName',
'value': projName,
},
],
};
return JSON.stringify(prefillTabs)
B) This one matches the docs?
const prefillTabs = {
prefillTabs: {
textTabs: [
{
'anchorString': '/koujimei/',
'anchorUnits': 'pixels',
'anchorXOffset': '20',
'anchorYOffset': '10',
'scaleValue': '1.5',
'name': 'projName',
'value': projName,
},
],
},
};
return JSON.stringify(prefillTabs);
C)
const prefillTabs = {
tabs: {
prefillTabs: {
textTabs: [
{
'anchorString': '/koujimei/',
'anchorUnits': 'pixels',
'anchorXOffset': '20',
'anchorYOffset': '10',
'scaleValue': '1.5',
'name': 'projName',
'value': projName,
},
],
},
},
};
return JSON.stringify(prefillTabs);
I also tried directly using the objects without stringify, but Typescript says it requires string.
Also docs say that 4th parameter is optional but it still fails "Bad Request".
const res = await envelopesApi
.createDocumentTabs(accountId, envelopeId, '1');
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是一个预填充选项卡通过API请求构建器实时示例您可以更改输出的输出node.sdk的工具的语言。
这是一个工作示例:
Here is a PreFill tabs live example via the API Request Builder You can change the output language of the tool to the Node.SDK.
Here is a working example: