Latest 0.1.0
License MIT
Platforms ios 9.0, osx 10.10, watchos 2.0, tvos 9.0, requires ARC


CocoaPods compatible
Carthage compatible
Swift Package Manager compatible


Swift library for accessing Synology NAS and use DiskStation APIs.

Tools :

  • Resolve NAS host/ip base on QuickConnectId
  • List available APIs
  • Login with encryption


Swift 5

With Cocoapods:

pod 'SynologySwift'

With Carthage:

github "Thomaslegravier/SynologySwift"


import SynologySwift

Resolve DS reachable interface for a specific QuickConnectId :

SynologySwift.resolveURL(quickConnectId: "your-quick-id") { (result) in
    switch result {
    case .success(let data):
        let dsPort = data.port
        let dsHost =
    case .failure(let error): break

List available APIs on your DS :

SynologySwift.resolveAvailableAPIs { (result) in
    switch result {
    case .success(let data):
        for service in data.apiList! {
            let serviceName = service.key        // Example : SYNO.API.Auth
            let servicePath = service.value.path // Example : auth.cgi
    case .failure(let error): break

Auth connection with encryption :

SynologySwift.login(quickConnectid: "your-quick-id", sessionType: "DownloadStation", login: "login", password: "password", useDefaultCacheApis: false) { (result) in
    switch result {
    case .success(let data):
        let accountName = data.account // Account name
        let sessionId = data.sid       // Sid param for futher connected calls
    case .failure(let error): break
/* NB : Set 'useDefaultCacheApis' for faster login. If true, we use default auth and encryption APIs paths, instead fetch all available APIs on your DS. Use at your own risk. */

Get info for a specific service

let dlService = SynologySwift.serviceInfos(serviceName: "SYNO.DownloadStation.Info")
let path = dlService.path

Logout :

let dsAuthInfos = SynologySwiftAuth.DSAuthInfos(sid: "XXXXXXXXX", account: "account-name", dsInfos: SynologySwiftURLResolver.DSInfos(quickId: "your-quick-id", host: "XXXXXXX", port: 5000))
SynologySwift.logout(dsAuthInfos: dsAuthInfos, sessionType: "DownloadStation") { (result) in
    switch result {
    case .success(_):         print("Success logout")
    case .failure(let error): print(error)
/* NB : Use auth infos from your last login session to perform logout. */


Login helper:

  • Resolve automatically your DS host base on the quickConnectId
  • List available APIs on your DS
  • Fetch encryption details
  • Login with your account informations.
  • Get specific service info path
  • Logout from a specific session

Your login and password are encrypted and not stored.


  • Thanks to @Frizlab fro RSA/AES encryption part.
  • Thanks to @soyersoyer for SwCrypt implementation RSA part

Latest podspec

    "name": "SynologySwift",
    "version": "0.1.0",
    "summary": "Swift library for accessing Synology NAS and use DiskStation APIs",
    "description": "Swift library for accessing Synology NAS. Resolve host/iP of your NAS with a QuickConnectId and connect by APIs throught encryption service.",
    "homepage": "",
    "license": "MIT",
    "authors": {
        "Thomas Le Gravier": "[email protected]"
    "social_media_url": "",
    "requires_arc": true,
    "swift_versions": "5.0",
    "source": {
        "git": "",
        "tag": "0.1.0"
    "source_files": "Sources/SynologySwift/**/*.swift",
    "platforms": {
        "ios": "9.0",
        "osx": "10.10",
        "watchos": "2.0",
        "tvos": "9.0"

Pin It on Pinterest

Share This