# API Kullanımı

API'ye yaptığınız istek sonucu size bir JSON verisi döndürür. Bu veriyi plugin veya skript ile işleyip oyuncularınıza gösterebilirsiniz.

{% hint style="info" %}
Giriş ve Kayıt ol sistemi için Yönetim Paneli > Sistem Ayarları "Auth API" aktif olmalıdır.
{% endhint %}

## Giriş Yap

<mark style="color:green;">`POST`</mark> `https://siteniz.com/apps/api/login.php`

Kullanıcı adı ve şifreyi doğrulayabilirsiniz.

#### Path Parameters

| Name     | Type   | Description                                                    |
| -------- | ------ | -------------------------------------------------------------- |
| token    | String | /apps/main/private/config/app.php içerisindeki APP\_KEY değeri |
| ip       | String | Kullanıcının IP Adresini                                       |
| username | String | Kullanıcı Adı                                                  |
| password | String | Hashlenmemiş şifre                                             |

{% tabs %}
{% tab title="200: OK Başarılı dönüş" %}

```json
{
    'status' => true,
}
```

{% endtab %}

{% tab title="200: OK Şifre Hatalı" %}

```json
{
    'status' => false,
    'message' => "Şifre hatalı!"
}
```

{% endtab %}

{% tab title="200: OK Kullanıcı Bulunamadı" %}

```json
{
    'status' => false,
    'message' => "Kullanıcı bulunamadı!"
}
```

{% endtab %}
{% endtabs %}

## Kayıt Ol

<mark style="color:green;">`POST`</mark> `https://siteniz.com/apps/api/register.php`

Kullanıcıyı kayıt edebilirsiniz.

#### Path Parameters

| Name     | Type   | Description                                                    |
| -------- | ------ | -------------------------------------------------------------- |
| token    | String | /apps/main/private/config/app.php içerisindeki APP\_KEY değeri |
| ip       | String | Kullanıcının IP Adresini                                       |
| username | String | Kullanıcı Adı                                                  |
| email    | String | Eposta Adresi                                                  |
| password | String | Hashlenmemiş şifre                                             |

{% tabs %}
{% tab title="200: OK Başarılı Dönüş" %}

```javascript
{
    'status' => true,
    'accountID' => int, // Tam sayı bir kullanıcı ID'si döner.
}
```

{% endtab %}

{% tab title="200: OK Hatalı İşlem" %}

```javascript
{
    'status' => false,
    'message' => "Hata mesajı burda yazar!"
}
```

{% endtab %}
{% endtabs %}

## Kredi Geçmişi

<mark style="color:blue;">`GET`</mark> `https://siteniz.com/apps/api/credit-history.php`

**Örnek Kullanım:**\
Kullanıcı adı **LeaderOS** olan **2 adet** veriyi getirir.\
<https://premium.leaderos.com.tr/apps/api/credit-history.php?**username**=LeaderOS&**limit**=2\\>
**NOT:** username ve limit parametreleri zorunlu değildir.

#### Path Parameters

| Name     | Type    | Description                                         |
| -------- | ------- | --------------------------------------------------- |
| username | string  | Kullanıcı adına göre filtreleme yapabilirsiniz.     |
| limit    | integer | Kaç adet veri gösterileceğini filtreleyebilirsiniz. |

{% tabs %}
{% tab title="200 Örnek bir JSON formatında geridönüş:" %}

```javascript
[
    {
        accountID: 1,
        username: "demo",
        amount: 12,
        creationDate: "2020-12-21 22:40:11"
    },
    {
        accountID: 2,
        username: "LeaderOS",
        amount: 20,
        creationDate: "2020-12-21 22:39:50"
    }
]
```

{% endtab %}
{% endtabs %}

## Mağaza Geçmişi

<mark style="color:blue;">`GET`</mark> `https://siteniz.com/apps/api/store-history.php`

**Örnek Kullanım:**\
Kullanıcı adı **LeaderOS** olan **2 adet** veriyi gösterir.\
<https://premium.leaderos.com.tr/apps/api/store-history.php?**username**=LeaderOS&**limit**=2\\>
**NOT:** username ve limit parametreleri zorunlu değildir.

#### Path Parameters

| Name     | Type    | Description                                         |
| -------- | ------- | --------------------------------------------------- |
| username | string  | Kullanıcı adına göre filtreleme yapabilirsiniz.     |
| limit    | integer | Kaç adet veri gösterileceğini filtreleyebilirsiniz. |

{% tabs %}
{% tab title="200 Örnek bir JSON formatında geridönüş:" %}

```javascript
[
    {
        accountID: 2,
        username: "LeaderOS",
        serverName: "Factions",
        productName: "250K Para",
        price: 5,
        creationDate: "2020-07-21 22:38:35"
    },
    {
        accountID: 1,
        username: "demo",
        serverName: "Factions",
        productName: "100K Para",
        price: 3,
        creationDate: "2020-07-21 22:38:25"
    }
]
```

{% endtab %}
{% endtabs %}

## En Çok Kredi Yükleyenler

<mark style="color:blue;">`GET`</mark> `https://siteniz.com/apps/api/top-credit-history.php`

**Örnek Kullanım:**\
Kullanıcı adı **LeaderOS** olan **2 adet** veriyi gösterir.\
<https://premium.leaderos.com.tr/apps/api/top-credit-history.php?**username**=LeaderOS&**limit**=2\\>
**NOT:** username ve limit parametreleri zorunlu değildir.

#### Path Parameters

| Name     | Type    | Description                                         |
| -------- | ------- | --------------------------------------------------- |
| username | string  | Kullanıcı adına göre filtreleme yapabilirsiniz.     |
| limit    | integer | Kaç adet veri gösterileceğini filtreleyebilirsiniz. |

{% tabs %}
{% tab title="200 Örnek bir JSON formatında geridönüş:" %}

```javascript
[
    {
        accountID: 1,
        username: "demo",
        amount: 30,
        count: 1, // tek seferde 30 kredi yüklemiş
        creationDate: "2020-12-21 22:40:11"
    },
    {
        accountID: 2,
        username: "LeaderOS",
        amount: 20,
        count: 2, // 2 seferde 20 kredi yüklemiş
        creationDate: "2020-12-21 22:39:50"
    }
]
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://egitim.leaderos.com.tr/api-kullanimi.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
