Ajouter un participant
Ajouter à un parcours en brouillon un participant qui signe ou valide, ou un observateur qui suit son avancement.
POST https://staging-api.docage.com/TransactionMembers
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9…
Content-Type: application/json
{
"TransactionId": "cccccccc-0000-4000-8000-000000000003",
"FriendlyName": "Client",
"ContactId": "00000000-0000-4000-8000-000000000201",
"LastName": "Martin",
"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": "Client",
"ContactId": "00000000-0000-4000-8000-000000000201",
"LastName": "Martin",
"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": "Client",
"ContactId": "00000000-0000-4000-8000-000000000201",
"LastName": "Martin",
"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": "Client",
"ContactId": "00000000-0000-4000-8000-000000000201",
"LastName": "Martin",
"MemberRole": 0,
"SignMode": 1
})
});
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 participant, en chaîne JSON.
Le corps
| Propriété | Valeur |
|---|---|
TransactionId |
Le parcours, en brouillon. |
FriendlyName |
Son identifiant convivial — sans espace : ils sont retirés. |
ContactId ou DocageUserId |
La personne : un contact, ou un utilisateur de Docage. Ses coordonnées viennent de sa fiche. |
LastName |
Obligatoire, même avec un identifiant — la fiche le remplace ensuite. |
MemberRole |
Ce qu'il fait : 0 il signe, 1 il valide, 2 il observe. |
SignMode |
Le code de signature : 0 par SMS (d'office), 1 par email. |
SignatureLevel |
1 signature avancée (d'office), 3 avancée avec certificat qualifié, 2 qualifiée. |
Order |
Sa position, quand le parcours fait agir ses participants dans un ordre (OrderMode à 1). |
Ses actions
MemberRole donne au participant son action : une signature (0) ou une validation (1). Sans MemberRole, il n'a
aucune action. Les actions se déclarent aussi une à une, pour un participant ajouté sans rôle :
POST https://staging-api.docage.com/TransactionActions
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9…
Content-Type: application/json
{ "TransactionId": "cccccccc-0000-4000-8000-000000000003", "TransactionMemberId": "dddddddd-0000-4000-8000-000000000004", "Type": 3 }curl -X POST "https://staging-api.docage.com/TransactionActions" \
-H "Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9…" \
-H "Content-Type: application/json" \
-d '{
"TransactionId": "cccccccc-0000-4000-8000-000000000003",
"TransactionMemberId": "dddddddd-0000-4000-8000-000000000004",
"Type": 3
}'using HttpClient client = new();
using HttpRequestMessage request = new(HttpMethod.Post, "https://staging-api.docage.com/TransactionActions");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", token);
request.Content = new StringContent("""
{
"TransactionId": "cccccccc-0000-4000-8000-000000000003",
"TransactionMemberId": "dddddddd-0000-4000-8000-000000000004",
"Type": 3
}
""", 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/TransactionActions", {
method: "POST",
headers: {
Authorization: `Bearer ${token}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"TransactionId": "cccccccc-0000-4000-8000-000000000003",
"TransactionMemberId": "dddddddd-0000-4000-8000-000000000004",
"Type": 3
})
});
const text = await response.text();
if (!response.ok) throw new Error(text);
const result = text ? JSON.parse(text) : null;Type : 0 formulaire, 1 remplissage de document, 2 validation, 3 signature, 4 paiement, 5 vérification d'identité.
Un observateur
Un observateur ne fait rien : il est prévenu de l'avancement du parcours.
POST https://staging-api.docage.com/TransactionObservers
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9…
Content-Type: application/json
{
"TransactionId": "cccccccc-0000-4000-8000-000000000003",
"FriendlyName": "Comptable",
"PersonType": 1,
"ContactId": "00000000-0000-4000-8000-000000000204",
"LastName": "Bernard",
"NotifyTransactionCompletionByMail": true
}curl -X POST "https://staging-api.docage.com/TransactionObservers" \
-H "Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9…" \
-H "Content-Type: application/json" \
-d '{
"TransactionId": "cccccccc-0000-4000-8000-000000000003",
"FriendlyName": "Comptable",
"PersonType": 1,
"ContactId": "00000000-0000-4000-8000-000000000204",
"LastName": "Bernard",
"NotifyTransactionCompletionByMail": true
}'using HttpClient client = new();
using HttpRequestMessage request = new(HttpMethod.Post, "https://staging-api.docage.com/TransactionObservers");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", token);
request.Content = new StringContent("""
{
"TransactionId": "cccccccc-0000-4000-8000-000000000003",
"FriendlyName": "Comptable",
"PersonType": 1,
"ContactId": "00000000-0000-4000-8000-000000000204",
"LastName": "Bernard",
"NotifyTransactionCompletionByMail": true
}
""", 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/TransactionObservers", {
method: "POST",
headers: {
Authorization: `Bearer ${token}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"TransactionId": "cccccccc-0000-4000-8000-000000000003",
"FriendlyName": "Comptable",
"PersonType": 1,
"ContactId": "00000000-0000-4000-8000-000000000204",
"LastName": "Bernard",
"NotifyTransactionCompletionByMail": true
})
});
const text = await response.text();
if (!response.ok) throw new Error(text);
const result = text ? JSON.parse(text) : null;Un participant envoyé avec MemberRole 2 devient lui aussi un observateur : la réponse est alors l'identifiant de l'observateur.
Les refus
400:LastNamemanque ; niContactIdniDocageUserId(« Vous devez renseigner la propriété DocageUserId. ») ; le parcours est déjà lancé.404: le parcours, le contact ou l'utilisateur est introuvable, ou vous ne le voyez pas.403: vous voyez le parcours sans avoir le droit de le modifier.
Les pièges
- Sans
MemberRole, le participant n'a aucune action. La version précédente de l'API en faisait un signataire d'office ; ses propriétésIsSignatory,SignatoryOrder… sont ignorées. - Des coordonnées envoyées dans le corps (
FirstName,Email,Mobile) ne désignent personne : elles sont remplacées par celles de la fiche. Pour une personne sans fiche, créez d'abord son contact. - Un emplacement de signature imbriqué dans le corps est ignoré : posez-le ensuite — Poser une signature visuelle.
- Donnez un
FriendlyNamequ'aucun autre participant ne porte : la création ne le vérifie pas.