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

ActiveLibrary[API Development](/categories/api)

sn-chernyshev/nextcloud-api-wrapper
===================================

A simple wrapper around nextcloud user provisioning api

13PHP

Since Aug 10Pushed 3y agoCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

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

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

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 SNChernyshev/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

15

—

LowBetter than 3% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity25

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/1e3eab0484774605ba9633aeead6aacfd372bf0a768cbcc44274168d6c392a36?d=identicon)[SNChernyshev](/maintainers/SNChernyshev)

---

Top Contributors

[![ovesco](https://avatars.githubusercontent.com/u/8458666?v=4)](https://github.com/ovesco "ovesco (16 commits)")[![sn-chernyshev](https://avatars.githubusercontent.com/u/8165430?v=4)](https://github.com/sn-chernyshev "sn-chernyshev (4 commits)")[![kler](https://avatars.githubusercontent.com/u/966132?v=4)](https://github.com/kler "kler (2 commits)")

### Embed Badge

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

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

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

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

A PHP wrapper for Twilio's API

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

GitHub API v3 client

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

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

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