API Yardım & Dokümantasyon

Bu sayfa, paste.vixware.net üzerinde çalışan API'nin temel kullanımını ve örneklerini içerir. Tüm istekler /api.php adresine yapılır. API, herkese açıktır ve kimlik doğrulama gerektirmez.

Dikkat: API üzerinden yapılan işlemler herkese açıktır, gizli veya hassas veri paylaşmayınız. Rate limit veya ek güvenlik gereksinimleri için sistem yöneticinizle iletişime geçin.

Temel Endpoint

https://paste.vixware.net/api.php

Desteklenen İşlemler

  • GET : Bir paste'i ID ile getirir
  • POST : Yeni paste oluşturur
  • PUT : Mevcut bir paste'i günceller
  • DELETE : Bir paste'i siler

1. Paste Getir (GET)

GET /api.php?id=PASTE_ID
curl -X GET "https://paste.vixware.net/api.php?id=PASTE_ID"
import requests
r = requests.get("https://paste.vixware.net/api.php", params={"id": "PASTE_ID"})
print(r.json())
fetch("https://paste.vixware.net/api.php?id=PASTE_ID")
  .then(r => r.json())
  .then(data => console.log(data));
<?php
$response = file_get_contents('https://paste.vixware.net/api.php?id=PASTE_ID');
$data = json_decode($response, true);
print_r($data);
?>
Başarılı Yanıt:
{
  "success": true,
  "paste": {
    "id": "...",
    "title": "...",
    "content": "...",
    "language": "...",
    "created_at": "...",
    "expiry": null,
    "views": 1
  }
}

Hatalı Yanıt:
{ "success": false, "error": "Paste bulunamadı." }

2. Yeni Paste Oluştur (POST)

POST /api.php
Content-Type: application/json

{
  "title": "Başlık",
  "content": "İçerik",
  "language": "php",
  "expiry": "+1 day" // veya "never"
  // Diğer örnekler:
  // "+10 minutes"   // 10 dakika sonra silinir
  // "+1 hour"       // 1 saat sonra silinir
  // "+6 hours"      // 6 saat sonra silinir
  // "+3 days"       // 3 gün sonra silinir
  // "+1 week"       // 1 hafta sonra silinir
  // "+1 month"      // 1 ay sonra silinir
  // "+1 year"       // 1 yıl sonra silinir
}
curl -X POST "https://paste.vixware.net/api.php" \
  -H "Content-Type: application/json" \
  -d '{"title":"Deneme","content":"Merhaba!"}'
import requests
r = requests.post("https://paste.vixware.net/api.php",
    json={"title": "Deneme", "content": "Merhaba!"})
print(r.json())
fetch("https://paste.vixware.net/api.php", {
  method: "POST",
  headers: {"Content-Type": "application/json"},
  body: JSON.stringify({title: "Deneme", content: "Merhaba!"})
})
  .then(r => r.json())
  .then(data => console.log(data));
<?php
$data = ["title" => "Deneme", "content" => "Merhaba!"];
$options = [
    'http' => [
        'header'  => "Content-type: application/json\r\n",
        'method'  => 'POST',
        'content' => json_encode($data),
    ],
];
$context  = stream_context_create($options);
$result = file_get_contents('https://paste.vixware.net/api.php', false, $context);
print_r(json_decode($result, true));
?>
Başarılı Yanıt:
{ "success": true, "id": "oluşan_id" }

Hatalı Yanıt:
{ "success": false, "error": "Başlık ve içerik zorunludur." }

3. Paste Güncelle (PUT)

PUT /api.php
Content-Type: application/json

{
  "id": "PASTE_ID",
  "title": "Yeni Başlık",
  "content": "Yeni içerik"
}
curl -X PUT "https://paste.vixware.net/api.php" \
  -H "Content-Type: application/json" \
  -d '{"id":"PASTE_ID","title":"Yeni Başlık","content":"Yeni içerik"}'
import requests
r = requests.put("https://paste.vixware.net/api.php",
    json={"id": "PASTE_ID", "title": "Yeni Başlık", "content": "Yeni içerik"})
print(r.json())
fetch("https://paste.vixware.net/api.php", {
  method: "PUT",
  headers: {"Content-Type": "application/json"},
  body: JSON.stringify({id: "PASTE_ID", title: "Yeni Başlık", content: "Yeni içerik"})
})
  .then(r => r.json())
  .then(data => console.log(data));
<?php
$data = ["id" => "PASTE_ID", "title" => "Yeni Başlık", "content" => "Yeni içerik"];
$options = [
    'http' => [
        'header'  => "Content-type: application/json\r\n",
        'method'  => 'PUT',
        'content' => json_encode($data),
    ],
];
$context  = stream_context_create($options);
$result = file_get_contents('https://paste.vixware.net/api.php', false, $context);
print_r(json_decode($result, true));
?>
Başarılı Yanıt:
{ "success": true, "message": "Paste güncellendi." }

Hatalı Yanıt:
{ "success": false, "error": "Paste bulunamadı." }

4. Paste Sil (DELETE)

DELETE /api.php
Content-Type: application/json

{
  "id": "PASTE_ID"
}
// veya
DELETE /api.php?id=PASTE_ID
curl -X DELETE "https://paste.vixware.net/api.php" \
  -H "Content-Type: application/json" \
  -d '{"id":"PASTE_ID"}'
import requests
r = requests.delete("https://paste.vixware.net/api.php",
    json={"id": "PASTE_ID"})
print(r.json())
fetch("https://paste.vixware.net/api.php", {
  method: "DELETE",
  headers: {"Content-Type": "application/json"},
  body: JSON.stringify({id: "PASTE_ID"})
})
  .then(r => r.json())
  .then(data => console.log(data));
<?php
$data = ["id" => "PASTE_ID"];
$options = [
    'http' => [
        'header'  => "Content-type: application/json\r\n",
        'method'  => 'DELETE',
        'content' => json_encode($data),
    ],
];
$context  = stream_context_create($options);
$result = file_get_contents('https://paste.vixware.net/api.php', false, $context);
print_r(json_decode($result, true));
?>
Başarılı Yanıt:
{ "success": true, "message": "Paste silindi." }

Hatalı Yanıt:
{ "success": false, "error": "id parametresi gerekli." }

Ek Bilgiler

  • Tüm yanıtlar JSON formatındadır.
  • "expiry" alanı +1 day, +1 week, never gibi değerler alabilir.
  • "language" alanı boş bırakılırsa text olarak kaydedilir.
  • API herkese açıktır, gizli veya hassas veri paylaşmayınız.
Ana Sayfaya Dön