Unofficial Circle SDK for PHP
This is a Object Oriented wrapper for the Circle API, written with PHP. The full Circle API documentation can be found here.
To see full documentation visit the official documentation
- PHP >= 8.1 (tested through PHP 8.5)
- A PSR-17 implementation
- A PSR-18 implementation
This package is decoupled from any HTTP messaging client with help by HTTPlug. For this reason you need to install a PSR-17 and PSR-18 implementation packages. Example: composer require symfony/http-client nyholm/psr7.
Require the package with composer:
composer require adrosoftware/circle-so-api-php-sdkCreate an instance on your codebase as follows and then you will be good to start interacting with the Circle API.
<?php
declare(strict_types=1);
use AdroSoftware\CircleSoSdk\CircleSo;
$circleSo = CircleSo::make('5up3r53cr3770k3n');
// Interact with the API.
$me = $circleSo->me()->info();The V1 client covers the complete published API surface, including communities, members, spaces, space groups, posts, comments, messages, events, attendees, subscriptions, charges, likes, tags, courses, topics, notifications, contacts, profile fields, and flagged content.
The SDK also covers every operation currently published in Circle's Admin API V2, Headless Auth API, and Headless Member API specifications:
use AdroSoftware\CircleSoSdk\Admin;
use AdroSoftware\CircleSoSdk\HeadlessAuth;
use AdroSoftware\CircleSoSdk\HeadlessMember;
$admin = Admin::make($adminApiToken, version: 2);
$members = $admin->communityMembers()->all(['page' => 1]);
$auth = HeadlessAuth::make($headlessApiToken);
$tokens = $auth->tokens()->createGetAnAuthToken([
'email' => 'member@example.com',
]);
$member = HeadlessMember::make($tokens['access_token']);
$spaces = $member->spaces()->getListOfSpaces();The unified admin entry point supports both published API versions. Version 2 is the default, while V1 can be selected explicitly:
$adminV1 = Admin::make($adminApiToken, version: 1);
$adminV2 = Admin::make($adminApiToken, version: 2);The existing CircleSo::make() and AdminV2::make() entry points remain
available for backward compatibility.
Each client also exposes raw() for newly released Circle routes that are not
yet represented by a named resource method.
This package is licensed under the MIT License - see the LICENSE file for details
This library is maintained by:
See all the contributors here
