PHPackages                             mr4online/nextcloud-api-wrapper - 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. mr4online/nextcloud-api-wrapper

ActiveLibrary[API Development](/categories/api)

mr4online/nextcloud-api-wrapper
===============================

A simple wrapper around nextcloud user provisioning api

1.0.2(1y ago)07MITPHPPHP &gt;=8.4

Since Apr 28Pushed 1y agoCompare

[ Source](https://github.com/MR4online/nextcloud-api-wrapper)[ Packagist](https://packagist.org/packages/mr4online/nextcloud-api-wrapper)[ RSS](/packages/mr4online-nextcloud-api-wrapper/feed)WikiDiscussions master Synced 1mo ago

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

Nextcloud API wrapper for PHP
=============================

[](#nextcloud-api-wrapper-for-php)

> ⚠️ **IMPORTANT**: this is a fork of:  with the goal to keep dependencies and code updated. Some code may change ;-) Testing with PHP8.4 &amp; Nextcloud 31+ WIP

This is a simple php wrapper around

- [user provisioning api](https://docs.nextcloud.com/server/12/admin_manual/configuration_user/user_provisioning_api.html)
- [shares api](https://docs.nextcloud.com/server/12/developer_manual/core/ocs-share-api.html)

which allows you to manage your nextcloud instance dynamically. It's meant to be the closest possible to the API, every parameter is available and method names should be understandable enough, dont hesitate to make use of the api documentation seeking help on what params are available for each method.

This library was partially tested with nextcloud 12 and 13. It was developed to fit my needs but I implemented all remaining methods. If you find any bug, don't hesitate to open an issue.

##### Warning

[](#warning)

> Nextcloud API uses basic http auth, which means username and password are not encoded and travel the internet as clearly as possible. Make sure to enforce it using SSL.

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

[](#installation)

Install it with composer

```
composer require sysmoh/nextcloud-api-wrapper

```

Basic usage
-----------

[](#basic-usage)

The library depends on Guzzle to make requests and Symfony's options resolver.

```
use NextcloudApiWrapper\Wrapper;

//The base path to Nextcloud api entry point, dont forget the last '/'
$basePath   = 'http://my.domain.com/nextcloud/ocs/';
$username   = 'admin';
$password   = 'potatoes';

$wrapper    = Wrapper::build($basePath, $username, $password);

// https://docs.nextcloud.com/server/12/admin_manual/configuration_user/user_provisioning_api.html
$userClient                 = $wrapper->getUsersClient();
$groupsClient               = $wrapper->getGroupsClient();
$appsClient                 = $wrapper->getAppsClient();

// https://docs.nextcloud.com/server/12/developer_manual/core/ocs-share-api.html
$sharesClient               = $wrapper->getSharesClient();
$federatedCloudSharesClient = $wrapper->getFederatedCloudSharesClient();

//Instance of \NextcloudApiWrapper\NextcloudResponse
$response   = $userClient->getUsers();
$code       = $response->getStatusCode();   //status code
$users      = $response->getData();         //data as array
$message    = $response->getStatus();       //status message
$guzzle     = $response->getRawResponse();  //Guzzle response
```

### Making your own requests

[](#making-your-own-requests)

If you'd like to perform your own requests, you can use the underlying nextcloud connection class to perform them.

```
$connection = new \NextcloudApiWrapper\Connection($basePath, $username, $password);

//To perform simple requests
$response   = $connection->request('GET', 'cloud/users');

//To perform requests which needs the 'application/x-www-form-urlencoded' header
//and are not performed in POST
$response   = $connection->pushDataRequest('PUT', 'cloud/' . $username . '/disable');

//To perform requests which holds some values to submit
$response   = $connection->submitRequest('POST', 'cloud/users', [
    'userid'    => 'potatoes',
    'password'  => 'tortilla'
]);
```

### Licence

[](#licence)

**MIT**

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance48

Moderate activity, may be stable

Popularity4

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

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

Every ~0 days

Total

3

Last Release

385d ago

### Community

Maintainers

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

---

Top Contributors

[![ovesco](https://avatars.githubusercontent.com/u/8458666?v=4)](https://github.com/ovesco "ovesco (16 commits)")[![safabr](https://avatars.githubusercontent.com/u/7498992?v=4)](https://github.com/safabr "safabr (3 commits)")[![kler](https://avatars.githubusercontent.com/u/966132?v=4)](https://github.com/kler "kler (2 commits)")[![MR4online](https://avatars.githubusercontent.com/u/17498992?v=4)](https://github.com/MR4online "MR4online (1 commits)")

---

Tags

apiwrappernextcloud

### Embed Badge

![Health badge](/badges/mr4online-nextcloud-api-wrapper/health.svg)

```
[![Health](https://phpackages.com/badges/mr4online-nextcloud-api-wrapper/health.svg)](https://phpackages.com/packages/mr4online-nextcloud-api-wrapper)
```

###  Alternatives

[gabrielbull/ups-api

PHP UPS API

4642.4M10](/packages/gabrielbull-ups-api)[sysmoh/nextcloud-api-wrapper

A simple wrapper around nextcloud user provisioning api

177.3k2](/packages/sysmoh-nextcloud-api-wrapper)[wtfzdotnet/php-tmdb-api

PHP wrapper for TMDB (TheMovieDatabase) API v3. Supports two types of approaches, one modelled with repositories, models and factories. And the other by simple array access to RAW data from The Movie Database.

4252.9k](/packages/wtfzdotnet-php-tmdb-api)[dariusiii/tmdb-laravel

Laravel Package for TMDB ( The Movie Database ) API. Provides easy access to the wtfzdotnet/php-tmdb-api library.

1821.1k](/packages/dariusiii-tmdb-laravel)[walle89/swedbank-json

Unofficial API client for the Swedbank's and Sparbanken's mobile apps in Sweden.

752.5k](/packages/walle89-swedbank-json)[lasserafn/laravel-economic

Economic REST wrapper for Laravel

1118.5k](/packages/lasserafn-laravel-economic)

PHPackages © 2026

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