7 rute de platformă, cu exemplu de cerere pentru fiecare.
Adresa de bază: https://app.ilustromania.com/nucleu. Autentificarea, formatul și erorile sunt în Prezentarea API-ului.
GET/v1/webhookuri
Destinațiile webhook ale firmei
Lista destinațiilor webhook ale firmei din sesiune, fără secrete. Doar administratorul (403 altfel); 409 dacă livrarea nu e pornită pe firmă.
curl https://app.ilustromania.com/nucleu/v1/webhookuri \
-H "Cookie: __Host-sesiune=$JETON_SESIUNE"const raspuns = await fetch("https://app.ilustromania.com/nucleu/v1/webhookuri", {
headers: {
"Cookie": `__Host-sesiune=${process.env.JETON_SESIUNE}`,
},
});
const date = await raspuns.json();import os
import requests
raspuns = requests.get(
"https://app.ilustromania.com/nucleu/v1/webhookuri",
headers={"Cookie": "__Host-sesiune=" + os.environ["JETON_SESIUNE"]},
)
date = raspuns.json()POST/v1/webhookuri
Adaugă o destinație webhook
Corp {url, evenimente, descriere?}; evenimente din factura.emisa, aviz.emis, oferta.creata, comanda_catering.primita. Întoarce 201 {destinatie, secret}: secretul whsec_… se arată doar acum. 400 corp invalid sau adresă refuzată, 503 fără cheia Seifului. Doar administratorul.
curl -X POST https://app.ilustromania.com/nucleu/v1/webhookuri \
-H "Cookie: __Host-sesiune=$JETON_SESIUNE" \
-H "Content-Type: application/json" \
-d '{ … }'const raspuns = await fetch("https://app.ilustromania.com/nucleu/v1/webhookuri", {
method: "POST",
headers: {
"Cookie": `__Host-sesiune=${process.env.JETON_SESIUNE}`,
"Content-Type": "application/json",
},
body: JSON.stringify({ … }),
});
const date = await raspuns.json();import os
import requests
raspuns = requests.post(
"https://app.ilustromania.com/nucleu/v1/webhookuri",
headers={"Cookie": "__Host-sesiune=" + os.environ["JETON_SESIUNE"]},
json={ … },
)
date = raspuns.json()GET/v1/webhookuri/{id}/livrari
Jurnalul livrărilor unei destinații
Cele mai noi 100 de livrări ale destinației (încercare, cod, durată, când). 404 destinație străină sau lipsă. Doar administratorul.
| Nume | Tip | Descriere |
|---|---|---|
id | string | identificatorul resursei |
curl https://app.ilustromania.com/nucleu/v1/webhookuri/{id}/livrari \
-H "Cookie: __Host-sesiune=$JETON_SESIUNE"const raspuns = await fetch("https://app.ilustromania.com/nucleu/v1/webhookuri/{id}/livrari", {
headers: {
"Cookie": `__Host-sesiune=${process.env.JETON_SESIUNE}`,
},
});
const date = await raspuns.json();import os
import requests
raspuns = requests.get(
"https://app.ilustromania.com/nucleu/v1/webhookuri/{id}/livrari",
headers={"Cookie": "__Host-sesiune=" + os.environ["JETON_SESIUNE"]},
)
date = raspuns.json()POST/v1/webhookuri/{id}/opreste
Oprește o destinație webhook
Destinația nu mai primește nimic, iar livrările în așteptare se anulează. 404 dacă destinația e a altei firme sau lipsește. Doar administratorul.
| Nume | Tip | Descriere |
|---|---|---|
id | string | identificatorul resursei |
curl -X POST https://app.ilustromania.com/nucleu/v1/webhookuri/{id}/opreste \
-H "Cookie: __Host-sesiune=$JETON_SESIUNE" \
-H "Content-Type: application/json" \
-d '{ … }'const raspuns = await fetch("https://app.ilustromania.com/nucleu/v1/webhookuri/{id}/opreste", {
method: "POST",
headers: {
"Cookie": `__Host-sesiune=${process.env.JETON_SESIUNE}`,
"Content-Type": "application/json",
},
body: JSON.stringify({ … }),
});
const date = await raspuns.json();import os
import requests
raspuns = requests.post(
"https://app.ilustromania.com/nucleu/v1/webhookuri/{id}/opreste",
headers={"Cookie": "__Host-sesiune=" + os.environ["JETON_SESIUNE"]},
json={ … },
)
date = raspuns.json()POST/v1/webhookuri/{id}/roteste-secret
Rotește secretul destinației
Scrie un secret nou în Seif și îl întoarce o singură dată {destinatie, secret}; cel vechi mai semnează 24 de ore. 409 pe destinație oprită, 503 fără cheia Seifului. Doar administratorul.
| Nume | Tip | Descriere |
|---|---|---|
id | string | identificatorul resursei |
curl -X POST https://app.ilustromania.com/nucleu/v1/webhookuri/{id}/roteste-secret \
-H "Cookie: __Host-sesiune=$JETON_SESIUNE" \
-H "Content-Type: application/json" \
-d '{ … }'const raspuns = await fetch("https://app.ilustromania.com/nucleu/v1/webhookuri/{id}/roteste-secret", {
method: "POST",
headers: {
"Cookie": `__Host-sesiune=${process.env.JETON_SESIUNE}`,
"Content-Type": "application/json",
},
body: JSON.stringify({ … }),
});
const date = await raspuns.json();import os
import requests
raspuns = requests.post(
"https://app.ilustromania.com/nucleu/v1/webhookuri/{id}/roteste-secret",
headers={"Cookie": "__Host-sesiune=" + os.environ["JETON_SESIUNE"]},
json={ … },
)
date = raspuns.json()POST/v1/webhookuri/{id}/test
Trimite un webhook de probă
Pune o livrare test.ping doar spre această destinație și răspunde 202. 404 destinație străină sau lipsă, 409 destinație oprită. Doar administratorul.
| Nume | Tip | Descriere |
|---|---|---|
id | string | identificatorul resursei |
curl -X POST https://app.ilustromania.com/nucleu/v1/webhookuri/{id}/test \
-H "Cookie: __Host-sesiune=$JETON_SESIUNE" \
-H "Content-Type: application/json" \
-d '{ … }'const raspuns = await fetch("https://app.ilustromania.com/nucleu/v1/webhookuri/{id}/test", {
method: "POST",
headers: {
"Cookie": `__Host-sesiune=${process.env.JETON_SESIUNE}`,
"Content-Type": "application/json",
},
body: JSON.stringify({ … }),
});
const date = await raspuns.json();import os
import requests
raspuns = requests.post(
"https://app.ilustromania.com/nucleu/v1/webhookuri/{id}/test",
headers={"Cookie": "__Host-sesiune=" + os.environ["JETON_SESIUNE"]},
json={ … },
)
date = raspuns.json()POST/v1/webhookuri/livrari/{id}/retrimite
Retrimite o livrare webhook
Pune din nou același eveniment spre aceeași destinație, de la încercarea 1, și răspunde 202 {livrare}. 404 livrare străină sau lipsă, 409 destinație oprită. Doar administratorul.
| Nume | Tip | Descriere |
|---|---|---|
id | string | identificatorul resursei |
curl -X POST https://app.ilustromania.com/nucleu/v1/webhookuri/livrari/{id}/retrimite \
-H "Cookie: __Host-sesiune=$JETON_SESIUNE" \
-H "Content-Type: application/json" \
-d '{ … }'const raspuns = await fetch("https://app.ilustromania.com/nucleu/v1/webhookuri/livrari/{id}/retrimite", {
method: "POST",
headers: {
"Cookie": `__Host-sesiune=${process.env.JETON_SESIUNE}`,
"Content-Type": "application/json",
},
body: JSON.stringify({ … }),
});
const date = await raspuns.json();import os
import requests
raspuns = requests.post(
"https://app.ilustromania.com/nucleu/v1/webhookuri/livrari/{id}/retrimite",
headers={"Cookie": "__Host-sesiune=" + os.environ["JETON_SESIUNE"]},
json={ … },
)
date = raspuns.json()