我正在尝试使用endpoint POST /v2/accounts/{accountId}/templates/{templateId}/recipients/{recipientId}/tabs
以编程方式将选项卡添加到模板
我可以可靠地放置checkboxTabs
、dateSignedTabs
、signHereTabs
和initialHereTabs
,但是当涉及到放置textTabs
(最重要的几个)时,我似乎无法控制使用API Explorer时的尺寸。
我输入了高度和宽度参数
但是请求变成了
{
"textTabs": [
{
"documentId": "1",
"locked": "true",
"pageNumber": "1",
"required": "false",
"tabLabel": "dataLabel",
"xPosition": "200",
"yPosition": "200"
}
]
}
响应如下所示
{
"textTabs": [
{
"isPaymentAmount": "false",
"shared": "false",
"requireInitialOnSharedChange": "false",
"requireAll": "false",
"required": "false",
"locked": "true",
"concealValueOnDocument": "false",
"disableAutoSize": "false",
"tabLabel": "dataLabel",
"font": "arial",
"bold": "false",
"italic": "false",
"underline": "false",
"fontColor": "black",
"fontSize": "size7",
"documentId": "1",
"recipientId": "XXXXXX",
"pageNumber": "1",
"xPosition": "200",
"yPosition": "200",
"tabId": "e940cc97-a68c-4da6-9ffe-487439579bc6"
}
]
}
并在页面上呈现为一个非常小的文本框。
1)这是API Explorer的限制吗
2)或者从这个端点创建选项卡时高度和宽度不是有效的选项? 2.a)如果是这样,正确的方法是什么?
发布于 2019-04-17 03:05:34
这绝对是api explorer的一个问题:如果你接受它提供的查询,并使用所需的参数手动提交它:
{
"textTabs": [
{
"documentId": "1",
"locked": "true",
"pageNumber": "1",
"required": "false",
"tabLabel": "dataLabel",
"height": "11",
"width": "400",
"xPosition": "200",
"yPosition": "200"
}
]
}
您将能够设置height
& width
!
现在,Docusign可能会因为你的大脑无法理解的原因而改变它们。400 !== 396 in the response
,但别担心,希望这只是过程的一部分。算你走运,至少API Explorer的那个页面可以工作,它直接指向don't have documentation!的unlike some endpoints
此外,使用python sdk的示例实现:(在读取autogenerated code不清楚的情况下)
tabs = {
"checkboxTabs": [
{
"documentId": "1",
"locked": "true",
"pageNumber": "1",
"tabLabel": "check1",
"xPosition": "100",
"yPosition": "100"
}
],
"dateSignedTabs": [
{
"documentId": "1",
"pageNumber": "1",
"xPosition": "300",
"yPosition": "100"
}
],
"signHereTabs": [
{
"documentId": "1",
"pageNumber": "1",
"xPosition": "200",
"yPosition": "200"
}
],
"initialHereTabs": [
{
"documentId": "1",
"pageNumber": "1",
"xPosition": "300",
"yPosition": "200"
}
],
"textTabs": [
{
"pageNumber": "1",
"xPosition": "50",
"yPosition": "50",
"tabLabel": "text1",
"locked": "true",
"required": "false",
"documentId": "1",
"height": "11",
"width": "400"
}
]
}
response = Template.template_api.create_tabs(recipient_id=recipient_id, template_id=template_id, account_id=Template.accountID, template_tabs=tabs).to_dict()
https://stackoverflow.com/questions/55715057
复制相似问题