Skip to content

plneto/Synology.Api.Client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Synology API Client (.NET/C#) Build status Test status NuGet Version NuGet Downloads

A client written in .NET/C# for the Synology API - https://www.synology.com/en-us/support/developer#tool

⚠️ WORK IN PROGRESS

I've only implemented the endpoints that I'm currently using but please feel free to request changes or submit contributions.

Usage:

const string dsmUrl = "http://192.168.0.1:5001/";

var client = new SynologyClient(dsmUrl);

// Retrieve all API description objects
var apiInfo = await client.InfoApi().QueryAsync();

// Authenticate
await client.LoginAsync("username", "password");

// List all shares
var shares = await client.FileStationApi().ListEndpoint().ListSharesAsync();

// Upload file
var uploadResult = await client.FileStationApi().UploadEndpoint().UploadAsync("path_to_file", "destination");

// End session
await client.LogoutAsync(session);

APIs Implemented

SYNO.API Methods
Auth login logout
Info query
SYNO.FileStation Methods
List list list_share
Search start list
Upload upload
CopyMove start status stop
CreateFolder create
Extract start status stop list
SYNO.DownloadStation Methods
Info Info GetConfig SetServerConfig
Task List Create Delete Pause Resume

Example on how to ignore certificate validation for e.g. self signed certificates:

You need to inject your own HttpClient with a modified HttpClientHandler.

const string dsmUrl = "http://192.168.0.1:5001/";

var handler = new HttpClientHandler();
//This disables all certificate validation. It is not recommended (especially in production)!
handler.ServerCertificateCustomValidationCallback = (message, cert, chain, errors) => true;

var httpClient = new HttpClient(handler);

var client = new SynologyClient(dsmUrl, httpClient);

About

.NET/C# client for the Synology API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages