我无法正确理解DocuSign API。
我的第一个任务是简单地发送和创建一个信封。我使用UIView和Core Graphics创建了一个PDF(在iOS中)。然后我继续将Anchor选项卡放在我需要签名的部分。
由于创建了Anchor标签,我不确定是否应该将标签作为输出的一部分发送。
这是我的输出正文
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:DSAPIService="http://www.docusign.net/API/3.0" xsl:version="1.0">
<soap:Body>
<DSAPIService:CreateAndSendEnvelope>
<DSAPIService:Envelope>
<DSAPIService:AccountId>(Account Id)</DSAPIService:AccountId>
<DSAPIService:Documents>
<DSAPIService:Document>
<DSAPIService:ID>1</DSAPIService:ID>
<DSAPIService:Name>(Name)</DSAPIService:Name>
<DSAPIService:PDFBytes>(PDF data)</DSAPIService:PDFBytes>
</DSAPIService:Document>
</DSAPIService:Documents>
<DSAPIService:Recipients>
<DSAPIService:Recipient>
<DSAPIService:ID>1</DSAPIService:ID>
<DSAPIService:UserName>(Signer 1)</DSAPIService:UserName>
<DSAPIService:Email>(Signer 1 email)</DSAPIService:Email>
<DSAPIService:Type>Signer</DSAPIService:Type>
<DSAPIService:RoutingOrder>0</DSAPIService:RoutingOrder>
</DSAPIService:Recipient>
<DSAPIService:Recipient>
<DSAPIService:ID>2</DSAPIService:ID>
<DSAPIService:UserName>(Signer 2)</DSAPIService:UserName>
<DSAPIService:Email>(Signer 2 Email)/DSAPIService:Email>
<DSAPIService:Type>Signer</DSAPIService:Type>
<DSAPIService:RoutingOrder>1</DSAPIService:RoutingOrder>
</DSAPIService:Recipient>
<DSAPIService:Recipient>
<DSAPIService:ID>3</DSAPIService:ID>
<DSAPIService:UserName>(Signer 3)</DSAPIService:UserName>
<DSAPIService:Email>(Signer 3 email)</DSAPIService:Email>
<DSAPIService:Type>InPersonSigner</DSAPIService:Type>
<DSAPIService:CaptiveInfo/>
<DSAPIService:RoutingOrder>2</DSAPIService:RoutingOrder>
</DSAPIService:Recipient>
<DSAPIService:Recipient>
<DSAPIService:ID>4</DSAPIService:ID>
<DSAPIService:UserName>(Signer 4)</DSAPIService:UserName>
<DSAPIService:Email>(Signer 4 email)</DSAPIService:Email>
<DSAPIService:Type>Signer</DSAPIService:Type>
<DSAPIService:RoutingOrder>3</DSAPIService:RoutingOrder>
</DSAPIService:Recipient>
</DSAPIService:Recipients>
<DSAPIService:Tabs/>
<DSAPIService:Subject>(Subject)</DSAPIService:Subject>
<DSAPIService:EmailBlurb>Please sign the attached document.</DSAPIService:EmailBlurb>
<DSAPIService:EnableWetSign>true</DSAPIService:EnableWetSign>
</DSAPIService:Envelope>
</DSAPIService:CreateAndSendEnvelope>
</soap:Body>
</soap:Envelope>
以下是我的回复
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"><soap:Header><wsa:Action>http://schemas.xmlsoap.org/ws/2004/08/addressing/fault</wsa:Action><wsa:MessageID>urn:uuid:9a22096c-ca51-4445-80fd-78c08f9b0f24</wsa:MessageID><wsa:RelatesTo>urn:uuid:7f921133-4834-402b-aaa7-769b7fa0042b</wsa:RelatesTo><wsa:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:To><wsse:Security><wsu:Timestamp wsu:Id="Timestamp-9b102c34-6215-4fd6-8f9c-f1cb6a30c080"><wsu:Created>2013-09-26T22:59:09Z</wsu:Created><wsu:Expires>2013-09-26T23:04:09Z</wsu:Expires></wsu:Timestamp></wsse:Security></soap:Header><soap:Body><soap:Fault><faultcode>soap:Server</faultcode><faultstring>Unspecified_Error</faultstring><faultactor>https://www.docusign.net/api/3.0/DSAPI.asmx</faultactor><detail><ErrorCode xmlns="missing in Web.Config">1</ErrorCode><ErrorReason xmlns="missing in Web.Config">An Error Occurred.</ErrorReason></detail></soap:Fault></soap:Body></soap:Envelope>
namespace error : xmlns: 'missing in Web.Config' is not a valid URI
/api/3.0/DSAPI.asmx</faultactor><detail><ErrorCode xmlns="missing in Web.Config"
^
namespace error : xmlns: 'missing in Web.Config' is not a valid URI
="missing in Web.Config">1</ErrorCode><ErrorReason xmlns="missing in Web.Config"
^
2013-09-26 15:59:09.107 (iOS App Name)[89329:4003] DSAPIService_CreateAndSendEnvelope soap call failed:
************
Unspecified_Error
************
我仔细查看了文档中的服务,但我真的不确定自动锚标签是否适合API,如果适合的话。
我是否仍然添加标签,即使我尝试使用自动锚点选项卡,将我想要用作/ s1 / / s2 /等的所有字段都放在其中。我看不到任何其他问题呼叫失败的原因。
编辑:我现在看到无论自动锚定如何都需要添加标签。如何为签名,日期和标题添加选项卡自动锚点?
答案 0 :(得分:1)
首先,我建议您为文档指定 FileExtension 。 (正如我在下面提供的示例中所做的那样。)
其次,一定要将RoutingOrder设置为1(非零)。这可能是您获得错误的原因。
最后,以下SOAP XML示例使用文档中的锚文本来放置/指定选项卡,如下所示:
在第一个签名者的信封中放置标题标签 (RecipientId = 1)文本 \ t1 \ 出现的任何地方。
在 \ s2 \ 文字出现的任何地方的第二个签名者(RecipientId = 2)的信封中放置 SignHere 标签。
在信封中放置标题标签,其中第二个(RecipientId = 2)位于 \ t2 \ 文字的任何位置。
<ns:CreateAndSendEnvelope>
<ns:Envelope>
<ns:AccountId>my_account_id</ns:AccountId>
<ns:Documents>
<ns:Document>
<ns:ID>1</ns:ID>
<ns:Name>Simple NDA.pdf</ns:Name>
<ns:PDFBytes>bytes_removed</ns:PDFBytes>
<ns:FileExtension>pdf</ns:FileExtension>
<ns:AttachmentDescription>Simple NDA</ns:AttachmentDescription>
</ns:Document>
</ns:Documents>
<ns:Recipients>
<ns:Recipient>
<ns:ID>1</ns:ID>
<ns:UserName>Betty Adams</ns:UserName>
<ns:Email>BettyEmail@outlook.com</ns:Email>
<ns:Type>Signer</ns:Type>
<ns:RoutingOrder>1</ns:RoutingOrder>
</ns:Recipient>
<ns:Recipient>
<ns:ID>2</ns:ID>
<ns:UserName>John Jones</ns:UserName>
<ns:Email>JohnEmail1@outlook.com</ns:Email>
<ns:Type>Signer</ns:Type>
<ns:RoutingOrder>2</ns:RoutingOrder>
</ns:Recipient>
</ns:Recipients>
<ns:Tabs>
<ns:Tab>
<ns:RecipientID>1</ns:RecipientID>
<ns:AnchorTabItem>
<ns:AnchorTabString>\s1\</ns:AnchorTabString>
<ns:XOffset>-7</ns:XOffset>
<ns:YOffset>12</ns:YOffset>
<ns:Unit>Pixels</ns:Unit>
</ns:AnchorTabItem>
<ns:Type>SignHere</ns:Type>
</ns:Tab>
<ns:Tab>
<ns:RecipientID>1</ns:RecipientID>
<ns:AnchorTabItem>
<ns:AnchorTabString>\d1\</ns:AnchorTabString>
</ns:AnchorTabItem>
<ns:Type>DateSigned</ns:Type>
</ns:Tab>
<ns:Tab>
<ns:RecipientID>1</ns:RecipientID>
<ns:AnchorTabItem>
<ns:AnchorTabString>\t1\</ns:AnchorTabString>
</ns:AnchorTabItem>
<ns:Type>Title</ns:Type>
</ns:Tab>
<ns:Tab>
<ns:RecipientID>2</ns:RecipientID>
<ns:AnchorTabItem>
<ns:AnchorTabString>\s2\</ns:AnchorTabString>
</ns:AnchorTabItem>
<ns:Type>SignHere</ns:Type>
</ns:Tab>
<ns:Tab>
<ns:RecipientID>2</ns:RecipientID>
<ns:AnchorTabItem>
<ns:AnchorTabString>\d2\</ns:AnchorTabString>
</ns:AnchorTabItem>
<ns:Type>DateSigned</ns:Type>
</ns:Tab>
<ns:Tab>
<ns:RecipientID>2</ns:RecipientID>
<ns:AnchorTabItem>
<ns:AnchorTabString>\t2\</ns:AnchorTabString>
</ns:AnchorTabItem>
<ns:Type>Title</ns:Type>
</ns:Tab>
</ns:Tabs>
<ns:Subject>Please DocuSign this document</ns:Subject>
<ns:EmailBlurb>Please sign this document using DocuSign...thanks!</ns:EmailBlurb>
</ns:Envelope>
</ns:CreateAndSendEnvelope>
使用锚文本指定的每个标签至少必须包含以下元素:
<ns:Tab>
<ns:RecipientID>2</ns:RecipientID>
<ns:AnchorTabItem>
<ns:AnchorTabString>\t2\</ns:AnchorTabString>
</ns:AnchorTabItem>
<ns:Type>Title</ns:Type>
</ns:Tab>
您可以选择使用 XOffset , YOffset 和,指定相对于锚文本字符串位置更精确的标记放置所需的偏移量度量单元元素作为代码示例为第一个签名者的签名选项卡执行:
<ns:Tab>
<ns:RecipientID>1</ns:RecipientID>
<ns:AnchorTabItem>
<ns:AnchorTabString>\s1\</ns:AnchorTabString>
<ns:XOffset>-7</ns:XOffset>
<ns:YOffset>12</ns:YOffset>
<ns:Unit>Pixels</ns:Unit>
</ns:AnchorTabItem>
<ns:Type>SignHere</ns:Type>
</ns:Tab>
答案 1 :(得分:0)
查看DocuSign的开发人员中心,因为您的问题都在那里得到了解答:
http://www.docusign.com/developer-center
如果你去探索 - &gt;然后功能查看Stick-eTabs页面,您将看到标题为标签定位的部分,其中描述了锚点标记。为了回答您的问题,DocuSign中的每个选项卡都可以选择使用绝对定位或相对定位。如果您正在设置选项卡的XPosition和YPosition,那么您正在使用绝对定位。另一方面,如果您正在使用锚点标记,那么您正在使用相对定位 - 在这种情况下,您将需要使用选项卡的锚点设置。在REST中它看起来像这样(我确信你可以很容易地采用SOAP):
"tabs": {
"signHereTabs": [
{
"anchorString": "Please Sign Here:",
"anchorXOffset": "1",
"anchorYOffset": "0",
"anchorIgnoreIfNotPresent": "false",
"anchorUnits": "inches"
}
]
}
基本上,在SOAP代码中的选项卡元素中,您只需要设置anchorString(选项卡将锚定到哪个文档内容),偏移量(如果有)和偏移量的单位等。上面的示例将将签名标签 1英寸放置在文档中找到“请在此处签名”文本的右侧。
就您收到的未指明错误而言,我感觉这是由于您的路由订单。我不认为0是允许作为路由顺序,尝试在1处启动它们。