DocSpace.API.SDK 3.6.0

dotnet add package DocSpace.API.SDK --version 3.6.0
                    
NuGet\Install-Package DocSpace.API.SDK -Version 3.6.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="DocSpace.API.SDK" Version="3.6.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DocSpace.API.SDK" Version="3.6.0" />
                    
Directory.Packages.props
<PackageReference Include="DocSpace.API.SDK" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add DocSpace.API.SDK --version 3.6.0
                    
#r "nuget: DocSpace.API.SDK, 3.6.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package DocSpace.API.SDK@3.6.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=DocSpace.API.SDK&version=3.6.0
                    
Install as a Cake Addin
#tool nuget:?package=DocSpace.API.SDK&version=3.6.0
                    
Install as a Cake Tool

DocSpace.API.SDK

The ONLYOFFICE DocSpace SDK for C# 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

Installation

To get started, install the package from NuGet

dotnet add package DocSpace.API.SDK

Usage

To use the API client with a HTTP proxy, set up a System.Net.WebProxy as follows:

Configuration c = new Configuration();
System.Net.WebProxy webProxy = new System.Net.WebProxy("http://myProxyUrl:80/");
webProxy.Credentials = System.Net.CredentialCache.DefaultCredentials;
c.Proxy = webProxy;

Connections

Each API class (specifically the API client within it) will create an instance of HttpClient. This instance is used throughout the class lifecycle and is disposed of when the Dispose method is called.

To better manage connections, it is common practice to reuse the HttpClient and HttpClientHandler (see here for details). To use your own HttpClient instance, just pass it to the API class constructor:

HttpClientHandler yourHandler = new HttpClientHandler();
HttpClient yourHttpClient = new HttpClient(yourHandler);
var api = new RoomsApi(yourHttpClient, yourHandler);

If you want to use an HttpClient but do not have access to its handler (for example, when using IHttpClientFactory in the ASP.NET Core DI context), you can create and configure your HttpClient instance separately and then pass it to the API class constructor:

HttpClient yourHttpClient = new HttpClient();
var api = new RoomsApi(yourHttpClient);

If you want to use an HttpClient but do not have access to its handler (for example, when using IHttpClientFactory in the ASP.NET Core DI context), you can create and configure your HttpClient instance separately and then pass it to the API class constructor:

Here is an example of DI setup in a sample web project:

services.AddHttpClient<RoomsApi>(httpClient =>
   new RoomsApi(httpClient));

Getting Started


Configuration config = new Configuration();
config.BasePath = "https://your-docspace.onlyoffice.com";
// Configure Bearer token for authorization: Bearer
config.AccessToken = "YOUR_BEARER_TOKEN";

// create instances of HttpClient, HttpClientHandler to be reused later with different Api classes
HttpClient httpClient = new HttpClient();
HttpClientHandler httpClientHandler = new HttpClientHandler();
var apiInstance = new ApiKeysApi(httpClient, config, httpClientHandler);
var createApiKeyRequestDto = new CreateApiKeyRequestDto?(); // CreateApiKeyRequestDto? | The request parameters for creating a new API key. (optional) 

try
{
    // Create a user API key
    ApiKeyResponseWrapper result = apiInstance.CreateApiKey(createApiKeyRequestDto);
    Debug.WriteLine(result);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling ApiKeysApi.CreateApiKey: " + e.Message );
    Debug.Print("Status Code: "+ e.ErrorCode);
    Debug.Print(e.StackTrace);
}

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

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

Look at GitHub.

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.6.0 132 2/10/2026
3.5.0 216 10/20/2025

Minor update