Video
Videolar, kullanıcıların izleyerek puan kazandığı içeriklerdir. Sistem, gerçek etkileşimi sağlamak için izleme ilerlemesini oturumlar aracılığıyla takip eder.
İçerik segmente edilmişse, bu endpointler yalnızca mevcut kullanıcıyla eşleşen içerikleri döndürür.
Kategorileri Listele
Video içerik kategorilerinin listesini alın.
/v1/video-contents/categoriesÖrnek İstek
curl -X GET "https://marka.prod.loyetta.com/api/v1/video-contents/categories" \
-H "Authorization: Bearer {musteri-tokeni}" \
-H "Accept: application/json"Yanıt
{
"success": true,
"data": [
{
"id": "cat-1a2b",
"label": "Yeni Videolar",
"type": "primary"
},
{
"id": "cat-3c4d",
"label": "Eğitimler",
"type": "secondary"
}
]
}Kategori Nesnesi
| Alan | Tür | Açıklama |
|---|---|---|
id | string | Kategori tanımlayıcısı |
label | string | Kategori görüntüleme adı |
type | string | Kategori tipi (ör. primary, secondary) |
Videoları Listele
Video içeriklerinin sayfalanmış listesini alın.
/v1/video-contentsQuery Parametreleri
| Parametre | Tür | Açıklama |
|---|---|---|
page[number] | integer | Sayfa numarası (varsayılan: 1) |
filter[title] | string | Başlığa göre arama |
filter[categories] | string | Kategoriye göre filtrele |
filter[watched] | boolean | İzlenme durumuna göre filtrele. 0/1 veya true/false kabul eder |
Örnek İstek
curl -X GET "https://marka.prod.loyetta.com/api/v1/video-contents?page[number]=1" \
-H "Authorization: Bearer {musteri-tokeni}" \
-H "Accept: application/json"Yanıt
{
"data": [
{
"id": "v1a5c77f",
"title": "Nasıl Daha Fazla Puan Kazanılır",
"description": "Ödüllerinizi en üst düzeye çıkarmanın en iyi yollarını öğrenin.",
"points": 50,
"image": {
"url": "https://example.com/video-thumb.jpg",
"sizes": {
"full": "https://example.com/video-thumb.webp",
"large": "https://example.com/video-thumb-large.webp",
"thumbnail": "https://example.com/video-thumb-sm.webp"
}
},
"categories": [
{
"id": "cat-1a2b",
"label": "Eğitimler",
"type": "primary"
}
],
"video": "https://example.com/videos/puan-kazan.mp4",
"duration": 120,
"share_text": "Bu videoyu izle ve puan kazan!",
"views": 1200,
"watched": false
}
],
"links": {
"first": "https://marka.prod.loyetta.com/api/v1/video-contents?page[number]=1",
"last": "https://marka.prod.loyetta.com/api/v1/video-contents?page[number]=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"path": "https://marka.prod.loyetta.com/api/v1/video-contents",
"per_page": 15,
"to": 1,
"total": 1
}
}Video Nesnesi
| Alan | Tür | Açıklama |
|---|---|---|
id | string | Benzersiz video tanımlayıcısı |
title | string | Video başlığı |
description | string | Video açıklaması |
points | integer | Video izlendiğinde kazanılan puan |
image | object | url ve sizes içeren görsel nesnesi (aşağıdaki Görsel Nesnesi bölümüne bakın) |
categories | array | Kategori nesneleri dizisi |
video | string | Video dosyası URL'i |
duration | integer | Video süresi (saniye cinsinden) |
share_text | string | Sistem paylaşım diyaloğunda kullanılacak metin |
views | integer | Toplam görüntülenme sayısı |
watched | boolean | Mevcut kullanıcının bu videoyu izleyip izlemediği |
Görsel Nesnesi
| Alan | Tür | Açıklama |
|---|---|---|
url | string | Ham görsel URL'i, her zaman mevcuttur |
sizes.full | string | null | WebP formatında orijinal boyutlar |
sizes.large | string | null | WebP formatında maks. 1920px genişlik |
sizes.thumbnail | string | null | WebP formatında maks. 400px genişlik |
image.url alanı her zaman mevcuttur. Ancak image.sizes değerleri, görseller işlenirken null olabilir. Her zaman bir fallback deseni kullanın: image.sizes.thumbnail ?? image.url veya image.sizes.large ?? image.url.
Video Detayı
Belirli bir video içeriğinin detaylı bilgilerini alın.
/v1/video-contents/{videoContent}Listeleme endpoint'i de içerik verilerini döndürse de, kullanıcı belirli bir içerikle etkileşime geçtiğinde bu detay endpoint'ini çağırmanız önerilir. Bu istek arka planda yapılabilir ve Loyetta'nın analitiği doğru şekilde takip etmesine yardımcı olur.
Path Parametreleri
| Parametre | Tür | Açıklama |
|---|---|---|
videoContent | string | Video içeriğinin ID'si |
Örnek İstek
curl -X GET "https://marka.prod.loyetta.com/api/v1/video-contents/v1a5c77f" \
-H "Authorization: Bearer {musteri-tokeni}" \
-H "Accept: application/json"Yanıt
{
"success": true,
"data": {
"id": "v1a5c77f",
"title": "Nasıl Daha Fazla Puan Kazanılır",
"description": "Ödüllerinizi en üst düzeye çıkarmanın en iyi yollarını öğrenin.",
"points": 50,
"image": {
"url": "https://example.com/video-thumb.jpg",
"sizes": {
"full": "https://example.com/video-thumb.webp",
"large": "https://example.com/video-thumb-large.webp",
"thumbnail": "https://example.com/video-thumb-sm.webp"
}
},
"categories": [
{
"id": "cat-1a2b",
"label": "Eğitimler",
"type": "primary"
}
],
"video": "https://example.com/videos/puan-kazan.mp4",
"duration": 120,
"share_text": "Bu videoyu izle ve puan kazan!",
"views": 1200,
"watched": false
}
}Hata Yanıtı (404)
{
"success": false,
"message": "Video Content not found"
}Önerileri Getir
Belirli bir video içeriğiyle ilgili önerilen videoları alın.
/v1/video-contents/{videoContent}/suggestionsPath Parametreleri
| Parametre | Tür | Açıklama |
|---|---|---|
videoContent | string | Video içeriğinin ID'si |
Örnek İstek
curl -X GET "https://marka.prod.loyetta.com/api/v1/video-contents/v1a5c77f/suggestions" \
-H "Authorization: Bearer {musteri-tokeni}" \
-H "Accept: application/json"Yanıt
{
"success": true,
"suggestions": [
{
"id": "v2b6d88a",
"title": "İleri Seviye Ödül İpuçları",
"description": "Ödüllerinizi bir üst seviyeye taşıyın.",
"points": 75,
"image": {
"url": "https://example.com/video-thumb-2.jpg",
"sizes": {
"full": "https://example.com/video-thumb-2.webp",
"large": "https://example.com/video-thumb-2-large.webp",
"thumbnail": "https://example.com/video-thumb-2-sm.webp"
}
},
"categories": [],
"video": "https://example.com/videos/ileri-ipuclari.mp4",
"duration": 180,
"share_text": "Bu ileri seviye ipuçlarına göz atın!",
"views": 800,
"watched": false
}
]
}İzleme Oturumları
Videolardan puan kazanmak için kullanıcıların bir oturum akışını takip etmesi gerekir: oturum oluştur, ilerlemeyi güncelle ve oturumu tamamla. Bu, gerçek video etkileşimini sağlar.
Oturum Oluştur
Bir video için yeni bir izleme oturumu başlatın.
/v1/video-contents/{videoContent}/sessionsPath Parametreleri
| Parametre | Tür | Açıklama |
|---|---|---|
videoContent | string | Video içeriğinin ID'si |
Örnek İstek
curl -X POST "https://marka.prod.loyetta.com/api/v1/video-contents/v1a5c77f/sessions" \
-H "Authorization: Bearer {musteri-tokeni}" \
-H "Accept: application/json"Yanıt
{
"success": true,
"session_key": "sess-abc123def456",
"suggestions": [
{
"id": "v2b6d88a",
"title": "İleri Seviye Ödül İpuçları",
"description": "Ödüllerinizi bir üst seviyeye taşıyın.",
"points": 75,
"image": {
"url": "https://example.com/video-thumb-2.jpg",
"sizes": {
"full": "https://example.com/video-thumb-2.webp",
"large": "https://example.com/video-thumb-2-large.webp",
"thumbnail": "https://example.com/video-thumb-2-sm.webp"
}
},
"categories": [],
"video": "https://example.com/videos/ileri-ipuclari.mp4",
"duration": 180,
"share_text": "Bu ileri seviye ipuçlarına göz atın!",
"views": 800,
"watched": false
}
]
}Oturumu Güncelle
Video izleme sırasında kullanıcının mevcut oynatma konumunu bildirin.
/v1/video-contents/{videoContent}/sessions/{session}Path Parametreleri
| Parametre | Tür | Açıklama |
|---|---|---|
videoContent | string | Video içeriğinin ID'si |
session | string | Oturum oluşturmadan dönen oturum anahtarı |
İstek Gövdesi
| Parametre | Tür | Zorunlu | Açıklama |
|---|---|---|---|
position | integer | Evet | Mevcut oynatma konumu (saniye cinsinden) |
Örnek İstek
curl -X POST "https://marka.prod.loyetta.com/api/v1/video-contents/v1a5c77f/sessions/sess-abc123def456" \
-H "Authorization: Bearer {musteri-tokeni}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"position": 50
}'Yanıt
{
"success": true,
"session_key": "sess-abc123def456"
}Oturumu Tamamla
Oturumu tamamlandı olarak işaretleyin ve kullanıcıya puan verin.
/v1/video-contents/{videoContent}/sessions/{session}/completePath Parametreleri
| Parametre | Tür | Açıklama |
|---|---|---|
videoContent | string | Video içeriğinin ID'si |
session | string | Oturum oluşturmadan dönen oturum anahtarı |
Örnek İstek
curl -X POST "https://marka.prod.loyetta.com/api/v1/video-contents/v1a5c77f/sessions/sess-abc123def456/complete" \
-H "Authorization: Bearer {musteri-tokeni}" \
-H "Accept: application/json"Yanıt
{
"success": true,
"message": "Tebrikler! Videoyu izleyerek 50 puan kazandınız.",
"earned_points": 50,
"user": {
"points": 1600
}
}Yanıt Alanları
| Alan | Tür | Açıklama |
|---|---|---|
success | boolean | Tamamlamanın başarılı olup olmadığı |
message | string | Geri bildirim mesajı |
earned_points | integer | Bu videodan kazanılan puan |
user.points | integer | Kullanıcının güncellenmiş toplam puan bakiyesi |
Oturum akışı sırasıyla takip edilmelidir: Oluştur → Güncelle → Tamamla. Adımları atlayan veya geçersiz konum bildiren oturumlar puan vermeyebilir.
Videoyu Paylaş
Kullanıcı bir videoyu paylaştığında paylaşım aksiyonunu kaydedin. Analitik ve etkileşim takibi için kullanılabilir.
/v1/video-contents/{videoContent}/sharePath Parametreleri
| Parametre | Tür | Açıklama |
|---|---|---|
videoContent | string | Video içeriğinin ID'si |
Örnek İstek
curl -X POST "https://marka.prod.loyetta.com/api/v1/video-contents/v1a5c77f/share" \
-H "Authorization: Bearer {musteri-tokeni}" \
-H "Accept: application/json"Yanıt
{
"success": true
}