Kategoriler

Kategori listesini ve kategoriye detay bilgilerini döndürür.

API URL Method Response
/api/categories GET application/json

Kategorileri Listeleme

Parametreler

Parametre Açıklama Tür Zorunlu
id id numaralı dile ait kategoriler. Int Evet
 Örnek PHP Kodu
<?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));
 Çıktı
[
  {
    "id": 1,
    "sso_img": "",
    "title": "test",
    "seo_title": "test",
    "slug": "test",
    "description": ""
  }
]

Kategori Detay Getirme

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
Örnek PHP Kodu
<?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));
Çıktı

{
  "id": 1,
  "sso_img": "",
  "title": "test",
  "seo_title": "test",
  "slug": "test",
  "description": "",
  "subItems": [

  ]
}

Kategoriye ait alt kategori varsa subItems anahtarına obje olarak eklenmektedir.