# DOCAPOSTESEND

## Overview

The **DOCAPOSTESEND** workflow application lets you send one or more documents to Docaposte for electronic signature.

## How it works

* The DOCAPOSTESEND application creates a single envelope and sends it to one or more signers.<br>
* You can specify one or more files per DOCAPOSTESEND action. To do this, use the `FILEx` parameter, where x is the file number (e.g.: `FILE1`). At least one file is required.<br>
* You can specify one or more signers. To do this, use the combination of `SIGNER_FIRSTNAME_LIST`, `SIGNER_LASTNAME_LIST`, and `SIGNER_EMAIL_LIST`. You can also use `SIGNER_FIRSTNAMEx`, `SIGNER_LASTNAMEx`, and `SIGNER_EMAILx`, where `x` is the number of the signer.<br>
* You can specify one type of signature per recipient. To do this, depending on the method you use to specify signers (with or without `_LIST`), you can use `SIGNATURE_TYPE_LIST` or `SIGNATURE_TYPEx`, where `x` is the signer number. Possible values: `OTP` (default), `PAD`, `TOKEN`, `CONSENT_PROOF` or `IDENTITY`.<br>
* Application logs are available. These can be specified by setting the value of the `DocaposteSendLogLevel` parameter in the `web.config` file to `0` to disable logging, `1` for error logs, `2` for information logs, or `3` for debug logs; The default value is `0`.

## Required parameters

You can use one of the following two configurations: with a list of signers or with signer numbers.

### With a list of signers

<table data-header-hidden><thead><tr><th valign="top">Parameter</th><th valign="top">Type</th><th valign="top">Direction</th><th valign="top">Description</th></tr></thead><tbody><tr><td valign="top"><strong>Parameter</strong></td><td valign="top"><strong>Type</strong></td><td valign="top"><strong>Direction</strong></td><td valign="top"><strong>Description</strong></td></tr><tr><td valign="top"><code>SIGNER_FIRSTNAME_LIST</code></td><td valign="top">TEXT</td><td valign="top">IN</td><td valign="top">First names of signers, separated by the value defined in the <code>DATA_SEPARATOR</code> parameter</td></tr><tr><td valign="top"><code>SIGNER_LASTNAME_LIST</code></td><td valign="top">TEXT</td><td valign="top">IN</td><td valign="top">Last names of signers, separated by the value defined in the <code>DATA_SEPARATOR</code> parameter</td></tr><tr><td valign="top"><code>SIGNER_EMAIL_LIST</code></td><td valign="top">TEXT</td><td valign="top">IN</td><td valign="top">Email addresses of the signers, separated by the value defined in the <code>DATA_SEPARATOR</code> parameter</td></tr><tr><td valign="top"><code>FILEx</code></td><td valign="top">FILE</td><td valign="top">IN</td><td valign="top">File(s) to send, where <code>x</code> is the file number; you can add one or more files</td></tr></tbody></table>

### With signer numbers

<table data-header-hidden><thead><tr><th valign="top">Parameter</th><th valign="top">Type</th><th valign="top">Direction</th><th valign="top">Description</th></tr></thead><tbody><tr><td valign="top"><strong>Parameter</strong></td><td valign="top"><strong>Type</strong></td><td valign="top"><strong>Direction</strong></td><td valign="top"><strong>Description</strong></td></tr><tr><td valign="top"><code>SIGNER_FIRSTNAMEx</code></td><td valign="top">TEXT</td><td valign="top">IN</td><td valign="top">First name(s) of the signer(s), where <code>x</code> corresponds to the signer number; you can add one or more signers</td></tr><tr><td valign="top"><code>SIGNER_LASTNAMEx</code></td><td valign="top">TEXT</td><td valign="top">IN</td><td valign="top">Last name(s) of the signer(s), where <code>x</code> corresponds to the signer number; you can add one or more signers</td></tr><tr><td valign="top"><code>SIGNER_EMAILx</code></td><td valign="top">TEXT</td><td valign="top">IN</td><td valign="top">Email address(es) of the signer(s), where <code>x</code> is the signer's number; you can add one or more signers</td></tr><tr><td valign="top"><code>FILEx</code></td><td valign="top">FILE</td><td valign="top">IN</td><td valign="top">File(s) to send, where <code>x</code> is the file number; you can add one or more files</td></tr></tbody></table>

## Optional parameters

### Docaposte configuration

<table data-header-hidden><thead><tr><th valign="top">Parameters</th><th valign="top">Type</th><th valign="top">Direction</th><th valign="top">Description</th></tr></thead><tbody><tr><td valign="top"><strong>Parameters</strong></td><td valign="top"><strong>Type</strong></td><td valign="top"><strong>Direction</strong></td><td valign="top"><strong>Description</strong></td></tr><tr><td valign="top"><code>DOCAPOSTE_USERNAME</code></td><td valign="top">TEXT</td><td valign="top">IN</td><td valign="top">Docaposte username<br><br>By default, this value comes from the <code>DocaposteUsername</code> parameter in the <code>web.config</code> file.</td></tr><tr><td valign="top"><code>DOCAPOSTE_PASSWORD</code></td><td valign="top">TEXT</td><td valign="top">IN</td><td valign="top">Docaposte password<br><br>By default, this value comes from the <code>DocapostePassword</code> parameter in the <code>web.config</code> file.</td></tr><tr><td valign="top"><code>DOCAPOSTE_HOST_SERVER</code></td><td valign="top">TEXT</td><td valign="top">IN</td><td valign="top"><p>Docaposte host server</p><p></p><p>By default, this value comes from the <code>DocaposteHostServer</code> parameter in the <code>web.config</code> file.</p></td></tr><tr><td valign="top"><code>DOCAPOSTE_OFFER_CODE</code></td><td valign="top">TEXT</td><td valign="top">IN</td><td valign="top"><p>Docaposte offer code<br></p><p>By default, this value comes from the <code>DocaposteOfferCode</code> parameter in the <code>web.config</code> file.</p></td></tr><tr><td valign="top"><code>DOCAPOSTE_ORGANIZATIONAL_UNIT_CODE</code></td><td valign="top">TEXT</td><td valign="top">IN</td><td valign="top"><p>Docaposte organizational unit code</p><p></p><p>By default, this value comes from the <code>DocaposteOrganizationalUnitCode</code> parameter in the <code>web.config</code> file.</p></td></tr></tbody></table>

### General

<table data-header-hidden><thead><tr><th valign="top">Parameters</th><th valign="top">Type</th><th valign="top">Direction</th><th valign="top">Description</th></tr></thead><tbody><tr><td valign="top"><strong>Parameters</strong></td><td valign="top"><strong>Type</strong></td><td valign="top"><strong>Direction</strong></td><td valign="top"><strong>Description</strong></td></tr><tr><td valign="top"><code>DATA_SEPARATOR</code></td><td valign="top">TEXT</td><td valign="top">IN</td><td valign="top">Separator used to separate the contents of <code>SIGNERS_FIRSTNAME_LIST</code>,<code>SIGNERS_LASTNAME_LIST</code>, <code>SIGNERS_EMAIL_LIST</code>, and <code>SIGNER_TYPE_LIST</code><br><strong>Default :</strong> <code>,</code> (comma)</td></tr><tr><td valign="top"><code>SIGNER_TYPE_LIST</code></td><td valign="top">TEXT</td><td valign="top">IN</td><td valign="top"><p>Signature type of signers, separated by the value defined in the <code>DATA_SEPARATOR</code> parameter<br><br><strong>Possible values:</strong></p><ul><li><code>OTP</code>(default)</li><li><code>PAD</code></li><li><code>TOKEN</code></li><li><code>CONSENT_PROOF</code></li><li><code>IDENTITY</code></li></ul></td></tr><tr><td valign="top"><code>SIGNER_TYPEX</code></td><td valign="top">TEXT</td><td valign="top">IN</td><td valign="top"><p>Signature type of signer(s), where <code>x</code> corresponds to the signer number; you can add one or more signers</p><p></p><p><strong>Possible values:</strong></p><ul><li><code>OTP</code>(default)</li><li><code>PAD</code></li><li><code>TOKEN</code></li><li><code>CONSENT_PROOF</code></li><li><code>IDENTITY</code></li></ul></td></tr><tr><td valign="top"><code>CUSTOM_REFERENCE</code></td><td valign="top">TEXT</td><td valign="top">IN</td><td valign="top"><p>Provider reference</p><p></p><p>The content of this parameter can allow the provider to identify the transaction on its end with; for example, a value specific to its business domain (e.g. customer file number).<br><strong>Default:</strong><code>WorkflowGen</code></p></td></tr><tr><td valign="top"><code>TEST_MODE</code></td><td valign="top">TEXT</td><td valign="top">IN</td><td valign="top"><p>Indicates whether the transaction is a TEST transaction (<code>Y</code> or <code>N</code>)</p><p><strong>Default:</strong> <code>N</code></p></td></tr><tr><td valign="top"><code>EMAIL_SUBJECT</code></td><td valign="top">TEXT</td><td valign="top">IN</td><td valign="top"><p>Subject of the email that will be sent to signers</p><p><strong>Default:</strong> <code>Please sign the document sent from WorkflowGen</code></p></td></tr><tr><td valign="top"><code>EMAIL_FROM</code></td><td valign="top">TEXT</td><td valign="top">IN</td><td valign="top"><p>Domain name of the email address that will be used to send the email to signers</p><p><strong>Default :</strong> <code>do-not-reply</code></p></td></tr><tr><td valign="top"><code>EMAIL_BODY</code></td><td valign="top">FILE</td><td valign="top">IN</td><td valign="top">Content of the email to send to signers (see the <a href="#customizing-the-body-of-the-email">Customizing the body of the email</a> section)</td></tr></tbody></table>

### Return parameters

<table data-header-hidden><thead><tr><th valign="top">Parameter</th><th valign="top">Type</th><th valign="top">Direction</th><th valign="top">Description</th></tr></thead><tbody><tr><td valign="top"><strong>Parameter</strong></td><td valign="top"><strong>Type</strong></td><td valign="top"><strong>Direction</strong></td><td valign="top"><strong>Description</strong></td></tr><tr><td valign="top"><code>DOCAPOSTE_TRANSACTION_ID</code>`</td><td valign="top">TEXT</td><td valign="top">OUT</td><td valign="top">Contains the Docaposte transaction ID; you can use this ID in the <a href="docapostecheck-workflow-application">DOCAPOSTCHECK</a> workflow application</td></tr><tr><td valign="top"><code>DOCAPOSTE_DOCUMENT_NAMES</code></td><td valign="top">TEXT</td><td valign="top">OUT</td><td valign="top">Contains the names of the documents sent to Docaposte; you can use these values in the <a href="docapostecheck-workflow-application">DOCAPOSTECHECK</a> workflow application</td></tr></tbody></table>

### Customizing the body of the email

You can customize the content of the body of the email to be sent to the signer. The template must contain the `<DOCAPOSTE_SIGN_URL>` tag, which will be replaced by the link allowing the signer to add their signature.

**Default value:**

```markup
<!DOCTYPE html>
<html lang=""en"" xmlns=""http://www.w3.org/1999/xhtml"">
<head>
    <meta charset=""utf-8"" />
</head>
<body>
    <p>Hello {firstname} {lastname},</p>
    <p>
        Please sign the document sent from WorkflowGen.
        <br />
        <a href=""<DOCAPOSTE_SIGN_URL>"">Click here to sign on Docaposte</a>
    </p>
    <p>Regards,</p>
    <p>WorkflowGen</p>
</body>
</html>
```

## Examples

### With a list of signers

<table data-header-hidden><thead><tr><th valign="top">Parameter</th><th valign="top">Type</th><th valign="top">Direction</th><th valign="top">Value</th></tr></thead><tbody><tr><td valign="top"><strong>Parameter</strong></td><td valign="top"><strong>Type</strong></td><td valign="top"><strong>Direction</strong></td><td valign="top"><strong>Value</strong></td></tr><tr><td valign="top"><code>SIGNER_FIRSTNAME_LIST</code></td><td valign="top">TEXT</td><td valign="top">IN</td><td valign="top"><code>John,Bernard</code></td></tr><tr><td valign="top"><code>SIGNER_LASTNAME_LIST</code></td><td valign="top">TEXT</td><td valign="top">IN</td><td valign="top"><code>Smith,Martin</code></td></tr><tr><td valign="top"><code>SIGNER_EMAIL_LIST</code></td><td valign="top">TEXT</td><td valign="top">IN</td><td valign="top"><code>john.smith@email.com,bernard.martin@email.com</code></td></tr><tr><td valign="top"><code>SIGNER_TYPE_LIST</code></td><td valign="top">TEXT</td><td valign="top">IN</td><td valign="top"><code>PAD,OTP</code></td></tr><tr><td valign="top"><code>FILE1</code></td><td valign="top">FILE</td><td valign="top">IN</td><td valign="top"><code>contract.pdf</code></td></tr><tr><td valign="top"><code>DOCAPOSTE_TRANSACTION_ID</code></td><td valign="top">TEXT</td><td valign="top">OUT</td><td valign="top"><code>xxxxx-xxxxx-xxxxx-xxxxx</code></td></tr><tr><td valign="top"><code>DOCAPOSTE_DOCUMENT_NAMES</code></td><td valign="top">TEXT</td><td valign="top">OUT</td><td valign="top"><code>contract.pdf</code></td></tr></tbody></table>

### With signer numbers

<table data-header-hidden><thead><tr><th valign="top">Parameter</th><th valign="top">Type</th><th valign="top">Direction</th><th valign="top">Value</th></tr></thead><tbody><tr><td valign="top"><strong>Parameter</strong></td><td valign="top"><strong>Type</strong></td><td valign="top"><strong>Direction</strong></td><td valign="top"><strong>Value</strong></td></tr><tr><td valign="top"><code>SIGNER_LASTNAME1</code></td><td valign="top">TEXT</td><td valign="top">IN</td><td valign="top"><code>Smith</code></td></tr><tr><td valign="top"><code>SIGNER_LASTNAME2</code></td><td valign="top">TEXT</td><td valign="top">IN</td><td valign="top"><code>Martin</code></td></tr><tr><td valign="top"><code>SIGNER_FIRSTNAME1</code></td><td valign="top">TEXT</td><td valign="top">IN</td><td valign="top"><code>John</code></td></tr><tr><td valign="top"><code>SIGNER_FIRSTNAME1</code></td><td valign="top">TEXT</td><td valign="top">IN</td><td valign="top"><code>Bernard</code></td></tr><tr><td valign="top"><code>SIGNER_EMAIL1</code></td><td valign="top">TEXT</td><td valign="top">IN</td><td valign="top"><code>john.smith@email.com</code></td></tr><tr><td valign="top"><code>SIGNER_EMAIL2</code></td><td valign="top">TEXT</td><td valign="top">IN</td><td valign="top"><code>bernard.martin@email.com</code></td></tr><tr><td valign="top"><code>SIGNER_TYPE1</code></td><td valign="top">TEXT</td><td valign="top">IN</td><td valign="top"><code>PAD</code></td></tr><tr><td valign="top"><code>SIGNER_TYPE2</code></td><td valign="top">TEXT</td><td valign="top">IN</td><td valign="top"><code>TOKEN</code></td></tr><tr><td valign="top"><code>FILE1</code></td><td valign="top">FILE</td><td valign="top">IN</td><td valign="top"><code>contract.pdf</code></td></tr><tr><td valign="top"><code>DOCAPOSTE_TRANSACTION_ID</code></td><td valign="top">TEXT</td><td valign="top">OUT</td><td valign="top"><code>xxxxx-xxxxx-xxxxx-xxxxx</code></td></tr><tr><td valign="top"><code>DOCAPOSTE_DOCUMENT_NAMES</code></td><td valign="top">TEXT</td><td valign="top">OUT</td><td valign="top"><code>contract.pdf</code></td></tr></tbody></table>
