PHP code example of conkal / owncloud-provisioning-api

1. Go to this page and download the library: Download conkal/owncloud-provisioning-api library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

conkal / owncloud-provisioning-api example snippets




use Conkal\OwncloudProvisioningApi\Owncloud;

$owncloud = new Owncloud('http://example.com/ocs/v1.php/cloud', 'admin', 'secret');

$users = $owncloud->users()->get();

$owncloud->users()->create([
'userid' => 'Frank',
'password' => 'secret',
'email' => '[email protected]',
]);

$user = $owncloud->users()->find('user-id');

$owncloud->users()->update('user-id', 'email', '[email protected]');

$owncloud->users()->disable('user-id');

$owncloud->users()->enable('user-id');

$owncloud->users()->addToGroup('user-id', 'group-name');

$owncloud->users()->removeFromGroup('user-id', 'group-name');

$owncloud->groups()->create('group-name');

$group = $owncloud->groups()->get();