Ana içeriğe geç

Çeviri Cache Temizle

Çeviri cache'lerini temizler.

Endpoint

POST /api/v1/cache/clear-translation

Authentication

Bu endpoint authentication gerektirir.

Header: Authorization: Bearer \{token\}

Permission

  • cache.clear.translation - Çeviri cache temizleme

Request

Headers

HeaderDeğerZorunlu
AuthorizationBearer \{token\}Evet
Content-Typeapplication/jsonEvet

Request Body (Opsiyonel)

ParametreTipZorunluAçıklama
localestringHayırDil kodu (belirli bir dil için)
keystringHayırÇeviri anahtarı (belirli bir key için)

Example Request (Belirli Locale)

{
"locale": "tr"
}

Example Request (Belirli Key)

{
"locale": "tr",
"key": "pages.home"
}

Example Request (Tüm Çeviri Cache'leri)

{}

Response

Success Response (200 OK)

{
"message": "Translation cache cleared successfully",
"locale": "tr",
"key": "pages.home"
}

Error Responses

403 Forbidden

{
"message": "Forbidden"
}

Code Examples

cURL - Belirli Locale

curl -X POST https://api.example.com/api/v1/cache/clear-translation \
-H "Authorization: Bearer \{token\}" \
-H "Content-Type: application/json" \
-d '{
"locale": "tr"
}'

cURL - Belirli Key

curl -X POST https://api.example.com/api/v1/cache/clear-translation \
-H "Authorization: Bearer \{token\}" \
-H "Content-Type: application/json" \
-d '{
"locale": "tr",
"key": "pages.home"
}'

cURL - Tüm Çeviri Cache'leri

curl -X POST https://api.example.com/api/v1/cache/clear-translation \
-H "Authorization: Bearer \{token\}"

Notes

  • Parametre yoksa tüm çeviri cache'leri temizlenir
  • locale parametresi ile belirli bir dil için tüm cache'ler temizlenir
  • locale ve key birlikte kullanılırsa belirli bir çeviri cache'i temizlenir
  • Çeviriler 24 saat cache'lenir, bu endpoint ile manuel temizlenebilir