Randevular
Sonuçları e-postayla gönder
Müşteriye laboratuvar sonuçlarının hazır olduğunu e-postayla bildir
POST
/
api
/
v1
/
appointments
/
{id}
/
results
/
email
curl --request POST \
--url https://anivahealth.com/api/v1/appointments/c9f3e2a1-7d6b-4c5e-b3a2-1f0e9d8c7b6a/results/email \
--header 'x-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"with_reports": true,
"note": "Your vitamin D is low. We will talk about it at your next visit."
}'
{
"recipient_email": "maria.schmidt@example.com",
"attachment_count": 1,
"sent_at": "2026-10-15T09:12:44.512Z"
}
{
"error": "This customer has turned off emails. Turn emails on for them first.",
"reason": "unsubscribed"
}
Müşteriye laboratuvar sonuçlarının hazır olduğunu bildiren bir e-posta gönder. E-posta, randevunun
profilindeki
email adresine gider.
E-posta genel iş ortağı markalamasını kullanır: profilin birincil profil grubunun adı ve
logosu. Profilin language dilindedir, varsayılan olarak İngilizcedir.
Randevunun laboratuvar raporlarını eklemek için with_reports değerini true olarak ayarla. E-posta,
müşterinin uygulamada görebildiği her raporu ekler. Yalnızca bildirimi göndermek için false olarak
ayarla. E-postada kişisel bir not göstermek için en fazla 1.000 karakterlik note ekle.
Eklenen her rapor, AES-256 ile şifrelenmiş bir PDF’dir. Şifre, profilin date_of_birth değerinin
noktasız 8 haneli DDMMYYYY biçimidir: 1 Şubat 1985 doğumlu bir müşteri
01021985 yazar. E-posta müşteriye bu biçimi söyler ama doğum tarihinin kendisini asla yazmaz.
Her çağrı bir e-posta gönderir. Çağrılar tekilleştirilmez: uç noktayı iki kez çağırırsan müşteri
iki e-posta alır.
E-posta şu durumlarda gönderilmez:
- Henüz laboratuvar raporu gelmedi.
- Profilde e-posta adresi yok veya yalnızca yer tutucu bir
@aniva.emailadresi var. - Profil işlemsel e-postaları kapattı. Bunları yeniden açmak için Profili güncelle ile
transactional_emails_enableddeğerinitrueolarak ayarla. with_reportsdeğeritrueve profildedate_of_birthyok. Bunu Profili güncelle ile ayarla veyawith_reports: falseile gönder.
results_view kapsamını gerektirir.
İstek
Yol parametreleri
Gövde parametreleri
true laboratuvar raporlarını şifre korumalı PDF dosyaları olarak ekler. false yalnızca sonuçların hazır olduğuna dair
bildirimi gönderir.Yanıt
Başarılı olduğunda API200 OK döndürür.
Hata yanıtları
Hata gövdesinde okunabilir bir mesaj olanerror ve sabit bir kod olan reason bulunur. Doğrulama hataları
ve eksik results_view kapsamı için reason bulunmaz.
| Durum | Neden | Açıklama |
|---|---|---|
400 | — | Doğrulama hatası — geçersiz kimlik, eksik with_reports veya 1.000 karakterden uzun note. |
403 | access_denied | Yasak — API anahtarının bu kapsamı yok veya randevu erişim bağlamının dışında. |
404 | not_found | Randevu bulunamadı. |
409 | no_reports | Henüz laboratuvar raporu gelmedi. |
409 | no_email | Profilde e-posta adresi yok. |
409 | placeholder_email | Profilde yalnızca yer tutucu bir @aniva.email adresi var. Profili gerçek bir e-postayla güncelle. |
409 | unsubscribed | Profil işlemsel e-postaları kapattı. Önce transactional_emails_enabled değerini true olarak ayarla. |
409 | no_birthdate | with_reports değeri true ve profilde PDF şifresi olan date_of_birth yok. |
413 | reports_too_large | Raporlar tek bir e-posta için çok büyük. E-postayı with_reports: false ile gönder. |
422 | report_unprotectable | Bir rapor PDF değil veya şifreyle korunamadı. with_reports: false ile gönder. |
500 | — | İç sunucu hatası. |
502 | report_unavailable | Bir laboratuvar raporu yüklenemedi. E-posta gönderilmedi. |
502 | send_failed | E-posta sağlayıcısı e-postayı reddetti. E-posta gönderilmedi. |
curl --request POST \
--url https://anivahealth.com/api/v1/appointments/c9f3e2a1-7d6b-4c5e-b3a2-1f0e9d8c7b6a/results/email \
--header 'x-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"with_reports": true,
"note": "Your vitamin D is low. We will talk about it at your next visit."
}'
{
"recipient_email": "maria.schmidt@example.com",
"attachment_count": 1,
"sent_at": "2026-10-15T09:12:44.512Z"
}
{
"error": "This customer has turned off emails. Turn emails on for them first.",
"reason": "unsubscribed"
}
⌘I
curl --request POST \
--url https://anivahealth.com/api/v1/appointments/c9f3e2a1-7d6b-4c5e-b3a2-1f0e9d8c7b6a/results/email \
--header 'x-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"with_reports": true,
"note": "Your vitamin D is low. We will talk about it at your next visit."
}'
{
"recipient_email": "maria.schmidt@example.com",
"attachment_count": 1,
"sent_at": "2026-10-15T09:12:44.512Z"
}
{
"error": "This customer has turned off emails. Turn emails on for them first.",
"reason": "unsubscribed"
}