Bu REST API web servisi, veriler veritabanındaki tablolara güvenli bir şekilde erişim sağlar. API key tabanlı kimlik doğrulama sistemi ile sadece yetkili kullanıcılar ve kurumlar verilere erişebilir.
http://webservis2.ibu.edu.tr/api/index.php?path=http://webservis2.ibu.edu.tr/api/index.php?path={table_name}&page=1&limit=10
Tüm API istekleri için geçerli bir API key gereklidir. API key'inizi aşağıdaki yöntemlerden biriyle gönderebilirsiniz:
X-API-Key: your_api_key_here
Authorization: Bearer your_api_key_here
GET http://webservis2.ibu.edu.tr/api/index.php?path=table_name&api_key=your_api_key_here
Aşağıdaki tablolara erişim sağlanabilir:
yok_akademik_academician - Akademik personel yök akademik bilgileriworkers - Çalışan bilgileriactive_students - Aktif öğrenci bilgileriunits - Birim bilgileri| Metod | Açıklama | Endpoint Örneği |
|---|---|---|
| GET | Veri okuma (listeleme veya tek kayıt) | GET /api/index.php?path=table_name |
| Parametre | Açıklama | Örnek |
|---|---|---|
page |
Sayfa numarası (varsayılan: 1) | ?page=2 |
limit |
Sayfa başına kayıt sayısı (varsayılan: 10, maksimum: 100) | ?limit=50 |
column_name |
Filtreleme için sütun adı ve değeri | ?name=Ahmet |
GET http://webservis2.ibu.edu.tr/api/index.php?path=yok_akademik_academician&page=1&limit=10
Headers:
X-API-Key: your_api_key_here
{
"success": true,
"data": [
{
"id": 1,
"author_id": "12345",
"name": "Ahmet Yılmaz",
"title": "Prof. Dr.",
"email": "ahmet@example.com"
}
],
"pagination": {
"page": 1,
"limit": 10,
"total": 1279,
"total_pages": 128
}
}
GET http://webservis2.ibu.edu.tr/api/index.php?path=yok_akademik_academician/1
Headers:
X-API-Key: your_api_key_here
{
"success": true,
"data": {
"id": 1,
"author_id": "12345",
"name": "Ahmet Yılmaz",
"title": "Prof. Dr.",
"email": "ahmet@example.com",
"organization_line": "Üniversite > Fakülte > Bölüm"
}
}
| HTTP Kodu | Açıklama | Örnek Mesaj |
|---|---|---|
| 400 | Bad Request - Geçersiz istek | Geçersiz JSON verisi |
| 401 | Unauthorized - API key bulunamadı veya geçersiz | API key bulunamadı |
| 403 | Forbidden - İzin yok | Bu tabloya erişim izniniz yok |
| 404 | Not Found - Kayıt veya endpoint bulunamadı | Tablo bulunamadı |
| 405 | Method Not Allowed - Desteklenmeyen HTTP metodu | Desteklenmeyen HTTP metodu |
| 500 | Internal Server Error - Sunucu hatası | Sunucu hatası |
Her API key için ayrı ayrı izinler tanımlanabilir:
workers tablosundaki name ve email sütunlarına GET metodu ile erişebilir.
<?php
$apiKey = 'your_api_key_here';
$url = 'http://webservis2.ibu.edu.tr/api/index.php?path=yok_akademik_academician&page=1&limit=10';
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'X-API-Key: ' . $apiKey,
'Content-Type: application/json'
]);
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
$curlError = curl_error($ch);
curl_close($ch);
if ($curlError) {
echo "cURL Hatası: " . $curlError;
} elseif ($httpCode === 200) {
$data = json_decode($response, true);
if ($data) {
print_r($data);
} else {
echo "JSON parse hatası: " . json_last_error_msg();
}
} else {
echo "HTTP Hatası: " . $httpCode . "\n";
echo "Yanıt: " . $response;
}
?>
const apiKey = 'your_api_key_here';
const url = 'http://webservis2.ibu.edu.tr/api/index.php?path=yok_akademik_academician&page=1&limit=10';
fetch(url, {
method: 'GET',
headers: {
'X-API-Key': apiKey,
'Content-Type': 'application/json'
}
})
.then(response => response.json())
.then(data => {
console.log(data);
})
.catch(error => {
console.error('Hata:', error);
});
curl -X GET "http://webservis2.ibu.edu.tr/api/index.php?path=yok_akademik_academician&page=1&limit=10" \
-H "X-API-Key: your_api_key_here" \
-H "Content-Type: application/json"
import requests
api_key = 'your_api_key_here'
url = 'http://webservis2.ibu.edu.tr/api/index.php?path=yok_akademik_academician&page=1&limit=10'
headers = {
'X-API-Key': api_key,
'Content-Type': 'application/json'
}
params = {
'page': 1,
'limit': 10
}
response = requests.get(url, headers=headers, params=params)
if response.status_code == 200:
data = response.json()
print(data)
else:
print(f"Hata: {response.status_code}")