Gönderiler
Randevuları gönderiye bağla
Bir veya daha fazla randevuyu bir gönderiye bağla
POST
/
api
/
v1
/
shipments
/
{id}
/
appointments
curl --request POST \
--url https://anivahealth.com/api/v1/shipments/P2611194821/appointments \
--header 'x-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"appointment_ids": [
"c9f3e2a1-7d6b-4c5e-b3a2-1f0e9d8c7b6a"
]
}'
[
{
"id": "c9f3e2a1-7d6b-4c5e-b3a2-1f0e9d8c7b6a",
"profile_id": "a3f1c2d4-8b7e-4f2a-9c1d-2e3f4a5b6c7d",
"location_id": "b7e2d1f5-3c4a-4e8b-a2f1-9d0c1e2f3a4b",
"scheduled_at": "2026-04-15T08:30:00Z",
"status": "blood_drawn",
"created_at": "2026-04-01T09:45:00Z",
"updated_at": "2026-04-15T08:30:00Z",
"profile": {
"id": "a3f1c2d4-8b7e-4f2a-9c1d-2e3f4a5b6c7d",
"first_name": "Maria",
"last_name": "Schmidt",
"email": "maria.schmidt@example.com",
"date_of_birth": "1985-03-22",
"sex": 2
},
"panels": [],
"individual_biomarkers": [],
"shipments": [
{
"id": "P2611194821",
"added_at": "2026-04-15T08:30:00Z"
}
]
}
]
{
"error": "Cannot attach appointments outside the allowed window — each appointment must be past blood-draw or the shipment must be less than 24 hours old. Blocked: c9f3e2a1-7d6b-4c5e-b3a2-1f0e9d8c7b6a"
}
Bu gönderiye bir veya daha fazla randevu bağla. İdempotenttir — zaten bağlı olan randevular
sessizce atlanır.
Değişiklik kuralı (randevu başına) şudur: bağlantı şu durumlardan BİRİNDE oluşturulabilir
- randevu kan alma aşamasını geçmişse (
blood_drawn) veya - gönderi 24 saatten daha kısa süre önce oluşturulmuşsa.
409 Conflict ile reddedilir.
Aynı kural Randevuları gönderiden
ayır uç noktası için de geçerlidir. Bağlantıları değiştirmenin tek yolu
bu iki uç noktadır. Randevu API’sinin karşılık gelen bir uç noktası yoktur.
İstek
Yol parametreleri
Gövde parametreleri
Yanıt
Başarılı olduğunda API, erişim bağlamındaki bağlı randevuları en eski bağlantı önce gelecek şekilde200 OK ile döndürür. Her kayıt, Randevuyu getir yanıtıyla aynı yapıdadır.
Hata yanıtları
| Durum | Açıklama |
|---|---|
400 | Doğrulama hatası — ör. boş appointment_ids veya geçersiz UUID. |
403 | Erişim reddedildi — eksik scope, erişim bağlamı dışında gönderi veya randevu ya da bağlı bir ev kiti siparişi erişim bağlamının dışında. |
404 | Gönderi bulunamadı veya bir ya da daha fazla randevu bulunamadı. |
409 | Değişiklik kuralı sağlanamadı — en az bir randevu kan alma aşamasını geçmemiş ve gönderi 24 saatten eski. Yanıt ID’leri listeler. |
500 | Dahili sunucu hatası. |
curl --request POST \
--url https://anivahealth.com/api/v1/shipments/P2611194821/appointments \
--header 'x-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"appointment_ids": [
"c9f3e2a1-7d6b-4c5e-b3a2-1f0e9d8c7b6a"
]
}'
[
{
"id": "c9f3e2a1-7d6b-4c5e-b3a2-1f0e9d8c7b6a",
"profile_id": "a3f1c2d4-8b7e-4f2a-9c1d-2e3f4a5b6c7d",
"location_id": "b7e2d1f5-3c4a-4e8b-a2f1-9d0c1e2f3a4b",
"scheduled_at": "2026-04-15T08:30:00Z",
"status": "blood_drawn",
"created_at": "2026-04-01T09:45:00Z",
"updated_at": "2026-04-15T08:30:00Z",
"profile": {
"id": "a3f1c2d4-8b7e-4f2a-9c1d-2e3f4a5b6c7d",
"first_name": "Maria",
"last_name": "Schmidt",
"email": "maria.schmidt@example.com",
"date_of_birth": "1985-03-22",
"sex": 2
},
"panels": [],
"individual_biomarkers": [],
"shipments": [
{
"id": "P2611194821",
"added_at": "2026-04-15T08:30:00Z"
}
]
}
]
{
"error": "Cannot attach appointments outside the allowed window — each appointment must be past blood-draw or the shipment must be less than 24 hours old. Blocked: c9f3e2a1-7d6b-4c5e-b3a2-1f0e9d8c7b6a"
}
⌘I
curl --request POST \
--url https://anivahealth.com/api/v1/shipments/P2611194821/appointments \
--header 'x-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"appointment_ids": [
"c9f3e2a1-7d6b-4c5e-b3a2-1f0e9d8c7b6a"
]
}'
[
{
"id": "c9f3e2a1-7d6b-4c5e-b3a2-1f0e9d8c7b6a",
"profile_id": "a3f1c2d4-8b7e-4f2a-9c1d-2e3f4a5b6c7d",
"location_id": "b7e2d1f5-3c4a-4e8b-a2f1-9d0c1e2f3a4b",
"scheduled_at": "2026-04-15T08:30:00Z",
"status": "blood_drawn",
"created_at": "2026-04-01T09:45:00Z",
"updated_at": "2026-04-15T08:30:00Z",
"profile": {
"id": "a3f1c2d4-8b7e-4f2a-9c1d-2e3f4a5b6c7d",
"first_name": "Maria",
"last_name": "Schmidt",
"email": "maria.schmidt@example.com",
"date_of_birth": "1985-03-22",
"sex": 2
},
"panels": [],
"individual_biomarkers": [],
"shipments": [
{
"id": "P2611194821",
"added_at": "2026-04-15T08:30:00Z"
}
]
}
]
{
"error": "Cannot attach appointments outside the allowed window — each appointment must be past blood-draw or the shipment must be less than 24 hours old. Blocked: c9f3e2a1-7d6b-4c5e-b3a2-1f0e9d8c7b6a"
}