adrosoftware / circle-so-api-php-sdk
A PHP SDK to interact with the circle.so API
Package info
github.com/adrosoftware/circle-so-api-php-sdk
pkg:composer/adrosoftware/circle-so-api-php-sdk
Requires
- php: ^8.1.0
- php-http/client-common: ^2.3
- php-http/discovery: ^1.12
- psr/http-client: ^1.0
- psr/http-client-implementation: ^1.0
- psr/http-factory: ^1.0
- psr/http-message: ^1.0 || ^2.0
- symfony/options-resolver: ^6.2
Requires (Dev)
- guzzlehttp/guzzle: ^7.5
- php-http/guzzle7-adapter: ^1.0
- php-http/message: ^1.0
- phpstan/phpstan: ^1.10
- phpunit/phpunit: ^10.0
- squizlabs/php_codesniffer: ^3.7
- symfony/var-dumper: ^6.2
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
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.
Documentation
To see full documentation visit the official documentation
Requirements
- PHP >= 8.1 (tested through PHP 8.5)
- A PSR-17 implementation
- A PSR-18 implementation
How to use it
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-sdk
Create 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.
License
This package is licensed under the MIT License - see the LICENSE file for details
Maintainers
This library is maintained by:
Contributors
See all the contributors here
