Ajouter un participant au modèle — un contact existant
Faire signer, en plus des participants du modèle, un contact ou un utilisateur déjà enregistré.
Comme pour un nouveau contact, un participant que le modèle n'a pas ne s'ajoute pas dans la requête de création — un identifiant convivial inconnu y est ignoré, sans erreur — mais 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).
2Ajouter le participant
Un contact, par ContactId :
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;Un utilisateur de votre organisation — un collègue qui contresigne —, par DocageUserId à la place de ContactId.
MemberRole0fait du participant un signataire (1un validateur) ; sans lui, il n'aurait aucune action.LastNameest obligatoire, même avec un identifiant ; le reste des coordonnées vient de la fiche.
Les refus : 404 si le parcours, le contact ou l'utilisateur est introuvable, ou si vous ne le voyez pas ; 403 si vous voyez le
parcours sans avoir le droit de le modifier ; 409 si le parcours est déjà lancé.
3Poser son emplacement de signature, puis lancer
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;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
- Si le modèle fait agir ses participants dans un ordre (
OrderModeà1), donnez au nouveau sa position parOrder. - Le participant doit avoir un email, un prénom et un nom, et un mobile si son code part par SMS : sinon l'envoi est refusé.