PHPackages                             schoolsfocus/sf-webcontents-api-client - 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. [API Development](/categories/api)
4. /
5. schoolsfocus/sf-webcontents-api-client

ActiveLibrary[API Development](/categories/api)

schoolsfocus/sf-webcontents-api-client
======================================

A PHP client for interacting with the SchoolsFocus Webcontents API, providing methods to fetch website content, events, media, system data, and website menu.

v1.0.0(8mo ago)05MITPHPPHP &gt;=7.2

Since Aug 20Pushed 8mo agoCompare

[ Source](https://github.com/SchoolsFocus/sf-webcontents-api-client)[ Packagist](https://packagist.org/packages/schoolsfocus/sf-webcontents-api-client)[ Docs](https://github.com/SchoolsFocus/sf-webcontents-api-client)[ RSS](/packages/schoolsfocus-sf-webcontents-api-client/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

sf-webcontents-api-client
=========================

[](#sf-webcontents-api-client)

Introduction
------------

[](#introduction)

The `sf-webcontents-api-client` is a PHP package designed to provide a simple and convenient way to interact with the SchoolsFocus Webcontents API. This package allows developers to easily fetch website content, events, media, system data, and website menu structures from the Webcontents service. It is framework-agnostic, meaning it can be used with any PHP framework or even in vanilla PHP applications.

Installation
------------

[](#installation)

To install the `sf-webcontents-api-client`, you can use Composer. Run the following command in your terminal:

```
composer require schoolsfocus/sf-webcontents-api-client
```

Usage
-----

[](#usage)

### Initialization

[](#initialization)

To use the `WebcontentsApiClient`, you need to create an instance of the class and provide the API URL and API key.

```
use SfWebcontentsApiClient\WebcontentsApiClient;

$client = new WebcontentsApiClient([
    'api_url' => 'https://your-api-url.com/',
    'api_key' => 'your-api-key'
]);
```

### Fetching Website Content

[](#fetching-website-content)

To fetch website content, use the `fetchContent` method.

```
$content = $client->fetchContent([
    'name' => 'example_content',
    'limit' => 10
]);
```

#### Parameters:

[](#parameters)

- `name` (string): The exact name of the content item.
- `prefix` (string): A prefix to search for content items.
- `id` (int): The specific ID of a content item.
- `limit` (int): The maximum number of results to return.
- `start` (int): The starting offset for pagination.
- `has_uploaded_file` (bool|string): Filter for content with an associated file.
- `content_type` (string): Filter by type (e.g., 'slider\_image', 'page', 'content').

#### Return Value:

[](#return-value)

Returns an associative array containing the API response.

### Fetching Events

[](#fetching-events)

To retrieve events, use the `fetchEvents` method.

```
$events = $client->fetchEvents([
    'timeline' => 'upcoming',
    'type' => 'event',
    'limit' => 5
]);
```

#### Parameters:

[](#parameters-1)

- `timeline` (string): Filter by time ('upcoming', 'past', 'previous').
- `type` (string): The type of event ('event', 'blog', 'news', etc.).
- `limit` (int): The maximum number of results to return.
- `start` (int): The starting offset for pagination.
- `id` (int): The specific ID of an event.

#### Return Value:

[](#return-value-1)

Returns an associative array containing the API response.

### Fetching Media Gallery

[](#fetching-media-gallery)

To fetch media items, use the `fetchMediaGallery` method.

```
$media = $client->fetchMediaGallery([
    'mediaType' => 'images',
    'limit' => 10
]);
```

#### Parameters:

[](#parameters-2)

- `mediaType` (string): The type of media ('images', 'videos').
- `limit` (int): The maximum number of results to return.
- `start` (int): The starting offset for pagination.
- `id` (int): The specific ID of a gallery item.

#### Return Value:

[](#return-value-2)

Returns an associative array containing the API response.

### Fetching System Data

[](#fetching-system-data)

To retrieve general system configuration and data, use the `fetchSystemData` method.

```
$systemData = $client->fetchSystemData();
```

#### Return Value:

[](#return-value-3)

Returns an associative array containing the API response.

### Fetching Website Menu

[](#fetching-website-menu)

To get the navigation menu structure, use the `fetchWebsiteMenu` method.

```
$menu = $client->fetchWebsiteMenu([
    'menuLevel' => 'parent'
]);
```

#### Parameters:

[](#parameters-3)

- `menuLevel` (string): The level of the menu to fetch ('parent', 'child\_level\_1', 'child\_level\_2').
- `parentId` (int): The ID of the parent menu item (required for child levels).

#### Return Value:

[](#return-value-4)

Returns an associative array containing the API response.

License
-------

[](#license)

This package is licensed under the MIT License. See the LICENSE file for more details.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance62

Regular maintenance activity

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity30

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% 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

262d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f41e448e2c61b6d3a5c18492c6e63ff4c4024370c3c5e2f8ca2e347488db11d1?d=identicon)[preciousfocus](/maintainers/preciousfocus)

---

Top Contributors

[![preciousfocus](https://avatars.githubusercontent.com/u/36500463?v=4)](https://github.com/preciousfocus "preciousfocus (5 commits)")

### Embed Badge

![Health badge](/badges/schoolsfocus-sf-webcontents-api-client/health.svg)

```
[![Health](https://phpackages.com/badges/schoolsfocus-sf-webcontents-api-client/health.svg)](https://phpackages.com/packages/schoolsfocus-sf-webcontents-api-client)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M475](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M270](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M186](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M33](/packages/facebook-php-business-sdk)[microsoft/microsoft-graph

The Microsoft Graph SDK for PHP

65723.5M95](/packages/microsoft-microsoft-graph)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)

PHPackages © 2026

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