Ajouter un participant au modèle — un nouveau contact
Faire signer, en plus des participants du modèle, une personne qui n'est pas encore un contact.
La requête de création ne fait que remplacer ce que le modèle porte : un identifiant convivial qu'il n'a pas — « Commercial » — y est ignoré, sans erreur, et le parcours partirait sans lui. Un participant de plus s'ajoute donc au brouillon, avant l'envoi.
1Créer le parcours en brouillon
curl -X POST "https://staging-api.docage.com/Transactions/CreateFullTransaction?launchTransaction=false" \
-H "Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9…" \
-F "TemplateId=aaaaaaaa-0000-4000-8000-000000000001" \
-F "Client=00000000-0000-4000-8000-000000000201"Relevez l'Id du parcours et celui du document à signer (TransactionFiles[].Id).
2Créer le contact
POST https://staging-api.docage.com/Contacts
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9…
Content-Type: application/json
{ "FirstName": "Hugo", "LastName": "Lefèvre", "Email": "hugo.lefevre@example.com", "Mobile": "+33600000003", "Country": "FR" }curl -X POST "https://staging-api.docage.com/Contacts" \
-H "Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9…" \
-H "Content-Type: application/json" \
-d '{
"FirstName": "Hugo",
"LastName": "Lefèvre",
"Email": "hugo.lefevre@example.com",
"Mobile": "+33600000003",
"Country": "FR"
}'using HttpClient client = new();
using HttpRequestMessage request = new(HttpMethod.Post, "https://staging-api.docage.com/Contacts");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", token);
request.Content = new StringContent("""
{
"FirstName": "Hugo",
"LastName": "Lefèvre",
"Email": "hugo.lefevre@example.com",
"Mobile": "+33600000003",
"Country": "FR"
}
""", Encoding.UTF8, "application/json");
using HttpResponseMessage response = await client.SendAsync(request);
string result = await response.Content.ReadAsStringAsync();
if (!response.IsSuccessStatusCode)
throw new HttpRequestException(result);const response = await fetch("https://staging-api.docage.com/Contacts", {
method: "POST",
headers: {
Authorization: `Bearer ${token}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"FirstName": "Hugo",
"LastName": "Lefèvre",
"Email": "hugo.lefevre@example.com",
"Mobile": "+33600000003",
"Country": "FR"
})
});
const text = await response.text();
if (!response.ok) throw new Error(text);
const result = text ? JSON.parse(text) : null;La réponse est l'identifiant du contact. Voir Créer un contact, une société et une carte pour éviter un doublon.
3L'ajouter au parcours
POST https://staging-api.docage.com/TransactionMembers
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9…
Content-Type: application/json
{
"TransactionId": "cccccccc-0000-4000-8000-000000000003",
"FriendlyName": "Commercial",
"ContactId": "00000000-0000-4000-8000-000000000203",
"LastName": "Lefèvre",
"MemberRole": 0,
"SignMode": 1
}curl -X POST "https://staging-api.docage.com/TransactionMembers" \
-H "Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9…" \
-H "Content-Type: application/json" \
-d '{
"TransactionId": "cccccccc-0000-4000-8000-000000000003",
"FriendlyName": "Commercial",
"ContactId": "00000000-0000-4000-8000-000000000203",
"LastName": "Lefèvre",
"MemberRole": 0,
"SignMode": 1
}'using HttpClient client = new();
using HttpRequestMessage request = new(HttpMethod.Post, "https://staging-api.docage.com/TransactionMembers");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", token);
request.Content = new StringContent("""
{
"TransactionId": "cccccccc-0000-4000-8000-000000000003",
"FriendlyName": "Commercial",
"ContactId": "00000000-0000-4000-8000-000000000203",
"LastName": "Lefèvre",
"MemberRole": 0,
"SignMode": 1
}
""", Encoding.UTF8, "application/json");
using HttpResponseMessage response = await client.SendAsync(request);
string result = await response.Content.ReadAsStringAsync();
if (!response.IsSuccessStatusCode)
throw new HttpRequestException(result);const response = await fetch("https://staging-api.docage.com/TransactionMembers", {
method: "POST",
headers: {
Authorization: `Bearer ${token}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"TransactionId": "cccccccc-0000-4000-8000-000000000003",
"FriendlyName": "Commercial",
"ContactId": "00000000-0000-4000-8000-000000000203",
"LastName": "Lefèvre",
"MemberRole": 0,
"SignMode": 1
})
});
const text = await response.text();
if (!response.ok) throw new Error(text);
const result = text ? JSON.parse(text) : null;MemberRole0fait du participant un signataire (1un validateur) : sans lui, il n'aurait aucune action.LastNameest obligatoire, même avecContactId; les coordonnées viennent ensuite de la fiche du contact.SignMode:1code par email,0code par SMS (d'office).
La réponse est l'identifiant du participant.
4Poser son emplacement de signature
POST https://staging-api.docage.com/TransactionFields
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9…
Content-Type: application/json
{
"TransactionMemberId": "dddddddd-0000-4000-8000-000000000014",
"TransactionFileId": "eeeeeeee-0000-4000-8000-000000000005",
"Pages": "-1",
"Coordinates": "60,90,180,100"
}curl -X POST "https://staging-api.docage.com/TransactionFields" \
-H "Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9…" \
-H "Content-Type: application/json" \
-d '{
"TransactionMemberId": "dddddddd-0000-4000-8000-000000000014",
"TransactionFileId": "eeeeeeee-0000-4000-8000-000000000005",
"Pages": "-1",
"Coordinates": "60,90,180,100"
}'using HttpClient client = new();
using HttpRequestMessage request = new(HttpMethod.Post, "https://staging-api.docage.com/TransactionFields");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", token);
request.Content = new StringContent("""
{
"TransactionMemberId": "dddddddd-0000-4000-8000-000000000014",
"TransactionFileId": "eeeeeeee-0000-4000-8000-000000000005",
"Pages": "-1",
"Coordinates": "60,90,180,100"
}
""", Encoding.UTF8, "application/json");
using HttpResponseMessage response = await client.SendAsync(request);
string result = await response.Content.ReadAsStringAsync();
if (!response.IsSuccessStatusCode)
throw new HttpRequestException(result);const response = await fetch("https://staging-api.docage.com/TransactionFields", {
method: "POST",
headers: {
Authorization: `Bearer ${token}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"TransactionMemberId": "dddddddd-0000-4000-8000-000000000014",
"TransactionFileId": "eeeeeeee-0000-4000-8000-000000000005",
"Pages": "-1",
"Coordinates": "60,90,180,100"
})
});
const text = await response.text();
if (!response.ok) throw new Error(text);
const result = text ? JSON.parse(text) : null;Facultatif : sans emplacement, sa signature est valide mais sans encart visible. Voir Poser une signature visuelle.
5Lancer le parcours
POST https://staging-api.docage.com/Transactions/LaunchTransaction/cccccccc-0000-4000-8000-000000000003
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9…curl -X POST "https://staging-api.docage.com/Transactions/LaunchTransaction/cccccccc-0000-4000-8000-000000000003" \
-H "Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9…"using HttpClient client = new();
using HttpRequestMessage request = new(HttpMethod.Post, "https://staging-api.docage.com/Transactions/LaunchTransaction/cccccccc-0000-4000-8000-000000000003");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", token);
using HttpResponseMessage response = await client.SendAsync(request);
string result = await response.Content.ReadAsStringAsync();
if (!response.IsSuccessStatusCode)
throw new HttpRequestException(result);const response = await fetch("https://staging-api.docage.com/Transactions/LaunchTransaction/cccccccc-0000-4000-8000-000000000003", {
method: "POST",
headers: {
Authorization: `Bearer ${token}`
}
});
const text = await response.text();
if (!response.ok) throw new Error(text);
const result = text ? JSON.parse(text) : null;Les pièges
- Le nouveau participant signe à son tour selon le déroulement du modèle. Si le modèle fait agir ses participants dans un ordre
(
OrderModeà1), donnez-lui sa position parOrder. - Un signataire signe tous les documents à signer du parcours.
- La même démarche, avec un contact déjà enregistré : Ajouter un participant au modèle — un contact existant.