PHPackages                             aqtivite/php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. aqtivite/php

ActiveLibrary[HTTP &amp; Networking](/categories/http)

aqtivite/php
============

PHP SDK for Aqtivite API

v0.1.0(4mo ago)0385↓69%MITPHPPHP ^8.4

Since Feb 15Pushed 4mo agoCompare

[ Source](https://github.com/aqtivite-dev/php)[ Packagist](https://packagist.org/packages/aqtivite/php)[ Docs](https://github.com/aqtivite-dev/php)[ RSS](/packages/aqtivite-php/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependencies (2)Versions (2)Used By (0)

Aqtivite PHP SDK
================

[](#aqtivite-php-sdk)

Aqtivite REST API için resmi PHP SDK'sı.

Gereksinimler
-------------

[](#gereksinimler)

- PHP 8.4+
- Composer

Kurulum
-------

[](#kurulum)

```
composer require aqtivite/php
```

Hızlı Başlangıç
---------------

[](#hızlı-başlangıç)

```
use Aqtivite\Php\Aqtivite;

$client = new Aqtivite('client-id', 'client-secret');
$client->setAccount('kullanici@example.com', 'sifre');
$client->login();

$response = $client->user()->users()->get();
```

Yapılandırma
------------

[](#yapılandırma)

### Test Modu

[](#test-modu)

```
$client = new Aqtivite('client-id', 'client-secret');
$client->testMode(); // api.test.aqtivite.com.tr adresine bağlanır
```

### Özel API Adresi

[](#özel-api-adresi)

```
$client->setBaseUrl('https://custom-api.example.com');
```

### Özel HTTP Transport

[](#özel-http-transport)

SDK varsayılan olarak Guzzle kullanır. İsterseniz `setTransport()` ile kendi HTTP transport'unuzu kullanabilirsiniz (ör: Laravel Http).

```
use Aqtivite\Php\Contracts\HttpTransportInterface;
use Aqtivite\Php\Http\TransportResponse;

class LaravelTransport implements HttpTransportInterface
{
    public function send(string $method, string $url, array $options = []): TransportResponse
    {
        $response = Http::withHeaders($options['headers'] ?? [])
            ->send($method, $url, $options);

        return new TransportResponse(
            statusCode: $response->status(),
            body: $response->json() ?? [],
        );
    }
}

$client = new Aqtivite('client-id', 'client-secret');
$client->setTransport(new LaravelTransport());
```

Kimlik Doğrulama
----------------

[](#kimlik-doğrulama)

### Kullanıcı Adı / Şifre

[](#kullanıcı-adı--şifre)

```
$client = new Aqtivite('client-id', 'client-secret');
$client->setAccount('kullanici@example.com', 'sifre');
$client->login();
```

### Mevcut Token ile Giriş

[](#mevcut-token-ile-giriş)

```
$client = new Aqtivite('client-id', 'client-secret');
$client->setAccount('kullanici@example.com', 'sifre');
$client->setToken('access-token', 'refresh-token');
$client->login();
```

`login()` metodu sırasıyla:

1. Token geçerli mi kontrol eder (`GET /auth`)
2. Geçersizse `refresh_token` ile yeniler
3. Yenileme başarısızsa credential ile tekrar giriş yapar

### API Anahtarı (Yakında)

[](#api-anahtarı-yakında)

```
$client->setApiKey('api-key', 'api-secret');
```

### Token Bilgisi

[](#token-bilgisi)

```
$token = $client->getToken();
$token->accessToken;
$token->refreshToken;
$token->tokenType;
$token->expiresIn;
```

### Token Yenilendiğinde Bildirim

[](#token-yenilendiğinde-bildirim)

Token yenilendiğinde veya yeniden giriş yapıldığında callback tetiklenir. Bu sayede yeni token'ı kalıcı olarak saklayabilirsiniz.

```
$client->onTokenRefresh(function (Token $token) {
    DB::table('oauth_tokens')->update([
        'access_token' => $token->accessToken,
        'refresh_token' => $token->refreshToken,
    ]);
});
```

Kullanım
--------

[](#kullanım)

### Auth

[](#auth)

```
$client->me();      // Giriş yapan kullanıcı bilgisi
$client->logout();  // Oturumu kapat
```

### User Modülü

[](#user-modülü)

```
// Kullanıcılar
$client->user()->users()->get();                                          // Listele
$client->user()->users()->get(filter: ['name' => 'mehmet']);              // Filtrele
$client->user()->users()->get(query: ['page' => 2, 'length' => 20]);    // Sayfalama
$client->user()->users()->find('mehmet.ogmen');                           // Detay
$client->user()->users()->events('mehmet.ogmen');                         // Kullanıcının etkinlikleri

// Etkinlikler
$client->user()->events()->get();                                         // Listele
$client->user()->events()->get(query: ['order' => 'price[desc]']);
$client->user()->events()->find('etkinlik-slug');        // Detay
$client->user()->events()->create([                      // Oluştur
    'event_category_id' => 1,
    'title' => 'Etkinlik Başlığı',
    'started_at' => '2025-01-08T23:00:00.000+03:00',
    'ended_at' => '2025-01-09T00:00:00.000+03:00',
    'is_online' => 'false',
    'location_id' => 1,
    'is_pricable' => 'false',
    'person_capacity' => 0,
    'is_commentable' => 'true',
]);

// Etkinlik Kategorileri
$client->user()->eventCategories()->get();
$client->user()->eventCategories()->find(1);

// Seanslar
$client->user()->occurrences()->get(filter: ['event_id' => 6999]);
$client->user()->occurrences()->find(166);

// Organizatörler
$client->user()->organizers()->get();
$client->user()->organizers()->find('aqtivite');

// Gönderiler
$client->user()->posts()->get();
$client->user()->posts()->create([
    'content' => 'Gönderi içeriği',
    'photos' => ['/path/to/photo.jpg'],
]);

// Arama & Ağ
$client->user()->search('aqtivite');
$client->user()->network();
```

### Common Modülü

[](#common-modülü)

```
// Mekanlar
$client->common()->venues()->get();
$client->common()->venues()->find(1);

// Salonlar
$client->common()->halls()->get();
$client->common()->halls()->find(1);

// Para Birimleri
$client->common()->currencies()->get();

// Bölgeler
$client->common()->regions()->get();
$client->common()->regions()->find(1);

// Ülkeler
$client->common()->countries()->get();
$client->common()->countries()->find(1);

// İller
$client->common()->provinces()->get();
$client->common()->provinces()->find(1);

// İlçeler
$client->common()->districts()->get(filter: ['province_id' => 3, 'name' => 'ala']);
$client->common()->districts()->get(                    // Filter + sayfalama
    filter: ['province_id' => 3],
    query: ['page' => 1],
);
$client->common()->districts()->find(1);

// Mahalleler
$client->common()->neighborhoods()->get();
$client->common()->neighborhoods()->find(1);
```

Response Yapısı
---------------

[](#response-yapısı)

### Standart Response

[](#standart-response)

```
$response = $client->user()->users()->find('mehmet.ogmen');

$response->successful();       // true
$response->failed();           // false
$response->data;               // Veri (array veya object)
$response->elapsedTime;        // Süre
```

### Sayfalanmış Response

[](#sayfalanmış-response)

```
$response = $client->user()->users()->get();

$response->data;               // Veri listesi
$response->total;              // Toplam kayıt
$response->currentPage;        // Mevcut sayfa
$response->lastPage;           // Son sayfa
$response->from;               // Başlangıç
$response->to;                 // Bitiş
$response->hasNextPage();      // Sonraki sayfa var mı?
$response->hasPreviousPage();  // Önceki sayfa var mı?

```

Hata Yönetimi
-------------

[](#hata-yönetimi)

```
use Aqtivite\Php\Exceptions\AuthenticationException;
use Aqtivite\Php\Exceptions\ApiException;
use Aqtivite\Php\Exceptions\AqtiviteException;

try {
    $client->login();
    $response = $client->user()->users()->get();
} catch (AuthenticationException $e) {
    // Kimlik doğrulama hatası
    echo $e->getMessage();
} catch (ApiException $e) {
    // API hatası
    echo $e->getMessage();
    echo $e->getCode();       // HTTP hata kodu
    echo $e->errorType;       // Hata tipi (ör: "app")
} catch (AqtiviteException $e) {
    // Genel SDK hatası
    echo $e->getMessage();
}
```

Lisans
------

[](#lisans)

MIT

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance75

Regular maintenance activity

Popularity15

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 50% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

139d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9e4800fac3175e2175f25894653a0bec431b5ff0a920c57d89cbf84a5574685a?d=identicon)[aqtivite](/maintainers/aqtivite)

---

Top Contributors

[![x-adam](https://avatars.githubusercontent.com/u/60411758?v=4)](https://github.com/x-adam "x-adam (7 commits)")[![X-Adam](https://avatars.githubusercontent.com/u/60411758?v=4)](https://github.com/X-Adam "X-Adam (7 commits)")

---

Tags

phpapisdkrestaqtivite

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/aqtivite-php/health.svg)

```
[![Health](https://phpackages.com/badges/aqtivite-php/health.svg)](https://phpackages.com/packages/aqtivite-php)
```

###  Alternatives

[xeroapi/xero-php-oauth2

Xero official PHP SDK for oAuth2 generated with OpenAPI spec 3

1054.7M18](/packages/xeroapi-xero-php-oauth2)[onesignal/onesignal-php-api

A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com

34216.9k2](/packages/onesignal-onesignal-php-api)[huaweicloud/huaweicloud-sdk-php

Huawei Cloud SDK for PHP

1830.8k2](/packages/huaweicloud-huaweicloud-sdk-php)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

273.0k](/packages/eslazarev-wildberries-sdk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
