NibblyPig
NibblyPig

Reputation: 52942

With adobe echosign, can a library document be used as a template?

According to the Create Library Document section of their API:

createLibraryDocument is used to create a document in a user's document library. The library can be used to send the same document for signature multiple times, either through the web application or through the API.

It doesn't make it clear whether you can put something like %ProductName% in the document and find/replace it when distributing, or whether you have to upload a brand new document each time. I'm planning on using the API to send out identical agreements but with different product and company names on them.

Any idea if this is possible?

Upvotes: 4

Views: 2403

Answers (1)

Marek Kowalski
Marek Kowalski

Reputation: 1792

The question is rather old, so I'm adding this for future reference.

I was dealing with the same problem and I found a solution. Or rather a hack. Instead of createLibraryDocument I'm using sendDocument directly. It has a mergeFieldsInfo property, which according to documentation cannot be used with library documents, but would work if you pass url of file. I tried the option with the url, and it works, I have the fields prefilled in the test document.

The example request body which have worked for me:

<?xml version="1.0"?>
<sendDocument>
  <apiKey>XXXXX</apiKey>
  <senderInfo nil="true"/>
  <documentCreationInfo>
    <fileInfos>
      <FileInfo>
        <fileName>Merchant Agreement.pdf</fileName>
        <url>https://my.public.host.com/GetFinancing%20Merchant.pdf</url>
      </FileInfo>
    </fileInfos>
    <mergeFieldInfo>
      <mergeFields>
        <MergeField>
          <defaultValue>test</defaultValue>
          <fieldName>companyName</fieldName>
        </MergeField>
        <MergeField>
          <defaultValue>test</defaultValue>
          <fieldName>companyAddress</fieldName>
        </MergeField>
        <MergeField>
          <defaultValue>0123456789</defaultValue>
          <fieldName>companyPhone</fieldName>
        </MergeField>
      </mergeFields>
    </mergeFieldInfo>
    <name>Merchant Agreement</name>
    <recipients>
      <RecipientInfo>
        <email>[email protected]</email>
        <role>SIGNER</role>
      </RecipientInfo>
    </recipients>
    <reminderFrequency>NEVER</reminderFrequency>
    <signatureFlow>SENDER_SIGNATURE_NOT_REQUIRED</signatureFlow>
    <signatureType>ESIGN</signatureType>
  </documentCreationInfo>
</sendDocument>

Upvotes: 3

Related Questions