1

I'm having some trouble getting the DocuSign API understood properly.

My first task is to simply send and create an envelope. I created a PDF (in iOS) using a UIView and Core Graphics. I then went ahead and put Anchor tabs in the sections where I need signatures.

Due to creating Anchor tabs, I am not sure if I should send my tabs as a part of the output.

Here is my output body

<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>

Here is my response

<?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
 ************

I looked through the Documentation for the service quite thoroughly but I am really unsure how automatic anchor tabs fit in, if they fit in, to the API.

Do I still add tabs even though I am attempting to use the automatic Anchor tabs by putting all my fields that I want to use as /s1/ /s2/, etc. I can't see anything else being the issue on why the call failed.

Edit: I now see I need to add tabs regardless of automatic anchoring. How would I add the tabs automatic anchors for signatures, dates, and title?

Keyd
  • 163
  • 1
  • 7

2 Answers2

1

First, I'd recommend that you specify the FileExtension for the Document. (As I've done in the example provided below.)

Second, definitely start RoutingOrder at 1 (not zero). This is likely the cause of the error you're getting.

Finally, the following SOAP XML example uses anchor text within the document to place/specify tabs as follows:

  • Place SignHere tab in the envelope for the first signer (RecipientId=1) anywhere that the text \s1\ appears.
  • Place DateSigned tab in the envelope for the first signer (RecipientId=1) anywhere that the text \d1\ appears.
  • Place Title tab in the envelope for the first signer (RecipientId=1) anywhere that the text \t1\ appears.

  • Place SignHere tab in the envelope for the second signer (RecipientId=2) anywhere that the text \s2\ appears.

  • Place DateSigned tab in the envelope for the second signer (RecipientId=2) anywhere that the text \d2\ appears.
  • Place Title tab in the envelope for the second (RecipientId=2) anywhere that the text \t2\ appears.

        <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>
    

At a minimum, each tab specified using anchor text must contain the following elements:

                <ns:Tab>
                    <ns:RecipientID>2</ns:RecipientID>
                    <ns:AnchorTabItem>
                        <ns:AnchorTabString>\t2\</ns:AnchorTabString>
                    </ns:AnchorTabItem>
                    <ns:Type>Title</ns:Type>
                </ns:Tab>

Optionally, you can specify offset measurements if necessary for more precise tag placement relative to the anchor text string location, by using the XOffset, YOffset, and Unit elements as the code sample does for the first signer's signature tab:

                <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>
Kim Brandl
  • 13,125
  • 2
  • 16
  • 21
0

Check out DocuSign's Developer Center as your questions are all answered through there:

http://www.docusign.com/developer-center

If you go to Explore -> Features then have a look at the Stick-eTabs page, you'll see a section titled Tab Positioning which describes Anchor Tagging. To answer your question, every tab in DocuSign has the option of using absolute positioning or relative positioning. If you are setting a tab's XPosition and YPosition then you are using absolute positioning. On the other hand, if you are using Anchor Tagging then you are using relative positioning - in this case, you'll want to use a tab's anchor settings. In REST it looks like this (I'm sure you can easily adopt for SOAP):

"tabs": {
  "signHereTabs": [
    {
    "anchorString": "Please Sign Here:",
    "anchorXOffset": "1",
    "anchorYOffset": "0",
    "anchorIgnoreIfNotPresent": "false",
    "anchorUnits": "inches"
    }
  ]
}

Basically, in your tab elements in your SOAP code you just need to set the anchorString (what document content that tab will anchor to), the offsets (if any), and the units for offset, etc. The above example would place a signature tab 1 inch to the right of wherever it finds the text "Please Sign Here" in the document.


In terms of the unspecified error you are receiving, I have a feeling it's due to your routingOrder. I don't believe 0 is allowed as a routing order, try starting them at 1 instead.

Ergin
  • 9,254
  • 1
  • 19
  • 28