@onlyoffice/docspace-api-sdk
v3.5.0
Published
A simple TypeScript SDK for integrating with the ONLYOFFICE DocSpace API
Readme
@onlyoffice/docspace-api-sdk
The ONLYOFFICE DocSpace SDK for TypeScript is a library that provides tools for integrating and managing DocSpace features within your applications. It simplifies interaction with the DocSpace API by offering ready-to-use methods and models.
For more information, please visit https://helpdesk.onlyoffice.com/hc/en-us
Building
To build and compile the TypeScript sources to JavaScript, use the following commands:
npm install
npm run buildConsuming
To use the SDK in your project, navigate to the root folder of your consuming project and run one of the following commands:
From published package (recommended)
npm install @onlyoffice/docspace-api-sdk --saveFrom local build (not recommended)
npm install PATH_TO_GENERATED_PACKAGE --saveGetting Started
Please follow the building instruction and execute the following TS code:
import { Configuration, ApiKeysApi } from '@onlyoffice/docspace-api-sdk';
const config = new Configuration ({
basePath: "https://your-docspace.onlyoffice.com",
accessToken: "YOUR ACCESS TOKEN",
});
const apiInstance = new ApiKeysApi(config);
const opts: any = {
'createApiKeyRequestDto': //
};
try {
const result = await apiInstance.createApiKey(
opts
);
console.log('API called successfully. Returned data: ', result.data);
} catch (error) {
console.error(error);
}
Documentation For Authorization
Authentication schemes defined for the API:
asc_auth_key
- Type: API key
- API key parameter name: asc_auth_key
- Location: Cookie
Basic
- Type: HTTP basic authentication
Bearer
- Type: Bearer authentication (JWT)
ApiKeyBearer
- Type: API key
- API key parameter name: ApiKeyBearer
- Location: HTTP header
OAuth2
- Type: OAuth
- Flow: accessCode
- Authorization URL: {{authBaseUrl}}/oauth2/authorize
- Token Url: {{authBaseUrl}}/oauth2/token
- Scopes:
- read: Read access to protected resources
- write: Write access to protected resources
OpenId
- Type: OpenId Connect
- OpenId Connect URL: {{authBaseUrl}}/.well-known/openid-configuration
x-signature
- Type: API key
- API key parameter name: x-signature
- Location: Cookie
Documentation for API Endpoints
All URIs are relative to https://your-docspace.onlyoffice.com
