Kategori listesini ve kategoriye detay bilgilerini döndürür.
| API URL | Method | Response |
|---|---|---|
| /api/categories | GET | application/json |
Parametreler
| Parametre | Açıklama | Tür | Zorunlu |
|---|---|---|---|
| id | id numaralı dile ait kategoriler. | Int | Evet |
<?php
header('Content-type: application/json');
$id = 1;
$apiUri = "http://siteadresiniz.com/api/categories/{$id}";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $apiUri);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, false);
curl_setopt($ch, CURLOPT_USERPWD, "username:password");
exit(curl_exec($ch));
[
{
"id": 1,
"sso_img": "",
"title": "test",
"seo_title": "test",
"slug": "test",
"description": ""
}
]
Kategori detayını getirir.
| API URL | Method | Response |
|---|---|---|
| /api/categories/get/{$langId}/{$id} | GET | application/json |
Parametreler
| Parametre | Açıklama | Tür | Zorunlu |
|---|---|---|---|
| langId | id numaralı dile ait kategoriler | Int | Evet |
| id | Kategori id | Int | Evet |
<?php
header('Content-type: application/json');
$langId = 1;
$id = 1;
$apiUri = "http://siteadresiniz.com/api/categories/get/{$langId}/{$id}";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $apiUri);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, false);
curl_setopt($ch, CURLOPT_USERPWD, "username:password");
exit(curl_exec($ch));
{
"id": 1,
"sso_img": "",
"title": "test",
"seo_title": "test",
"slug": "test",
"description": "",
"subItems": [
]
}
Kategoriye ait alt kategori varsa subItems anahtarına obje olarak eklenmektedir.