PHPackages                             onoffice/sdk - 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. onoffice/sdk

ActiveLibrary[API Development](/categories/api)

onoffice/sdk
============

Official client to communicate with the onOffice API

v0.2.0(6y ago)1352.0k↓29.1%12[4 PRs](https://github.com/onOfficeGmbH/sdk/pulls)1MITPHP

Since Feb 12Pushed 3y ago5 watchersCompare

[ Source](https://github.com/onOfficeGmbH/sdk)[ Packagist](https://packagist.org/packages/onoffice/sdk)[ RSS](/packages/onoffice-sdk/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (8)Used By (1)

onOffice-SDK
============

[](#onoffice-sdk)

[![PHP Composer](https://github.com/onOfficeGmbH/sdk/actions/workflows/php.yml/badge.svg)](https://github.com/onOfficeGmbH/sdk/actions/workflows/php.yml)

This project is the official PHP API client for the [onOffice API](https://apidoc.onoffice.de/)supported by the onOffice GmbH.

- **The HTTP protocol** is used to communicate with the API.
- An **Access Token** and **TLS connection** are used to ensure a **secure**communication with the API.
- The intention is to have **lightweight** client that can be used in other environments

**Table of Contents**

- [Quickstart Example](#quickstart-example)
- [Usage](#usage)
    - [Client](#client)
    - [Parameters](#parameters)
    - [Request](#request)
    - [Response](#response)
- [API Documentation](#api-documentation)
- [Install](#install)
- [Contributing](#contributing)
- [License](#license)

Quickstart Example
------------------

[](#quickstart-example)

```
$sdk = new onOfficeSDK();
$sdk->setApiVersion('stable');

$parametersReadEstate = [
	'data' => [
		'Id',
		'kaufpreis',
		'lage',
	],
	'listlimit' => 10,
	'sortby' => [
		'kaufpreis' => 'ASC',
		'warmmiete' => 'ASC',
	],
	'filter' => [
		'kaufpreis' => [
			['op' => '>', 'val' => 300000],
		],
		'status' => [
			['op' => '=', 'val' => 1],
		],
	],
];

$handleReadEstate = $sdk->callGeneric(onOfficeSDK::ACTION_ID_READ, 'estate', $parametersReadEstate);

$sdk->sendRequests('put the token here', 'and secret here');

var_export($sdk->getResponseArray($handleReadEstate));
```

Checkout the [examples folder](/examples/) to see a possible implementation of this client.

Usage
-----

[](#usage)

### Client

[](#client)

The `onOfficeSDK` is responsible for creating HTTP Requests and receiving HTTP Responses from the official API

```
$sdk = new onOfficeSDK();
$sdk->setApiVersion('stable');
```

Make sure that the correct API version is used for your client. By default this value is set to `stable`.

### Parameters

[](#parameters)

The parameters are transferred as JSON in the HTTP Request. The client uses the official [PHP array notation](https://www.php.net/manual/en/book.json.php)before transforming the array to JSON.

```
$parametersReadEstate = [
	'data' => [
		'Id',
		'kaufpreis',
		'lage',
	],
	'listlimit' => 10,
	'sortby' => [
		'kaufpreis' => 'ASC',
		'warmmiete' => 'ASC',
	],
	'filter' => [
		'kaufpreis' => [
			['op' => '>', 'val' => 300000],
		],
		'status' => [
			['op' => '=', 'val' => 1],
		],
	],
];
```

### Request

[](#request)

To create a request to the API an `ACTION_ID` is needed. The class `onOfficeSDK` defines several constants, that can be used, so there is no need to copy these `ACTION_IDs`.

A token and secret are needed to send a request to the API. Check out the [official API documentation](#api-documentation)for information on how to acquire these credentials.

```
$handleReadEstate = $sdk->callGeneric(onOfficeSDK::ACTION_ID_READ, 'estate', $parametersReadEstate);

$sdk->sendRequests('put the token here', 'and secret here');
```

The return value of `onOfficeSDK::callGeneric` is used to identify the equivalent response value. `onOfficeSDK::callGeneric` can be called multiple times before sending the request to the API via `onOfficeSDK::sendRequests`.

### Response

[](#response)

Use the method `onOfficeSDK::getResponseArray` to fetch the response data for a request. To identify the response of the request, use the value returned by `onOfficeSDK::callGeneric`.

```
var_export($sdk->getResponseArray($handleReadEstate));
```

The response will be a PHP array.

### Difference between `call` and `callGeneric`

[](#difference-between-call-and-callgeneric)

This library will provide two general methods to create the calls to the onOffice API.

- `callGeneric` is used to create simple calls e.g. [Estate searches](https://apidoc.onoffice.de/actions/datensatz-lesen/objekte/)or [reading addresses](https://apidoc.onoffice.de/actions/datensatz-lesen/adressen/)
- `call` can be used more specific for special API Requests. Some API Request need some more information like `identifier`, `resourceId` and `resourceType`to be processed. These can be calls like [Estate files](https://apidoc.onoffice.de/actions/informationen-abfragen/objektdateien/)or [Editing Addresses](https://apidoc.onoffice.de/actions/datensatz-bearbeiten/addresses/)

Check the [API documentation](#api-documentation) for more information.

API Documentation
-----------------

[](#api-documentation)

The API client is developed for the latest version of the official API. Additional information about the API can be [found here](https://apidoc.onoffice.de/).

Install
-------

[](#install)

The recommended way to install this library is through Composer. [New to Composer?](https://getcomposer.org/)

This will install the latest supported version:

```
$ composer require onoffice/sdk:^0.2.0

```

See also the [CHANGELOG](/CHANGELOG.md)for details about version upgrades.

Contributing
------------

[](#contributing)

You want to contribute? Great!

Check out our [contribution rules](/CONTRIBUTING.md) and get started!

License
-------

[](#license)

This project is licensed under the MIT License. See [LICENSE document](/LICENSE).

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity40

Moderate usage in the ecosystem

Community23

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 52.8% 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 ~12 days

Total

2

Last Release

2275d ago

### Community

Maintainers

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

![](https://www.gravatar.com/avatar/99f8d752ac0fdc14297c80aef23da411d926ec5cac249da6b090b99d62594ef3?d=identicon)[jayay](/maintainers/jayay)

---

Top Contributors

[![legionth](https://avatars.githubusercontent.com/u/1578709?v=4)](https://github.com/legionth "legionth (56 commits)")[![dkaisers](https://avatars.githubusercontent.com/u/929028?v=4)](https://github.com/dkaisers "dkaisers (22 commits)")[![jayay](https://avatars.githubusercontent.com/u/2384578?v=4)](https://github.com/jayay "jayay (18 commits)")[![AndrejThomsen](https://avatars.githubusercontent.com/u/88726236?v=4)](https://github.com/AndrejThomsen "AndrejThomsen (4 commits)")[![jreuschenbach](https://avatars.githubusercontent.com/u/45621767?v=4)](https://github.com/jreuschenbach "jreuschenbach (3 commits)")[![Bohn-onOffice](https://avatars.githubusercontent.com/u/61838147?v=4)](https://github.com/Bohn-onOffice "Bohn-onOffice (2 commits)")[![mrcodefinger](https://avatars.githubusercontent.com/u/8933204?v=4)](https://github.com/mrcodefinger "mrcodefinger (1 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/onoffice-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/onoffice-sdk/health.svg)](https://phpackages.com/packages/onoffice-sdk)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

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

A PHP wrapper for Twilio's API

1.6k92.9M272](/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)
