This repository contains official ONLYOFFICE DocSpace integration samples.
It provides practical, ready-to-use examples that demonstrate different ways to interact with DocSpace: REST API, webhooks, OAuth 2.0, and the JavaScript SDK.
These samples are intended for developers and integrators who want to:
- ⚙️ automate DocSpace administration and content management,
- 🔗 integrate DocSpace with third-party systems,
- 🧩 embed DocSpace UI into their applications,
- 🔔 build event-driven workflows using webhooks.
All examples are self-contained, runnable, and focused on a specific integration scenario.
The samples are grouped by integration type and technology:
docspace-samples/
├── api-backend/
│ ├── nodejs/
│ └── python/
├── webhooks/
│ ├── nodejs/
│ └── python/
├── js-sdk/
├── oauth2/
└── LICENSE
Backend samples demonstrate how to work with the DocSpace REST API (/api/2.0/...).
They are implemented as standalone scripts, where each file represents a single API use case.
Supported languages:
- 🟢 Node.js
- 🐍 Python
Typical scenarios include:
- user and group management,
- room and file operations,
- access control and security settings,
- backups and portal maintenance,
- administrative automation.
Each language directory contains its own README with detailed instructions:
Webhook samples demonstrate how to receive and process DocSpace events in real time.
They show how to:
- expose webhook endpoints,
- validate incoming requests,
- react to DocSpace events using backend logic or API calls.
Supported languages:
- 🟢 Node.js
- 🐍 Python
See:
JavaScript SDK samples demonstrate frontend integration with DocSpace.
They include examples of:
- embedding DocSpace Manager UI,
- using room and file selectors,
- building custom user flows around the SDK.
These samples are suitable for:
- SaaS integrations,
- custom portals,
- UI prototyping and demos.
👉 See: JavaScript SDK samples
OAuth samples demonstrate how to authenticate users using OAuth 2.0 instead of API keys or personal access tokens.
They are recommended for:
- multi-user integrations,
- public or third-party applications,
- long-running services acting on behalf of users.
👉 See: OAuth 2.0 samples
Depending on the integration type, the following authentication methods are used:
- API key / Personal Access Token — simple authentication for scripts and demos
- OAuth 2.0 — user-based authentication for applications
- Webhook secrets — request verification for webhook receivers
Authentication details are documented in each section README.
-
DocSpace API overview
https://api.onlyoffice.com/docspace/ -
DocSpace Backend API reference
https://api.onlyoffice.com/docspace/api-backend/get-started/basic-concepts/ -
JavaScript SDK documentation
https://api.onlyoffice.com/docspace/javascript-sdk/get-started/ -
OAuth 2.0 documentation
https://api.onlyoffice.com/docspace/api-backend/get-started/authentication/oauth2/ -
Webhooks documentation
https://api.onlyoffice.com/docspace/api-backend/get-started/how-it-works/webhooks/
This project is licensed under the Apache License 2.0.
See the LICENSE file for details.