Skip to content

About

📦 A PHP SDK to interact with the circle.so API

Topics

Resources

Stars

4 stars

Watchers

1 watching

Forks

Latest commit

 

History

84 Commits

Folders and files

Repository files navigation

Latest Stable Version Test - PHPUnit License Last commit

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

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

About

📦 A PHP SDK to interact with the circle.so API

Topics

Resources

Stars

4 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages