Trouver un modèle et ses identifiants conviviaux
Lister les modèles de parcours, puis lire celui qui sert pour relever ses participants et ses documents.
1Lister les modèles
GET https://staging-api.docage.com/Transactions/TemplatesIdAndName
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9…curl "https://staging-api.docage.com/Transactions/TemplatesIdAndName" \
-H "Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9…"using HttpClient client = new();
using HttpRequestMessage request = new(HttpMethod.Get, "https://staging-api.docage.com/Transactions/TemplatesIdAndName");
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/TemplatesIdAndName", {
headers: {
Authorization: `Bearer ${token}`
}
});
const text = await response.text();
if (!response.ok) throw new Error(text);
const result = text ? JSON.parse(text) : null;[
{ "Id": "aaaaaaaa-0000-4000-8000-000000000001", "Name": "Contrat de prestation", "IsSystem": false },
{ "Id": "aaaaaaaa-0000-4000-8000-000000000011", "Name": "Signature de devis", "IsSystem": true }
]Un modèle système (IsSystem) est fourni par Docage à toutes les organisations ; les autres sont ceux de votre organisation.
Pour lire les modèles avec leurs propriétés — filtrés, triés, paginés —, interrogez la liste des parcours avec IsTemplate :
QUERY https://staging-api.docage.com/Transactions
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9…
Content-Type: application/json
{ "IsTemplate": true, "SortOrder": "Name", "Take": 50, "EntityProperties": ["Id", "Name", "Description"] }curl -X QUERY "https://staging-api.docage.com/Transactions" \
-H "Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9…" \
-H "Content-Type: application/json" \
-d '{
"IsTemplate": true,
"SortOrder": "Name",
"Take": 50,
"EntityProperties": ["Id", "Name", "Description"]
}'using HttpClient client = new();
using HttpRequestMessage request = new(new HttpMethod("QUERY"), "https://staging-api.docage.com/Transactions");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", token);
request.Content = new StringContent("""
{
"IsTemplate": true,
"SortOrder": "Name",
"Take": 50,
"EntityProperties": [
"Id",
"Name",
"Description"
]
}
""", 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/Transactions", {
method: "QUERY",
headers: {
Authorization: `Bearer ${token}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"IsTemplate": true,
"SortOrder": "Name",
"Take": 50,
"EntityProperties": ["Id", "Name", "Description"]
})
});
const text = await response.text();
if (!response.ok) throw new Error(text);
const result = text ? JSON.parse(text) : null;Voir Lire des listes pour le filtre, le tri et la pagination.
2Relever ses identifiants conviviaux
GET https://staging-api.docage.com/Transactions/aaaaaaaa-0000-4000-8000-000000000001
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9…curl "https://staging-api.docage.com/Transactions/aaaaaaaa-0000-4000-8000-000000000001" \
-H "Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9…"using HttpClient client = new();
using HttpRequestMessage request = new(HttpMethod.Get, "https://staging-api.docage.com/Transactions/aaaaaaaa-0000-4000-8000-000000000001");
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/aaaaaaaa-0000-4000-8000-000000000001", {
headers: {
Authorization: `Bearer ${token}`
}
});
const text = await response.text();
if (!response.ok) throw new Error(text);
const result = text ? JSON.parse(text) : null;Relevez :
- les participants (
TransactionMembers[]) : leurFriendlyName— « Client », « Commercial »… — et leurPersonType:2est un participant à définir, qui attend une personne à chaque envoi ;0un utilisateur,1un contact déjà désignés. Leurs actions sont dansTransactionMemberActions[](Type:2validation,3signature…) ; - les observateurs (
TransactionObservers[]), désignés de même par leurFriendlyName; - les documents (
TransactionFiles[]) : leurFriendlyName— « Contrat » —, leurType(0à signer,1annexe), etIsDynamic: un document à remplacer, qui attend un fichier à chaque envoi.
Ce sont ces noms qui servent de clés au formulaire de création.
Les pièges
- Un modèle ne se lance pas : il sert à créer des parcours.
- Les identifiants conviviaux sont propres au modèle : un participant se renomme dans l'application, et la clé change avec lui.