Skip to content

owncloud/libre-graph-api-php

Repository files navigation

libregraph

Libre Graph is a free API for cloud collaboration inspired by the MS Graph API.

Installation & Usage

Requirements

PHP 8.1 and later.

Composer

To install the bindings via Composer, add the following to composer.json:

{
  "repositories": [
    {
      "type": "vcs",
      "url": "https://github.com/owncloud/libre-graph-api-php.git"
    }
  ],
  "require": {
    "owncloud/libre-graph-api-php": "*@dev"
  }
}

Then run composer install

Manual Installation

Download the files and include autoload.php:

<?php
require_once('/path/to/libregraph/vendor/autoload.php');

Getting Started

Please follow the installation procedure and then run the following:

<?php
require_once(__DIR__ . '/vendor/autoload.php');




// Configure HTTP basic authorization: basicAuth
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()
              ->setUsername('YOUR_USERNAME')
              ->setPassword('YOUR_PASSWORD');


$apiInstance = new OpenAPI\Client\Api\ActivitiesApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$kql = resourceid:a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668 depth:2; // string

try {
    $result = $apiInstance->getActivities($kql);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ActivitiesApi->getActivities: ', $e->getMessage(), PHP_EOL;
}

API Endpoints

All URIs are relative to https://ocis.ocis.rolling.owncloud.works/graph

Class Method HTTP request Description
ActivitiesApi getActivities GET /v1beta1/extensions/org.libregraph/activities Get activities
ApplicationsApi getApplication GET /v1.0/applications/{application-id} Get application by id
ApplicationsApi listApplications GET /v1.0/applications Get all applications
DriveItemApi deleteDriveItem DELETE /v1beta1/drives/{drive-id}/items/{item-id} Delete a DriveItem.
DriveItemApi getDriveItem GET /v1beta1/drives/{drive-id}/items/{item-id} Get a DriveItem.
DriveItemApi updateDriveItem PATCH /v1beta1/drives/{drive-id}/items/{item-id} Update a DriveItem.
DrivesApi createDrive POST /v1.0/drives Create a new drive of a specific type
DrivesApi deleteDrive DELETE /v1.0/drives/{drive-id} Delete a specific space
DrivesApi getDrive GET /v1.0/drives/{drive-id} Get drive by id
DrivesApi updateDrive PATCH /v1.0/drives/{drive-id} Update the drive
DrivesGetDrivesApi listAllDrives GET /v1.0/drives Get all available drives
DrivesGetDrivesApi listAllDrivesBeta GET /v1beta1/drives Alias for '/v1.0/drives', the difference is that grantedtoV2 is used and roles contain unified roles instead of cs3 roles
DrivesPermissionsApi createLink POST /v1beta1/drives/{drive-id}/items/{item-id}/createLink Create a sharing link for a DriveItem
DrivesPermissionsApi deletePermission DELETE /v1beta1/drives/{drive-id}/items/{item-id}/permissions/{perm-id} Remove access to a DriveItem
DrivesPermissionsApi getPermission GET /v1beta1/drives/{drive-id}/items/{item-id}/permissions/{perm-id} Get sharing permission for a file or folder
DrivesPermissionsApi invite POST /v1beta1/drives/{drive-id}/items/{item-id}/invite Send a sharing invitation
DrivesPermissionsApi listPermissions GET /v1beta1/drives/{drive-id}/items/{item-id}/permissions List the effective sharing permissions on a driveItem.
DrivesPermissionsApi setPermissionPassword POST /v1beta1/drives/{drive-id}/items/{item-id}/permissions/{perm-id}/setPassword Set sharing link password
DrivesPermissionsApi updatePermission PATCH /v1beta1/drives/{drive-id}/items/{item-id}/permissions/{perm-id} Update sharing permission
DrivesRootApi createDriveItem POST /v1beta1/drives/{drive-id}/root/children Create a drive item
DrivesRootApi createLinkSpaceRoot POST /v1beta1/drives/{drive-id}/root/createLink Create a sharing link for the root item of a Drive
DrivesRootApi deletePermissionSpaceRoot DELETE /v1beta1/drives/{drive-id}/root/permissions/{perm-id} Remove access to a Drive
DrivesRootApi getPermissionSpaceRoot GET /v1beta1/drives/{drive-id}/root/permissions/{perm-id} Get a single sharing permission for the root item of a drive
DrivesRootApi getRoot GET /v1.0/drives/{drive-id}/root Get root from arbitrary space
DrivesRootApi inviteSpaceRoot POST /v1beta1/drives/{drive-id}/root/invite Send a sharing invitation
DrivesRootApi listPermissionsSpaceRoot GET /v1beta1/drives/{drive-id}/root/permissions List the effective permissions on the root item of a drive.
DrivesRootApi setPermissionPasswordSpaceRoot POST /v1beta1/drives/{drive-id}/root/permissions/{perm-id}/setPassword Set sharing link password for the root item of a drive
DrivesRootApi updatePermissionSpaceRoot PATCH /v1beta1/drives/{drive-id}/root/permissions/{perm-id} Update sharing permission
EducationClassApi addUserToClass POST /v1.0/education/classes/{class-id}/members/$ref Assign a user to a class
EducationClassApi createClass POST /v1.0/education/classes Add new education class
EducationClassApi deleteClass DELETE /v1.0/education/classes/{class-id} Delete education class
EducationClassApi deleteUserFromClass DELETE /v1.0/education/classes/{class-id}/members/{user-id}/$ref Unassign user from a class
EducationClassApi getClass GET /v1.0/education/classes/{class-id} Get class by key
EducationClassApi listClassMembers GET /v1.0/education/classes/{class-id}/members Get the educationClass resources owned by an educationSchool
EducationClassApi listClasses GET /v1.0/education/classes list education classes
EducationClassApi updateClass PATCH /v1.0/education/classes/{class-id} Update properties of a education class
EducationClassTeachersApi addTeacherToClass POST /v1.0/education/classes/{class-id}/teachers/$ref Assign a teacher to a class
EducationClassTeachersApi deleteTeacherFromClass DELETE /v1.0/education/classes/{class-id}/teachers/{user-id}/$ref Unassign user as teacher of a class
EducationClassTeachersApi getTeachers GET /v1.0/education/classes/{class-id}/teachers Get the teachers for a class
EducationSchoolApi addClassToSchool POST /v1.0/education/schools/{school-id}/classes/$ref Assign a class to a school
EducationSchoolApi addUserToSchool POST /v1.0/education/schools/{school-id}/users/$ref Assign a user to a school
EducationSchoolApi createSchool POST /v1.0/education/schools Add new school
EducationSchoolApi deleteClassFromSchool DELETE /v1.0/education/schools/{school-id}/classes/{class-id}/$ref Unassign class from a school
EducationSchoolApi deleteSchool DELETE /v1.0/education/schools/{school-id} Delete school
EducationSchoolApi deleteUserFromSchool DELETE /v1.0/education/schools/{school-id}/users/{user-id}/$ref Unassign user from a school
EducationSchoolApi getSchool GET /v1.0/education/schools/{school-id} Get the properties of a specific school
EducationSchoolApi listSchoolClasses GET /v1.0/education/schools/{school-id}/classes Get the educationClass resources owned by an educationSchool
EducationSchoolApi listSchoolUsers GET /v1.0/education/schools/{school-id}/users Get the educationUser resources associated with an educationSchool
EducationSchoolApi listSchools GET /v1.0/education/schools Get a list of schools and their properties
EducationSchoolApi updateSchool PATCH /v1.0/education/schools/{school-id} Update properties of a school
EducationUserApi createEducationUser POST /v1.0/education/users Add new education user
EducationUserApi deleteEducationUser DELETE /v1.0/education/users/{user-id} Delete educationUser
EducationUserApi getEducationUser GET /v1.0/education/users/{user-id} Get properties of educationUser
EducationUserApi listEducationUsers GET /v1.0/education/users Get entities from education users
EducationUserApi updateEducationUser PATCH /v1.0/education/users/{user-id} Update properties of educationUser
GroupApi addMember POST /v1.0/groups/{group-id}/members/$ref Add a member to a group
GroupApi deleteGroup DELETE /v1.0/groups/{group-id} Delete entity from groups
GroupApi deleteMember DELETE /v1.0/groups/{group-id}/members/{directory-object-id}/$ref Delete member from a group
GroupApi getGroup GET /v1.0/groups/{group-id} Get entity from groups by key
GroupApi listMembers GET /v1.0/groups/{group-id}/members Get a list of the group's direct members
GroupApi updateGroup PATCH /v1.0/groups/{group-id} Update entity in groups
GroupsApi createGroup POST /v1.0/groups Add new entity to groups
GroupsApi listGroups GET /v1.0/groups Get entities from groups
MeChangepasswordApi changeOwnPassword POST /v1.0/me/changePassword Change your own password
MeDriveApi getHome GET /v1.0/me/drive Get personal space for user
MeDriveApi listSharedByMe GET /v1beta1/me/drive/sharedByMe Get a list of driveItem objects shared by the current user.
MeDriveApi listSharedWithMe GET /v1beta1/me/drive/sharedWithMe Get a list of driveItem objects shared with the owner of a drive.
MeDriveRootApi homeGetRoot GET /v1.0/me/drive/root Get root from personal space
MeDriveRootChildrenApi homeGetChildren GET /v1.0/me/drive/root/children Get children from drive
MeDrivesApi listMyDrives GET /v1.0/me/drives Get all drives where the current user is a regular member of
MeDrivesApi listMyDrivesBeta GET /v1beta1/me/drives Alias for '/v1.0/drives', the difference is that grantedtoV2 is used and roles contain unified roles instead of cs3 roles
MeUserApi getOwnUser GET /v1.0/me Get current user
MeUserApi updateOwnUser PATCH /v1.0/me Update the current user
RoleManagementApi getPermissionRoleDefinition GET /v1beta1/roleManagement/permissions/roleDefinitions/{role-id} Get unifiedRoleDefinition
RoleManagementApi listPermissionRoleDefinitions GET /v1beta1/roleManagement/permissions/roleDefinitions List roleDefinitions
TagsApi assignTags PUT /v1.0/extensions/org.libregraph/tags Assign tags to a resource
TagsApi getTags GET /v1.0/extensions/org.libregraph/tags Get all known tags
TagsApi unassignTags DELETE /v1.0/extensions/org.libregraph/tags Unassign tags from a resource
UserApi deleteUser DELETE /v1.0/users/{user-id} Delete entity from users
UserApi exportPersonalData POST /v1.0/users/{user-id}/exportPersonalData export personal data of a user
UserApi getUser GET /v1.0/users/{user-id} Get entity from users by key
UserApi updateUser PATCH /v1.0/users/{user-id} Update entity in users
UserAppRoleAssignmentApi userCreateAppRoleAssignments POST /v1.0/users/{user-id}/appRoleAssignments Grant an appRoleAssignment to a user
UserAppRoleAssignmentApi userDeleteAppRoleAssignments DELETE /v1.0/users/{user-id}/appRoleAssignments/{appRoleAssignment-id} Delete the appRoleAssignment from a user
UserAppRoleAssignmentApi userListAppRoleAssignments GET /v1.0/users/{user-id}/appRoleAssignments Get appRoleAssignments from a user
UsersApi createUser POST /v1.0/users Add new entity to users
UsersApi listUsers GET /v1.0/users Get entities from users

Models

Authorization

openId

bearerAuth

  • Type: Bearer authentication (plain)

basicAuth

  • Type: HTTP basic authentication

Tests

To run the tests, use:

composer install
vendor/bin/phpunit

Author

About this package

This PHP package is automatically generated by the OpenAPI Generator project:

  • API version: v1.0.4
  • Build package: org.openapitools.codegen.languages.PhpNextgenClientCodegen

About

PHP Client for the LibreGraph API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published