Home

SYNO.API.Auth

image

Contents

1. Parameter Description Value Default Value Availability sort_direction Optional Specify to sort asc or desc asc 1 and later ascending or to sort descending Options include asc sort ascending desc sort descending additional Optional Additional requested real_path owner None 1 and later file information separated bya itime perm comma When an additional mount_point_type option is requested responded _ jor volume_status objects will be provided in the specified additional option Options include m real_path return a real path in volume 7 size return file byte size m owner return information about file owner including user name group name UID and GID 7 time return information about time including last access time last modified time last change time and create time m perm return information about file permission m volume_status return information about volume status including free space total space and read only status Example GET webapi FileStation file_virtual cgi api SYNO FileStation VirtualFolder amp version 1 amp m ethod list amp type cifs amp additional real paths2Cowners2Ctimes2Cperms2Cmount point types 2Cvolume status Response lt data gt object definitions Parameter Type Description Availability total Integer Total number of mount point folders 1 and later offset Integer Requested offset 1 and later folders JSON Array of lt
2. folders false List writable and read only shared folders 21 Copyright Synology Inc All Rights Reserved 22 Synology File Station Official API Parameter Description Value Default Value Availability additional Optional Additional requested file freal_path None 1 and later information separated by commas _ jowner time When an additional option is perm requested responded objects will be mount_point provided in the specified additional _type option sync_share or Options include volume_stat 7 real_path return a real path in lus volume m size return file byte size 7 owner return information about file owner including user name group name UID and GID E time return information about time including last access time last modified time last change time and create time m perm return information about file permission m mount_point_type return a type of a virtual file system of a mount point m volume_status return volume statuses including free space total space and read only status Example GET webapi FileStation file share cgi api SYNO FileStation List amp version 1 amp method list_ share additional real paths2Cowner 2Ctime Response lt data gt object definitions Parameter Type Description Availability total Integer Total number of shared folders 1 and later offset Integer R
3. GET webapi FileStation file dirSize cgi api SYNO FileStation DirSize amp version 1 amp method status amp taskid 51CBD7CD5C76E461 Response lt data gt object definitions finished Boolean If the task is finished or not 1 num_dir Integer Number of directories in the queried path s 1 num_file Integer Number of files in the queried path s 1 total_size Integer Accumulated byte size of the queried path s 1 Example finished true Tran Clie a Siy Mrowbim seat Ike S noA Icorcal Size s2O97TI205 57 Copyright Synology Inc All Rights Reserved Synology File Station Official API stop Description Stop to calculate size Availability Since version 1 Request taskid A unique ID for the task which is gotten String None 1 and later from start method Example GET webapi FileStation file dirSize cgi api SYNO FileStation DirSize amp version 1 amp method stop taskid 51CBD7CD5C76E461 Response No specific response It returns an empty success response if completed without error API Error Code No specific API error codes 58 Copyright Synology Inc All Rights Reserved Synology File Station Official API SYNO FileStation MD5 Description Get MD5 of a file This is a non blocking API You need to start it with the start method Then you should poll requests with status method to get the progress status or make a
4. Optional Search for files whose last modified time after the given Linux timestamp in second Linux timestamp in second None 1 and later Copyright Synology Inc All Rights Reserved 37 Synology File Station Official API Parameter Description Value Default Value Availability mtime to Optional Search for files whose Linux None 1 and later last modified time before the given timestamp in Linux timestamp in second second crtime from Optional Search for files whose Linux None 1 and later create time after the given Linux __ timestamp in timestamp in second second crtime to Optional Search for files whose Linux None 1 and later create time before the given Linux timestamp in timestamp in second second atime from Optional Search for files whose Linux None 1 and later last access time after the given timestamp in Linux timestamp in second second atime to Optional Search for files whose Linux None 1 and later last access time before the given _ timestamp in Linux timestamp in second second owner Optional Search for files whose String None 1 and later user name matches this criterion This criterion is case insensitive group Optional Search for files whose String None 1 and later group name matches this criterion This criterion is case insensitive Note Linux timestamp in second defined as the number of seconds that have elapse
5. Useab Ike py maddi ciona Meni Yowner Mg s LOO Irop users neW MOZA Munsee 3 euohaalign perm Tac 4 append true del true Copyright Synology Inc All Rights Reserved Synology File Station Official API Copyright Synology Inc All Rights Reserved 35 Synology File Station Official API Mis eel modet alse POSA AEE real path volumel video 2 txt Memes LAc utimens ac atime 1369964337 Hemets MICRAS Si ctime 1372410504 mtime 1369964408 Mevioe s Manan Aiae ie arcu namen i V2 CXE osien WTCE Zo ice API Error Code No specific API error codes SYNO FileStation Search Description Search files according to given criteria This is a non blocking API You need to start to search files with the start method Then you should poll requests with 1ist method to get more information or make a request with the stop method to cancel the operation Otherwise search results are stored in a search temporary database so you need to call clean method to delete it at the end of operation Overview Availability Since DSM 4 3 Version 1 Copyright Synology Inc All Rights Reserved Method start Description Synology File Station Official API Start to search files according to given criteria If more than one criterion is given in different parameters searched files match all these criteria Availability Since version 1 Reques
6. 72 Response Returns an empty success response if completed without error otherwise returns error object array contains failed IDs clear_invalid Description Remove all expired and broken sharing links Copyright Synology Inc All Rights Reserved 73 Synology File Station Official API Availability Since version 1 Request No parameters are required Example GET webapi FileStation file sharing cgi api SYNO FileStation Sharing amp version 1 method clear invalid Response No specific response It returns an empty success response if completed without error edit Description Edit sharing link s Availability Since version 1 Request Parameter Description Value Default Availability Value id Unique ID s of sharing link s to edit Integer None 1 and later separated by a comma password Optional If empty string is set the String None 1 and later password is removed The max length of the password is 16 characters date_expired Optional The expiration date for the YYYY MM DD_ None 1 and later sharing link using format YYYY MM DD When set to 0 default the sharing link is permanent date _available Optional The available date for the sharing YYYY MM DD None 1 and later link start effective using format YYYY MM DD When set to 0 default the sharing link is valid right after creation Note date of date expired
7. The following table is the overview of all File Station APIs defined in this chapter All File Station APIs are required to login with SYNO API Auth and session FileStation API Name Description SYNO FileStation Info Provide File Station info SYNO FileStation List List all shared folders enumerate files in a shared folder and get detailed file information SYNO FileStation Search Search files on given criteria SYNO FileStation VirtualFolder List all mount point folders of virtual file system ex CIFS or ISO SYNO FileStation Favorite Add a folder to user s favorites or do operations on user s favorites SYNO FileStation Thumb Get a thumbnail of a file SYNO FileStation DirSize Get the total size of files folders within folder s SYNO FileStation MD5 Get MD5 of a file SYNO FileStation CheckPermission Check if the file folder has a permission of a file folder or not SYNO FileStation Upload Upload a file SYNO FileStation Download Download files folders SYNO FileStation Sharing Generate a sharing link to share files folders with other people and perform operations on sharing links SYNO FileStation CreateFolder Create folder s Copyright Synology Inc All Rights Reserved 18 Synology File Station Official API API Name Description SYNO FileStation Rename Rename a file folder
8. When an additional option is requested responded objects will be provided in the specified additional option Options include E real_path return a real path in volume real_path size owner time p erm or type None 1 and later Copyright Synology Inc All Rights Reserved 79 Synology File Station Official API Parameter Description Value Default Value Availability size return file byte size m owner return information about file owner including user name group name UID and GID 7 time return information about time including last access time last modified time last change time and create time perm return information about file permission m type return a file extension search taskid Optional A unique ID for the search String None 1 and later task which is obtained from start method It is used to update the renamed file in the search result Example GET webapi FileStation file rename cgi api SYNO FileStation Rename version 1 amp method r name amp path 2Fvideo S2Ftest amp name test2 Response lt data gt object definitions Parameter Type Description Availability files JSON Style Array of lt file gt objects 1 and later Array lt file gt object definition Same as definition in SYNO FileStation List API with get info method Example Teles 1 Wig izYs Crue name test2
9. Example GET webapi FileStation file sharing cgi api SYNO FileStation Sharing amp version 1 method create amp path 2Ftests2FITRHMA 20445972 0 mp3 Response lt data gt object definitions Parameter Type Description Availability links JSON Style Array Array of lt Shared_Link gt object 1 lt Shared_Link gt object definition Member Type Description Availability path String A file folder path of the sharing link 1 url String Acreated URL of the sharing link 1 id String A created unique ID of the sharing link 1 gqrcode String Base64 encoded image of QR code describing 1 the URL of the sharing link Copyright Synology Inc All Rights Reserved Synology File Station Official API error Integer 0 for creating it successfully otherwise is the 1 error code for failed to create it Example Wil slig esto if Weer oie 310 id y4Lmvpax path test ITEMA 20445972 0 mp3 qrcode iVBORWOKGgoAAAANSUh url http myds com 5000 fbsharing y4Lmvpax HI delete Description Delete one or more sharing links Availability Since version 1 Request id Unique IDs of file sharing link s to be String None 1 and later deleted separated by commas Example GET webapi FileStation file sharing cgi api SYNO FileStation Sharing amp version 1 amp method delete amp id y4Lmvpax
10. comma When an additional ctime crtime option is requested responded posix or type objects will be provided in the specified additional option Options include 48 Copyright Synology Inc All Rights Reserved Synology File Station Official API Parameter Description Value Default Value Availability m real_path return a real path in volume 7 owner return information about file owner including user name group name UID and GID m time return information about time including last access time last modified time last change time and create time 7 perm return information about file permission m mount_point_type return a type of a virtual file system of a mount point Example GET webapi FileStation file_favorite cgi api SYNO FileStation Favorite amp version 1 amp metho d list Response lt data gt object definitions Parameter Type Description Availability total Integer Total number of favorites 1 and later offset Integer Requested offset 1 and later favorites JSON Style Array Array of lt favorite gt objects 1 and later lt favorite gt object definition Parameter Type Description Availability path String Folder path of a user s favorites started with a 1 and later shared folder name String Favorite name 1 and later status String Favorite status 1 and later Values of favorit
11. Moens Wree resta API Error Code Code Description 1200 Failed to rename it More information in lt errors gt object Copyright Synology Inc All Rights Reserved Synology File Station Official API SYNO FileStation CopyMove Description Copy move file s folder s This is a non blocking API You need to start to copy move files with start method Then you should poll requests with status method to get the progress status or make a request with stop method to cancel the operation Overview Availability Since DSM 4 3 Version 1 Method start Description Start to copy move files Availability Since version 1 Request Parameter Description Value Default Value Availability path One or more copied moved String None 1 and later file folder path s starting with a shared folder separated by commas dest_folder_pajAdesitination folder path where String None 1 and later th files folders are copied moved overwrite Optional true overwrite all true false None None 1 and later existing files with the same name false skip all existing files with the same name None do not overwrite or skip existed files If there is any existing files an error occurs error code 1003 remove src Optional true move Boolean false 1 and later filess folders false copy files folders 80 Copyright Synology Inc
12. SYNO FileStation CopyMove Copy Move files folders SYNO FileStation Delete Delete files folders SYNO FileStation Extract Extract an archive and do operations on an archive SYNO FileStation Compress Compress files folders SYNO FileStation BackgroundTask Get information regarding tasks of file operations which are run as the background process including copy move delete compress and extract tasks or perform operations on these background tasks Copyright Synology Inc All Rights Reserved Synology File Station Official API SYNO FileStation Info Description Provide File Station information Overview Availability Since DSM 4 3 Version 1 Method getinfo Description Provide File Station information Request No parameters are required Example GET webapi FileStation info cgi api SYNO FileStation Info amp version 1 method getinfo Response lt data gt object definitions Parameter Type Description Availability is manager Boolean If the logged in user is an administrator 1 and later support virtual String Types of virtual file system which the 1 and later logged user is able to mount on DSM 4 3 supports CIFS and ISO of virtual file system Different types are separated with a comma for example cifs iso support sharing Boolean If the logged in user can sharing 1 and later file s folder s or not hostname String DSM
13. All Rights Reserved 81 Synology File Station Official API accurate_progr Optional true calculate the Boolean true 1 and later ess progress by each moved copied file within sub folder false calculate the progress by files which you give in path parameters This calculates the progress faster but is less precise search taskid Optional A unique ID for the String None 1 and later search task which is gotten from SYNO FileSation Search API with start method This is used to update the search result Example GET webapi FileStation file MVCP cgi api SYNO FileStation CopyMove amp version 1 amp method st art path s2Fvideos2Ftest avi dest folder path 2F 2Fvideot2Ftest Response lt data gt object definitions taskid String A unique ID for the copy move task 1 and later Example geas kidi MPLISSeserom SiNDOWET Di AC Deyo status Description Get the copying moving status Availability Since version 1 Request taskid A unique ID for the copy move task which _ String None 1 and later is obtained from start method Copyright Synology Inc All Rights Reserved Synology File Station Official API Example GET webapi FileStation file MVCP cgi api SYNO FileStation CopyMove amp version 1 method st atus amp taskid FileStation_ 51D00B7912CDEO0BO Response lt data gt object definitions Paramete
14. Description Stop the extract task Availability Since version 1 Request taskid A unique ID for the extract task which is String None 1 and later gotten from start method Example GET webapi FileStation file extract cgi api SYNO FileStation Extract amp version 1 amp method stop amp taskid FileStation 51CBB59C68EFE6A3 Response No specific response It returns an empty success response if completed without error Copyright Synology Inc All Rights Reserved 91 list Description List archived files contained in an archive Availability Since version 1 Synology File Station Official API Request Parameter Description Value Default Availability Value file path An archive file path starting with a shared String None 1 and later folder to list offset Optional Specify how many archived files Integer 0 1 and later are skipped before beginning to return listed archived files in an archive limit Optional Number of archived files Integer 1 1 and later requested 1 indicates to list all archived files in an archive sort by Optional Specify which archived file name name 1 and later information to sort on size pack_size or mtime Options include name file name size file size pack_size file owner mtime last modified time sort_direction Optional Specify to sort ascending orto lasc or desc asc 1 and later sort descending
15. Item IDs of archived Integer None 1 and later files used for extracting files within an archive separated by a comma Item IDs could be listed by requesting list method Example GET webapi FileStation file extract cgi api SYNO FileStation Extract amp version 1 amp method start amp file path 2Fdownload 2Fdownload zip dest folder path 2Fdownload s2Fdownload keep _ Che ceUetereeicSs stbtolder tructoverwi ire talse Response lt data gt object definitions taskid String A unique ID for the extract task 1 Example resh 3 Minit SHTET lei SUCHIS VCS A GAS N status Description Get the extract task status Availability Since version 1 Request taskid A unique ID for the extract task String None 1 and later Copyright Synology Inc All Rights Reserved Synology File Station Official API Example GET webapi FileStation file compress cgi api SYNO FileStation Compress amp version 1 amp metho d status amp taskid FileStation_ 51CBB59C68EFE6A3 Response lt data gt object definitions finished Boolea If the task is finished or not 1 n progress Double The extract progress expressed in range 0 to 1 1 dest_folder path String The requested destination folder for the task 1 Example dest folder path download download MEdmisinecl 3 itelse progress 0 1 stop
16. Options include asc sort ascending desc sort descending codepage Optional The language codepage used for DSM supported DSM 1 and later decoding file name with an archive language Codepa including enu lge cht chs krn Setting ger fre ita spn jpn dan nor sve nld rus plk ptb ptg hun trk or csy password Optional The password for extracting the String None 1 and later file item id Optional Item ID of an archived folder to __ Integer None 1 and later be listed within an archive None or 1 will list archive files in a root folder within an archive Example GET webapi FileStation file extract cgi api SYNO FileStation Extract amp version 1 method Copyright Synology Inc All Rights Reserved Synology File Station Official API list file path 2Fdownload 2Fdownload zip amp sortby name amp sort direction asc item id 1 Response lt data gt object definitions Parameter Type Description Availability items JSON Array of lt Archive_ltem gt objects 1 Style Array lt Archive_ltem Object gt definition Member Type Description Availability itemid Integer Item ID of an archived file in an archive 1 and later name String Filename of an archived file in an archive 1 and later size Integer Original byte size of an archived file 1 and later pack size Integer Archived byte size of an archived file 1 and later mtime String
17. and date available parameter is based on user s DiskStation date Example GET webapi FileStation file sharing cgi api SYNO FileStation Sharing amp version 1 amp method edit amp id y4Lmvpax amp password 123 Response No specific response It returns an empty success response if completed without error Copyright Synology Inc All Rights Reserved Synology File Station Official API Response Objects lt Sharing_Link gt object definition Member Type Description Availability id String A unique ID of a sharing link 1 url String A URL of a sharing link 1 link_owner String A user name of a sharing link owner 1 path String A file or folder path of a sharing link 1 isFolder String Whether the sharing link is for a folder 1 has password Boolean Whether the sharing link has password 1 date expired String The expiration date of the sharing link in the format 1 YYYY MM DD If the value is set to 0 the link will be permanent date available String The date when the sharing link becomes active in the format YYYY MM DD If the value is set to 0 the file sharing link will be active immediately after creation Ti status String The accessibility status of the sharing link might be one of the following 1 valid the sharing link is active KS WH 2 invalid the sharing link is not active because the available date has not arrived yet
18. host name 1 and later 19 Copyright Synology Inc All Rights Reserved Example Synology File Station Official API 20 API Error Code No specific API error codes Copyright Synology Inc All Rights Reserved SYNO FileStation List Description List all shared folders enumerate files in a shared folder and get detailed file information Overview Availability Since DSM 4 3 Version 1 Method list_share Description List all shared folders Synology File Station Official API Availability Since version 1 Parameter Description Value Default Value Availability offset Optional Specify how many shared _ Integer 0 1 and later folders are skipped before beginning to return listed shared folders limit Optional Number of shared folders Integer 0 1 and later requested 0 lists all shared folders sort by Optional Specify which file name user name 1 and later information to sort on group mtime Options include atime name file name ctime user file owner crtime or group file group posix mtime last modified time atime last access time ctime last change time crtime create time posix POSIX permission sort_direction Optional Specify to sort ascending lasc or desc jasc 1 and later or to sort descending Options include asc sort ascending desc sort descending onlywritable Optional true List writable shared true or false jfalse 1 and later
19. in a given folder Availability Since version 1 Request Parameter Description Value Default Value Availability folder path A listed folder path started with a _ String None 1 and later shared folder offset Optional Specify how many files Integer 0 1 and later are skipped before beginning to return listed files limit Optional Number of files Integer 0 1 and later requested 0 indicates to list all files with a given folder sort by Optional Specify which file name size name 1 and later information to sort on user group mtime atime Options include ctime crtime name file name posix or type size file size user file owner group file group mtime last modified time Copyright Synology Inc All Rights Reserved 27 Synology File Station Official API Parameter Description Value Default Value Availability atime last access time ctime last change time crtime create time posix POSIX permission type file extension sort direction Optional Specify to sort ascending or to sort descending Options include asc sort ascending desc sort descending asc or desc asc 1 and later pattern Optional Given glob pattern s to find files whose names and extensions match a case insensitive glob pattern Note 1 Ifthe pattern doesn t contain any glob syntax and of glob syntax will be added at begin and end of the string automatically for par
20. including user name group name UID and GID m time return information about time including last access time last modified time last change time and create time 7 perm return information about file permission m type return a file extension real_path size owner time perm or type None 1 and later Example ET E gt a Qh webapi FileStation file find cgi api SYNO FileStation Search amp version 1 amp method list taskid 51CE617CF57B24E5 amp additional real path 2Csizes2Cowner s2Ctime s2Cperms2Ctype l Copyright Synology Inc All Rights Reserved Synology File Station Official API imit Response lt data gt object definitions Parameter Type Description Availability total Integer Total number of matched files 1 and later offset Integer Requested offset 1 and later finished Boolean If the searching task is finished or not 1 and later files JSON Style Array of lt file gt objects 1 and later Array lt file gt object definitions Same as definition in the List method of SYNO FileStation List API Example Wiebe Im additional owner gres LOO UGROUP LE users Semea O24 user admin Ihe vpermi vacia append true del true exec true read true write true hy Nis acl modets telge posix 644 real path volumel video 12 Westra Op Wiesimenusia 40 Copyright Syn
21. request with the stop method to cancel the operation Overview Availability Since DSM 4 3 Version 1 Method start Description Start to get MD5 of a file Availability Since version 1 Request file path A file path starting with a shared folder for String None 1 and later calculating MD5 value Example GET webapi FileStation file md5 cgi api SYNO FileStation MD5 amp version 1 amp method start amp fi le path 2Fdownloadt2Fdownload zip 59 Response lt data gt object definitions taskid String A unique ID for the task for the calculating MD5 task 1 Copyright Synology Inc All Rights Reserved Synology File Station Official API Example taskid 7 51 BD95028B22ARD status Description Get the status of the calculating MD5 task Availability Since version 1 Request taskid A unique ID for the task which is gotten String None 1 and later from start method Example GET webapi FileStation file md5 cgi api SYNO FileStation MD5 amp version 1 amp method status amp t askid 51CBD95028B22AED Response lt data gt object definitions finished Boolea Check if the task is finished or not 1 n md5 String MD5 of the requested file 1 Example If ine SheGtas truer md5 6336c5a59aa63dd2042783f88e15410a 60 stop Description Stop calculating the MD5 of a file Cop
22. returns an authorized session ID You should keep it and pass it in making other API requests Step 3 Making API Requests Once successfully logged in your application can start to make requests to all available File Station APIs In the next section Making Requests instructions on how to form a valid API request and how to decode response information will be given Step 4 Log out After finishing with the steps above your application can end the login session by making another request to SYNO API Auth API with the Logout method Making Requests There are five basic elements that are used to construct a valid request to any API e API name Name of the API requested e version Version of the API requested e path path of the API The path information can be retrieved by requesting SYNO API Info e method Method of the API requested e _sid Authorized session ID Each API request should pass it which is retrieved from the response of webapi auth cgi via either HTTP HTTPS GET POST method with _ sid argument Otherwise if you pass it within id value of cookie of HTTP HTTPS header this parameter can be ignored And the syntax for the request is as follows GET webapi lt CGI_PATH gt api lt API NAME gt amp version lt VERSION gt amp method lt METHOD gt amp lt PARAMS gt amp si d lt SID gt Here lt PARAMS gt represents the parameters for the requested method which is optional Note all parame
23. s favorites The number of paths must be the same as the number of favorite names in the name parameter The first path parameter corresponds to the first name parameter String None 1 and later name One or more new favrorite names separated by a comma The number of favorite names must be the same as the number of folder paths in the path parameter The first name parameter corresponding to the first path parameter String None 1 and later Example GET webapi FileStation file favorite cgi api SYNO FileStation Favorite amp version l amp metho d replace all amp path 2Fvideos2Cs2Fvideos2Ffav name all videos2Cmy video Response No specific response It returns an empty success response if completed without error API Error Code Code Description 800 A folder path of favorite folder is already added to user s favorites 801 A name of favorite folder conflicts with an existing folder path in the user s favorites 802 There are too many favorites to be added Copyright Synology Inc All Rights Reserved Synology File Station Official API SYNO FileStation Thumb Description Get a thumbnail of a file Note 1 Supported image formats jpg jpeg joe bmp png tif tiff gif arw srf sr2 dcr k25 kdc cr2 crw nef mrw ptx pef raf 3fr erf mef mos orf rw2 dng x3f raw 2 Supported video formats in an index
24. so the above limitation or exclusion may not apply to you This warranty gives you specific legal rights and you may also have other rights which vary from state to state Table of Contents Chapter 1 Introduction Chapter 2 Get Started API WoOnktlOw 22 2822 eei acini Ads alien hehdawa E E A and minal saints 5 MaKING REQUE SIS ieee a E E A E deat eeeeevhelecte nbd E dette Ea 6 Parsing Respons E maania nanea n a a a es inn heaton ye nes 7 GOMMON Error CodeS issena ppn a iei pi aii asosni rnia aeiiae siie eR 9 Working E AD E a a Sane cA Aaa hee A RL ei 10 Chapter 3 Base API APLIS tsei rianne a E AA E EEEE E EDE E E EE EEEE ENEN 13 SY NO APISIMNG rinnen Ai eee AES A a ee E AAE 13 SYNQ APLAU onere n A odes ver seusvezedeai te ocesseveueasstasvevsgecseoosenpons ssevpensatsivcessneiseutaeyy 15 Chapter 4 File Station API PAN l ee ee et ee eee S 17 SY NO FilGStation NO sensorar n a r a dadesaeiivisaatd aetsisiGe os odioes aaa Gs 19 SYNO FileStation List sxicescsscesces ti ves vss cstaen neds esvegcenienBacacoetones r EN E E C ENE A EENET EENE costbas devas 21 SYNO FileStation Search cccccccccsccscsccsscsscscsscsscsecsecsecsecsesscssesessecsecsecsecsessesacsecsecsessecsesaesassassessessesaesaecasesesessesousaecaeeate 35 SYNO FileStation Virtual FOIGCM xz 2 5 x5 cesses sacs esi 5 656s sak des ve ae aded ga GG IA abn WW A A I ANE R 44 SYNO FileStation FAVOr ite svc sesccscsccvcesssesssesszeysvaceadeatavcacesvedessssiteabaseantd
25. virtual folder gt object 1 and later Style Array 45 Copyright Synology Inc All Rights Reserved lt virtual folder gt object definition Synology File Station Official API Parameter Type Description Availability path String Path of a mount point folder 1 and later name String Name of a mount point folder 1 and later additional lt virtual Virtual folder additional object 1 and later folder additional gt object lt virtual folder gt object definition Parameter Type Description Availability real path String Real path started with a volume path 1 and later owner lt owner gt File owner information including user name group 1 and later object name UID and GID time lt time gt object Time information of file including last access time 1 and later last modified time last change time and create time perm lt perm gt File permission information 1 and later object mount _point_ String A type of a virtual file system of a mount point 1 and later type volume_statu lt volume_stat Volume status including free space total space and 1 and later s us gt object read only status lt owner gt lt time gt and lt perm gt object definition Same as definition in the 1ist method of SYNO FileStation List API lt volume_status gt object definition Same as definition in the 1ist_share method of SYNO FileStation List API Exa
26. will not be set in cookie otp code Reserved key DSM 4 2 and later support a 2 step 3 and later verification option with an OTP code If it s enabled the user requires a verification code to log into DSM sessions However WebAPI doesn t support it yet Example GET webapi auth cgi api SYNO API Auth amp version 3 method login amp account admin passwd 1234 5 amp session FileStation amp format cookie Response lt data gt object definitions Parameter Description Availability sid Authorized session ID When the user log in with 2 and later format sid cookie will not be set and each API request should provide a request parameter _sid lt sid gt along with other parameters Example sid ohOCjwhHhwghw Copyright Synology Inc All Rights Reserved Synology File Station Official API Logout Request Session name to be logged out 1 and later session Example GET webapi auth cgi api SYNO API Auth version 1 amp method logout session FileStation Response No specific response It returns an empty success response if completed without error API Error Code 400 No such account or incorrect password 401 Account disabled 402 Permission denied 403 2 step verification code required 404 Failed to authenticate 2 step verification code Copyright Synology Inc All Rights Reserved 17 File Station API API List
27. 3 expired the sharing link expired 4 broken the sharing link broke due to a change in the file path or access permission API Error Code Code Description 2000 Sharing link does not exist 2001 Cannot generate sharing link because too many sharing links exist 2002 Failed to access sharing links Copyright Synology Inc All Rights Reserved SYNO FileStation CreateFolder Description Create folders Overview Availability Since DSM 4 3 Version 1 Method create Description Create folders Availability Since version 1 Request Synology File Station Official API Parameter Description Value Default Value Availability folder path One or more shared folder paths separated by commas If force parent is true and folder path does not exist the folder path will be created If force parent Is false folder path must exist ora false value will be returned The as the number of names in the name parameter The first folder path parameter corresponds to the first name parameter number of paths must be the same String None 1 and later name One or more new folder names separated by commas The number of names must be the in the folder path parameter The first name parameter corresponding to the first folder path parameter same as the number of folder paths String None 1 and later Copyright Synology Inc All Right
28. 3 refreshen Update existing items of an archive if newer on the file system Does not add new files to the archive 4 synchronize Update older files in the archive and add files that are not already in the archive format Optional The compress format zip or 7z Zip 1 and later ZIP or 7z format password Optional The password for the String None 1 and later archive Example GET webapi FileStation file compress cgi api SYNO FileStation Compress amp version l metho d start path S2Fdownload 2FIT O mp3 amp dest file path c2Fdownloads2Fdownload zip amp format zip EMA 20455319 0 mp3 2C 2Fdownload 2FITEMA 20445972 Response lt data gt object definitions Parameter Type Description Availability taskid String A unique ID for the compress task 1 Example Measieicl 3 Via LeSiceieieid SICHERZ SCC S161 eID status Description Get the compress task status Availability Since version 1 Copyright Synology Inc All Rights Reserved Synology File Station Official API Request taskid A unique ID for the compress task String None 1 and later Example GET webapi FileStation file compress cgi api SYNO FileStation Compress amp version 1 amp metho d status amp taskid FileStation_51CBB25CC31961FD Response lt data gt object definitions finished Boolea_ Whether or not the compress task is finished 1 n de
29. CH617CF57B24E5 Response No specific response It returns an empty success response if completed without error Copyright Synology Inc All Rights Reserved SYNO FileStation VirtualFolder Description Synology File Station Official API List all mount point folders of virtual file system ex CIFS or ISO Overview Availability Since DSM 4 3 Version 1 Method list Description List all mount point folders on one given type of virtual file system Availability Since version 1 Request Parameter Description Value Default Value Availability type A type of virtual file systems ex cifs or iso None 1 and later CIFS or ISO offset Optional Specify how many Integer 0 1 and later mount point folders are skipped before beginning to return listed mount point folders in virtual file system limit Optional Number of mount point Integer 0 1 and later folders requested 0 indicates to list all mount point folders in virtual file system sort by Optional Specify which file name user group Name 1 and later information to sort on Options include name file name user file owner group file group mtime last modified time atime last access time ctime last change time crtime create time posix POSIX permission mtime atime ctime crtime or posix 44 Copyright Synology Inc All Rights Reserved Synology File Station Official API
30. Last modified time of an archived file 1 and later path String Relative path of an archived file within in an archive 1 and later is dir Boolean Whether an archived file is a folder 1 and later Example Weems wasn hoi Hl Wis Chic ralser Mariel abel 9 AL Vince s 20 S O2 03 0 0 s i ye 24 Mien IIMA ZOE S77 2 10 ouiisiss 4 Hpac sizes 51200605S patner a ENARA OSOE EmO Haire e517 26464 Wig Cirsa ralse Hicem LCH O e TSA s name I1 pack size path I1 SZOT OS OSes OO rns AA EMA 20455319 0 mp3 a BLAS 39 p EMA 20455319 0 mp3 Wea ze 51896448 URE OIEGLL 2 Copyright Synology Inc All Rights Reserved 93 Synology File Station Official API API Error Code Code Description 1400 Failed to extract files 1401 Cannot open the file as archive 1402 Failed to read archive data error 1403 Wrong password 1404 Failed to get the file and dir list in an archive 1405 Failed to find the item ID in an archive file Copyright Synology Inc All Rights Reserved SYNO FileStation Compress Description Compress file s folder s Synology File Station Official API This is a non blocking API You need to start to compress files with the start method Then you should poll requests with the status method to get compress status or make a request with the stop method to cancel the operation Over
31. List API with get info method Example 76 Toleers M Wateclilies Verein name test path video test Copyright Synology Inc All Rights Reserved Synology File Station Official API 77 API Error Code 1100 Failed to create a folder More information in lt errors gt object 1101 The number of folders to the parent folder would exceed the system limitation Copyright Synology Inc All Rights Reserved 78 SYNO FileStation Rename Description Rename a file folder Overview Availability Since DSM 4 3 Version 1 Method rename Description Rename a file folder Availability Since version 1 Request Synology File Station Official API Parameter Description Value Default Value Availability path One or more paths of files folders to be renamed separated by commas The number of paths must be the same as the number of names in the name parameter The first path parameter corresponds to the first name parameter String None 1 and later name One or more new names separated by commas The number of names must be the same as the number of folder paths in the path parameter The first name parameter corresponding to the first path parameter String None 1 and later additional Optional Additional requested file information separated by commas
32. Taiwan Synology and the Synology logo are trademarks of Synology Inc registered in the United States and other countries Marvell is registered trademarks of Marvell Semiconductor Inc or its subsidiaries in the United States and other countries Freescale is registered trademarks of Freescale Semiconductor Inc or its subsidiaries in the United States and other countries Other products and company names mentioned herein are trademarks of their respective holders Even though Synology has reviewed this document SYNOLOGY MAKES NO WARRANTY OR REPRESENTATION EITHER EXPRESS OR IMPLIED WITH RESPECT TO THIS DOCUMENT ITS QUALITY ACCURACY MERCHANTABILITY OR FITNESS FORA PARTICULAR PURPOSE AS A RESULT THIS DOCUMENT IS PROVIDED AS IS AND YOU THE READER ARE ASSUMING THE ENTIRE RISK AS TO ITS QUALITY AND ACCURACY IN NO EVENT WILL SYNOLOGY BE LIABLE FOR DIRECT INDIRECT SPECIAL INCIDENTAL OR CONSEQUENTIAL DAMAGES RESULTING FROM ANY DEFECT OR INACCURACY IN THIS DOCUMENT even if advised of the possibility of such damages THE WARRANTY AND REMEDIES SET FORTH ABOVE ARE EXCLUSIVE AND IN LIEU OF ALL OTHERS ORAL OR WRITTEN EXPRESS OR IMPLIED No Synology dealer agent or employee is authorized to make any modification extension or addition to this warranty Some states do not allow the exclusion or limitation of implied warranties or liability for incidental or consequential damages
33. ailability Since version 1 Request Parameter Description Value Default Availability Value path One or more deleted file folder path s String None 1 and later started with a shared folder separated by acomma recursive Optional true Recursively delete files Boolean true 1 and later within a folder false Only delete first level file folder If a deleted folder contains any file an error will occur because the folder can t be directly deleted search _taskid Optional A unique ID for the search task Boolean None 1 and later which is gotten from start method It s used to delete the file in the search result Example GET webapi FileStation file delete cgi api SYNO FileStation Delete amp version 1 amp method d lete path 2Fvideos2Fdel folder Response No specific response It returns an empty success response if completed without error API Error Code Code Description 900 Failed to delete file s folder s More information in lt errors gt object Copyright Synology Inc All Rights Reserved 88 Synology File Station Official API SYNO FileStation Extract Description Extract an archive and perform operations on archive files Note Supported extensions of archives zip gz tar tgz tbz bz2 rar 7z iso Overview Availability Since DSM 4 3 Version 1 Method start Description Start to extract a
34. aine 3 olneyee 5 Wodiehir a PNOEOS 1 Decret 2 SWC CSS Sma meta te From the response list it can be observed that there are two shared folders in File Station Let s say you re interested in the shared folder photo and want to know more details about it In this case you can make another request to the get info method In this request you will need to add the parameter additional real path owner time for the method to request detailed objects and transfer them in response Request http myds com 5000 webapi FileStation file share cgi api SYNO FileStation List amp ve rsion 1 method getinfo amp path 2Fphoto amp additional real path owner time perm Copyright Synology Inc All Rights Reserved Synology File Station Official API Response Step 4 Logout When finished with the procedure you should log out of the current session The session will be ended by calling the logout method in SYNO API Auth If you want to log out a specific session you can pass the sid parameter Example 12 Copyright Synology Inc All Rights Reserved 13 Base API API List The following table is the overview of two fundamental APIs defined in this chapter API Name Description SYNO API Info Provide available API info SYNO API Auth Perform login and logout SYNO API Info Overview Availability Since DSM 4 0 Version 1 Method Query Request Parameter Descr
35. bled or not is_acl_ mode Boolean true The privilege of the shared folder is set to be 1 and later ACL mode false The privilege of the shared folder is set to be POSIX mode acl lt acl gt object Windows ACL privilege If a shared folder is set to be 1 and later POSIX mode these values of Windows ACL privileges are derived from the POSIX privilege lt adv_right gt object definition Parameter Type Description Availability disable down Boolean If a non administrator user can download files in this 1 and later load shared folder through SYNO FileStation Download API or not disable list Boolean If a non administrator user can enumerate files in 1 and later this shared folder though SYNO FileStation List API with 1ist method or not disable modi Boolean If a non administrator user can modify or overwrite 1 and later fy files in this shared folder or not lt acl gt object definition Parameter Type Description Availability append Boolean If a logged in user has a privilege to append data or 1 and later create folders within this folder or not del Boolean If a logged in user has a privilege to delete a file a 1 and later folder within this folder or not exec Boolean If a logged in user has a privilege to execute 1 and later files traverse folders within this folder or not read Boolean If a logged in user has a privilege to read data or list 1 and later folder within this folder or not write Boolean If a
36. cccccccccsscsscsssscsscsecsecsecsecsssscsscsessecsecsecsecsscsesassecssssessecaessesassassecsessesaesaecasesesessecausaecaeeats 84 SYNO FileStation Extract si 412ks8 nk ei keke dE nc Re ees 88 SYNO FileStation COMPLeSS ccececsseseseseeseeseeseseseseseeeeeeecseseneeeseeeceeseseneeeeeeeeaeaeaeaeeeeesecseaeeeseeeeeeeeseaeaeaeeeeeeetaeaeaeeeeeeeeesaes 94 SYNO FileStation Background ask s cescssceeseveceetstiveraseniavasteneniantne acini aaviis save mannan E E 98 Appendix A Document Revision History Copyright Synology Inc All Rights Reserved Introduction This File Station Official API developer s guide explains how to expand your applications based on the APIs of File Station allowing your applications to interact with files in DSM via HTTP HTTPS requests and responses This document explains the structure and detailed specifications of various File Station APls Chapter 2 Get Started describes the basic guidelines on how to use these APIs which we suggest reading all the way through before you jump into the API specifications Chapter 3 Base API and Chapter 4 File Station API list all available APIs and related details Copyright Synology Inc All Rights Reserved Get Started Before making use of File Station APIs to develop your own applications you need to have basic understanding of API concepts and API procedures This chapter explains how to execute and complete API processes in the f
37. cess time ctime last change time mtime atime ctime crtime posix or type Copyright Synology Inc All Rights Reserved 39 Synology File Station Official API Parameter Description Value Default Value Availability crtime create time posix POSIX permission type file extension sort direction Optional Specify to sort ascending or to sort descending Options include asc sort ascending desc sort descending asc or desc asc 1 and later pattern Optional Given glob pattern s to find files whose names and extensions match a case insensitive glob pattern Note 1 Ifthe pattern doesn t contain any glob syntax and of glob syntax will be added at begin and end of the string automatically for partially matching the pattern 2 You can use to separate multiple glob patterns Glob patterns String 1 and later filetype Optional file enumerate regular files dir enumerate folders all enumerate regular files and folders file dir or all all 1 and later additional Optional Additional requested file information separated by a comma When an additional option is requested responded objects will be provided in the specified additional option Options include real_path return a real path in volume m size return file byte size 7 owner returns information about file owner
38. cessed files according to the 1 and later m response of status method of individual API of the background task processed_si Interger A processed byte size according to the response of 1 and later ze status method of individual API of the background task processing p String A processing file path according to the response of 1 and later ath status method of individual API of the background task total Interger A total number byte size according to the response 1 and later of status method of individual API of the background task If API doesn t support it the value is always 1 progress Double A progress value whose range between 0 1 1 and later according to the response of status method of individual API of the background task If API doesn t support it the value is always 0 taskid lt favorite A unique ID according to the response of start 1 and later additional gt _ method of individual API of the background task object lt params gt object definition Requested parameters in JSON format Please refer to start method in each API Example 100 Wie aisies Ys Weyoa Ys i SYNO FileStation CopyMove Nereus I3TZ9Z6088 Wee sligubelaverclS eeue method start Woyeieciis es 4 MEISCUIECIES OROCESS 3 weve dest folder path video test Wein eI ESVS Erue path video test2 test avi WES Sra relee path video test2 test avi MOLOCESSEC Sizes 12800 p
39. copy move tasks SYNO FileStation Delete delete tasks SYNO FileStation Extract extract tasks SYNO FileStation Compress compress tasks Example GET webapi FileStation background_ task cgi api SYNO FileStation BackgroundTask amp version l method list Response lt data gt object definitions Parameter Type Description Availability total Integer Total number of background tasks 1 and later offset Integer Requested offset 1 and later tasks JSON Array of lt background task gt objects 1 and later Style Array lt background task gt object definition Parameter Type Description Availability api String Requested API name 1 and later version String Requested API version 1 and later method String Requested API method 1 and later taskid String A requested unique ID for the background task 1 and later finished Boolean Whether or not the background task is finished 1 and later params JSON Style lt params gt object Requested parameters in JSON 1 and later Object format according to start method of individual API of the background task path String A requested path according to start method of 1 and later individual API of the background task Copyright Synology Inc All Rights Reserved Synology File Station Official API Parameter Type Description Availability processed_nu Interger A number of pro
40. d since 00 00 00 Coordinated Universal Time UTC Thursday 1 January 1970 Copyright Synology Inc All Rights Reserved Example GET Synology File Station Official API webapi FileStation file find cgi api SYNO FileStation Search amp version 1 amp method star t amp folder path 2Fvideo amp pattern 1 Response lt data gt object definitions Parameter Type Description Availability taskid String A unique ID for the search task 1 and later Example Ueaskid s V51C2617Cr57B24E5 list Description List matched files in a search temporary database You can check the finished value in response to know if the search operation is processing or has been finished Availability Since version 1 Request Parameter Description Value Default Value Availability taskid A unique ID for the search task String None 1 and later which is gotten from start method offset Optional Specify how many Integer 0 1 and later matched files are skipped before beginning to return listed matched files limit Optional Number of matched Integer 0 1 and later files requested 1 indicates to list all matched files 0 indicates to list nothing sort by Optional Specify which file name size name 1 and later information to sort on user group Options include name file name size file size user file owner group file group mtime last modified time atime last ac
41. data or list folder within this folder or not 1 and later write Boolean If a logged in user has a privilege to write data or create files within this folder or not 1 and later Example Wares eyes lre additional owner Heueh ALO Neco se VinsierecY Horiei MOZA Musee 3 Verein permi tacke append true del true exec true read true write true Ie Wis eel modet falser DOOSI K Ie real path volumel video 1 30 Copyright Synology Inc All Rights Reserved Synology File Station Official API Copyright Synology Inc All Rights Reserved 32 Synology File Station Official API ctime 1372410504 mtime 1369964408 type a Teele WsieclabieWss false namens We EKES uoa Ma dE 2AE e kly VOEESeEN 10 Hotel 2 getinfo Description Get information of file s Availability Since version 1 Request Parameter Description Value Default Value Availability path One or more folder file path s started String None 1 and later with a shared folder separated by a comma additional Optional Additional requested file real_path None 1 and later information separated by a comma size owner When an additional option is time perm requested responded objects will be type or provided in the specified additional mount_point_ option type Options include i real_path return a r
42. e request will get error response if no write permission for the specified path API Error Code No specific API error codes Copyright Synology Inc All Rights Reserved 63 SYNO FileStation Upload Description Upload a file Overview Availability Since DSM 4 3 Version 1 Method upload Description Upload a file by RFC 1867 htip tools ietf org himl rfic1867 Synology File Station Official API Note that each parameter is passed within each part but binary file data must be the last part Availability Since version 1 Request Parameter Description Value Default Value Availability dest folder pa th A destination folder path starting with a shared folder to which files can be uploaded String None 1 and later create parents Create parent folder s if none exist Boolean None 1 and later overwrite Optional The value could be one of following 1 true overwrite the destination file if one exists 2 false skip the upload if the destination file exists 3 None when it s not specified as true or false the upload will be responded with error when the destination file exists true false None None 1 and later mtime Optional Set last modify time of the uploaded file unit Linux timestamp in millisecond Linux timestamp in millisecond None 1 and later crtime Optional Set the create time
43. e size 1 and later owner lt owner gt File owner information including user name group 1 and later Copyright Synology Inc All Rights Reserved 29 Synology File Station Official API Parameter Type Description Availability object name UID and GID time lt time gt object Time information of file including last access time 1 and later last modified time last change time and create time perm lt perm gt File permission information 1 and later object mount _point_ String A type of a virtual file system of a mount point 1 and later type type String File extension 1 and later lt owner gt object definition Parameter Type Description Availability user String User name of file owner 1 and later group String Group name of file group 1 and later uid Integer File UID 1 and later gid Integer File GID 1 and later lt time gt object definition Parameter Type Description Availability atime Linux Linux timestamp of last access in second 1 and later timestamp in second mtime Linux Linux timestamp of last modification in second 1 and later timestamp in second ctime Linux Linux timestamp of last change in second 1 and later timestamp in second crtime Linux Linux timestamp of create time in second 1 and later timestamp in second Note Linux timestamp defined as the number of seconds that have elaps
44. e status include valid A folder which a favorite links to exists broken A folder which a favorite links to doesn t exist or be not permitted to access it additional lt favorite Favorite additional object 1 and later additional gt object lt favorite additional gt object definition Parameter Type Description Availability real_path String Real path started with a volume path 1 and later 49 Copyright Synology Inc All Rights Reserved 50 Synology File Station Official API Parameter Type Description Availability owner lt owner gt object File owner information including user name 1 and later group name UID and GID time lt time gt object Time information of file including last access 1 and later time last modified time last change time and create time perm lt perm gt object File permission information 1 and later mount _point_ String A type of a virtual file system of a mount point 1 and later type type String File extension 1 and later lt owner gt lt time gt lt perm gt object definition Same as definition in the List method of SYNO FileStation List API Example WiaviOrleEesius Warsyelaliew s name Moyaricln Y 8 Dotar rusii TISORU K true My Video Shared folder video valid false name Moyericln 3 Ws icsneuis 2 Hl ofr sett 0 WRE IEE LS 2 add D
45. eal path in volume m size return file byte size m owner return information about file owner including user name group name UID and GID m time return information about time including last access time last modified time last change time and create time m perm return information about file permission m mount_point_type return a type of a virtual file system of a Copyright Synology Inc All Rights Reserved 33 Synology File Station Official API Parameter Description Value Default Value Availability mount point m type return a file extension Example GET webapi FileStation file share cgi api SYNO FileStation List version 1 amp method getin fogadditional real path 2Csizes2Cowner 2Ctimes2Cperms2Ct ype path s2Fvideos2F1 2C 2F videoS2F2 txt Response lt data gt object definitions Parameter Type Description Availability files JSON Style Array of lt file gt objects 1 and later Array lt file gt object definition Parameter Type Description Availability path String Folder file path started with a shared folder 1 and later name String File name 1 and later isdir Boolean If this file is folder or not 1 and later additional lt file File additional object 1 and later additional gt object lt file additional gt object definition Example Same as definition in the List method
46. ed folder 3gp 3g2 asf dat divx dvr ms m2t m2ts m4v mkv mp4 mts mov qt tp trp ts vob wmv xvid ac3 amr rm rmvb ifo mpeg Mpg mpe miv m2v mpeg1 mpeg2 mpeg4 ogv webm flv f4v avi swf vdr iso PS Video thumbnails exist only if video files are placed in the photo shared folder or users home folders Overview Availability Since DSM 4 3 Version 1 Method get Description Get a thumbnail of a file Availability Since version 1 Request Parameter Description Value Default Value Availability path A file path started with a shared String None 1 and later folder size Optional Return different size small medium small 1 and later thumbnail large or original Size Options small small size thumbnail medium medium size thumbnail large large size thumbnail original original size thumbnail 54 Copyright Synology Inc All Rights Reserved Synology File Station Official API Parameter Description Value Default Value Availability rotate Optional Return rotated thumbnail 0 1 2 3 4 0 1 and later Rotate Options 0 Do not rotate 1 Rotate 90 2 Rotate 180 3 Rotate 270 4 Rotate 360 Example GET webapi FileStation file thumb cgi api SYNO FileStation Thumb version 1 amp method get amp S2Fphotos2Ftest jpg Response Image binary data API Error Code Standard HTTP status codes Fo
47. ed since 00 00 00 Coordinated Universal Time UTC Thursday 1 January 1970 lt perm gt object definition ACL mode false the privilege of the shared folder is set to be POSIX mode Parameter Type Description Availability posix Integer POSIX file permission For example 777 means 1 and later owner group or other has all permission 764 means owner has all permission group has read write permission other has read permission is_acl_ mode Boolean true the privilege of the shared folder is set to be 1 and later Copyright Synology Inc All Rights Reserved Synology File Station Official API Parameter Type Description Availability acl Object Windows ACL privilege If a file is set to be POSIX mode these values of Windows ACL privilege are derived from the POSIX privilege 1 and later lt acl gt object definition Parameter Type Description Availability append Boolean If a logged in user has a privilege to append data or create folders within this folder or not 1 and later del Boolean If a logged in user has a privilege to delete a file a folder within this folder or not 1 and later EXEC Boolean If a logged in user has a privilege to execute files or traverse folders within this folder or not 1 and later read Boolean If a logged in user has a privilege to read
48. equested offset 1 and later shares JSON Style Array of lt shared folder gt objects 1 and later Array lt shared folder gt object definition Parameter Type Description Availability path String Path of a shared folder 1 and later name String Name of a shared folder 1 and later additional lt shared Shared folder additional object 1 and later folder additional gt object Copyright Synology Inc All Rights Reserved Synology File Station Official API lt shared folder additional gt object definition Parameter Type Description Availability real path String Real path of a shared folder in a volume space 1 and later owner lt owner gt File owner information including user name group 1 and later object name UID and GID time lt time gt object Time information of file including last access time 1 and later last modified time last change time and creation time perm lt shared File permission information 1 and later folder perm gt object mount _point_ String Type of a virtual file system of a mount point 1 and later type volume statu lt volume_stat Volume status including free space total space and 1 and later S us gt object read only status lt owner gt object definition Parameter Type Description Availability user String User name of file owner 1 and later group String Group name of file g
49. escription Add a folder to user s favorites Availability Since version 1 oler dr onderin share deletedfolder broken Copyright Synology Inc All Rights Reserved 51 Synology File Station Official API Request path A folder path starting with a shared folder String None 1 and later is added to the user s favorites name A favorite name String None 1 and later index Optional Index of location of an added Integer 1 1 and later favorite If it s equal to 1 the favorite will be added to the last one in user s favoirete If it s between 0 total number of favorites 1 the favorite will be inserted into user s favorites by the index Example GET webapi FileStation file favorite cgi api SYNO FileStation Favorite amp version 1 amp metho d add amp path 2Fvideos2Ffav name favorite video Response No specific response It returns an empty success response if completed without error delete Description Delete a favorite in user s favorites Availability Since version 1 Request path A folder path starting with a shared folder String None 1 and later is deleted from a user s favorites Example GET webapi FileStation file favorite cgi api SYNO FileStation Favorite amp version 1 amp metho d delete path S2Fvideo s2Ffav Response No specific response It returns an empty success response if completed witho
50. ew Availability Since DSM 4 3 Version 1 Method list Description List all background tasks including copy move delete compress and extract tasks Availability Since version 1 Request Parameter Description Value Default Value Availability offset Optional Specify how many Integer 0 1 and later background tasks are skipped before beginning to return listed background tasks limit Optional Number of background Integer 0 1 and later tasks requested 0 indicates to list all background tasks sort by Optional Specify which crtime or finished crtime 1 and later information of the background task to sort on Options include crtime creation time of the background task finished Whether the background task is finished Copyright Synology Inc All Rights Reserved 99 Synology File Station Official API Parameter Description Value Default Value Availability sort _direction Optional Specify to sort asc or desc asc 1 and later ascending or to sort descending Options include asc sort ascending desc sort descending api filter Optional List background tasks SYNO FileStatio None 1 and later with one or more given API n CopyMove name s separated by commas SYNO FileStatio If not given all background n Delete tasks are listed SYNO FileStatio n Extract or Options include SYNO FileStatio SYNO FileStation CopyMove n Compress
51. fficial API GOMESINES OIE HELIS GE ooo NaB0isx gt Response No specific response It returns an empty success response if completed without error API Error Code Code Description 1800 There is no Content Length information in the HTTP header or the received size doesn t match the value of Content Length information in the HTTP header 1801 Wait too long no date can be received from client Default maximum wait time is 3600 seconds 1802 No filename information in the last part of file content 1803 Upload connection is cancelled 1804 Failed to upload too big file to FAT file system 1805 Can t overwrite or skip the existed file if no overwrite parameter is given Copyright Synology Inc All Rights Reserved Synology File Station Official API SYNO FileStation Download Description Download file s folder s Overview Availability Since DSM 4 3 Version 1 Method download Description Download files folders If only one file is specified the file content is responded If more than one file folder is given binary content in ZIP format which they are compressed to is responded Availability Since version 1 Request Parameter Description Value Default Value Availability path One or more file folder paths starting with a String None 1 and later shared folder to be downloaded separated by a commas When more than one
52. file is to be downloaded files folders will be compressed as a zip file mode Mode used to download files folders value jopenor lopen 1 and later could be download 1 open try to trigger the application such as a web browser to open it Content Type of the HTTP header of the response is set to MIME type according to file extension download try to trigger the application such as a web browser to download it Content Type of the HTTP header of response is set to application octet stream and Content Disposition of the HTTP header of the response is set to attachment S 66 Copyright Synology Inc All Rights Reserved Synology File Station Official API Example GET webapi FileStation file download cgi api SYNO FileStation Download amp version 1 amp metho d download amp path 2Ftests2FITEMA 20445972 0 mp3 amp mode open Response The file content API Error Code No specific API error codes Note If mode parameter is set to open value 404 Not Found of status code of the HTTP header is responded when an error occurs 67 Copyright Synology Inc All Rights Reserved Synology File Station Official API SYNO FileStation Sharing Description Generate a sharing link to share files folders with other people and perform operations on sharing link s Overview Availability Since DSM 4 3 Version 1 Method getinfo Description Get information of a sharing link by the
53. ion 401 Unknown error of file operation 402 System is too busy 403 Invalid user does this file operation 404 Invalid group does this file operation 405 Invalid user and group does this file operation 406 Can t get user group information from the account server 407 Operation not permitted 408 No such file or directory 409 Non supported file system 410 Failed to connect internet based file system ex CIFS 411 Read only file system 412 Filename too long in the non encrypted file system 413 Filename too long in the encrypted file system 414 File already exists 415 Disk quota exceeded 416 No space left on device 417 Input output error 418 Illegal name or path 419 Illegal file name 420 Illegal file name on FAT file system 421 Device or resource busy 599 No such task of the file operation Copyright Synology Inc All Rights Reserved Synology File Station Official API Working Example The following demonstrates a working example for requesting a file operation from the DiskStation To implement this example simply replace the DiskStation address used in the example myds com port with your DiskStation address and paste the URL to a browser Then the JSON response will show up in a response page Step 1 Retrieve API Information In order to make API requests you should first request to webapi query cgi with SYNO API Info to get the SYNO API Auth API information for logging in and FileStation API info for file operations Re
54. iption Availability on query API names separated by a comma or use all 1 and later to get all supported APIs Example GET webapi query cgi api SYNO API Info version 1 method query query all Response Contains API description objects Parameter Description Availability key API name 1 and later path API path 1 and later minVersion Minimum supported API version 1 and later maxVersion Maximum supported API version 1 and later Example Helenes MISNONO JANE IE yore 3 fl pathi Wevueln cea Miaiiawieresavera a il Copyright Synology Inc All Rights Reserved Synology File Station Official API 14 API Error Code No specific API error codes Copyright Synology Inc All Rights Reserved Synology File Station Official API SYNO API Auth Overview Availability Since DSM 4 0 Version 3 Since DSM 4 2 2 Since DSM 4 1 Method Login Request Parameter Description Availability account Login account name 1 and later passwd Login account password 1 and later session Login session name 1 and later format Returned format of session ID Following are the two 2 and later possible options and the default value is cookie cookie The login session ID will be set to id key in cookie of HTTP HTTPS header of response sid The login sid will only be returned as response JSON data and id key
55. l or isFolder if it s a folder or not link_owner path file path date_expired the expiration date for the sharing link date_available the available date for the sharing link start effective status the link accessibility status has_password If the sharing link is protected or not url a URL of a sharing link link_owner the user name of the sharing link owner sort_direction Optional Specify to sort asc or desc asc 1 and later ascending or to sort descending Options include asc sort ascending desc sort descending force clean Optional If set to false the data Boolean false 1 and later Copyright Synology Inc All Rights Reserved Synology File Station Official API Parameter Description Value Default Value Availability will be retrieval from cache database rapidly If set to true all sharing information including sharing statuses and user name of sharing owner will be synchronized It consumes some time Example GET webapi FileStation file sharing cgi api SYNO FileStation Sharing amp version 1 amp method list amp offset 0 limit 10 Response lt data gt object definitions Parameter Type Description Availability total Integer Total number of sharing links offset Integer Requested offset links JSON Style Array Array of lt Sharing_Link gt object Examp
56. le anki MiclaieSman jase Moles wou WEES expired g gw has password false id pHTBKOf9 isFolder false Slime ommaoee g Mevelinatin Emane dk IIMA 2a ais 2S iL 0 Eme path test ITEMA 20448251 0 mp3 Eora EUSA valid url http myds com 5000 fbsharing pHTBKOf9 Hl noffset 0 Mieoice lg IL 70 Copyright Synology Inc All Rights Reserved 71 Synology File Station Official API create Description Generate one or more sharing link s by file folder path s Availability Since version 1 Request Parameter Description Value Default Availability Value path One or more file folder paths with which to String None 1 and later generate sharing links separated by commas password Optional The password for the sharing link String None 1 and later when accessing it The max password length are 16 characters date expired Optional The expiration date for the YYYY MM DD_ 0 1 and later sharing link written in the format YYYY MM DD When set to 0 default the sharing link is permanent date_available Optional The available date for the sharing YYYY MM DD 0 1 and later link to become effective written in the format YYYY MM DD When set to 0 default the sharing link is valid immediately after creation Note date of date expired and date available parameter is based on user s DS date
57. logged in user has a privilege to write data or 1 and later create files within this folder or not Copyright Synology Inc All Rights Reserved Synology File Station Official API lt volume_status gt object definition Parameter Type Description Availability freespace Integer Byte size of free space of a volume where a shared 1 and later folder is located totalspace Integer Byte size of total space of a volume where a shared 1 and later folder is located readonly Boolean true A volume where a shared folder is located is 1 and later read only false It s writable Example Weinguces 3 e Tisd ru Erue name video Woereni g Wri ceEoN vidda ronal gka owner Ngaicl s LOO Voieouja s YUSeies Waele O24 user admin real path volumel video time Wate rmeshS PASI 6216 Verses s ISos2q9 74 Neves s ILS ALTA S Ge 5 Mimeshine SIS VIL TALS GSS Wal eyelaie lS Se seniey name photo upar huu jslavoieo vidde sora la 4 owner Ngaicl s LOO 25 Copyright Synology Inc All Rights Reserved Synology File Station Official API UGROUP LE US Ciesat Tis 1024 user admin real path volumel photo timens f Weeds ILS ILGSO2I5 Verena s IsS21 6882 iL Verras ISOs 7 SQG89 mtime 1368769689 idz TofEsSet 07 Ueoralg 2 list Description Enumerate files
58. logy Synology File Station THIS DOCUMENT CONTAINS PROPRIETARY TECHNICAL INFORMATION WHICH IS THE PROPERTY OF SYNOLOGY INCORPORATED AND SHALL NOT BE REPRODUCED COPIED OR USED AS THE BASIS FOR DESIGN MANUFACTURING OR SALE OF APPARATUS WITHOUT WRITTEN PERMISSION OF SYNOLOGY INCORPORATED logy Synology Inc 2013 Synology Inc All rights reserved No part of this publication may be reproduced stored ina retrieval system or transmitted in any form or by any means mechanical electronic photocopying recording or otherwise without prior written permission of Synology Inc with the following exceptions Any person is hereby authorized to store documentation on a single computer for personal use only and to print copies of documentation for personal use provided that the documentation contains Synology s copyright notice The Synology logo is a trademark of Synology Inc No licenses express or implied are granted with respect to any of the technology described in this document Synology retains all intellectual property rights associated with the technology described in this document This document is intended to assist application developers to develop applications only for Synology labeled computers Every effort has been made to ensure that the information in this document is accurate Synology is not responsible for typographical errors Synology Inc 3F 3 No 106 Chang An W Rd Taipei 103
59. mple vrokgderstan vaddi erona Miria moune poime eye s Hremote owner Mga 3s ILO UGEOU Pi US Cues oe Hostels 1O24 user admin Copyright Synology Inc All Rights Reserved Synology File Station Official API API Error Code No specific API error codes Copyright Synology Inc All Rights Reserved Synology File Station Official API SYNO FileStation Favorite Description Add a folder to user s favorites or perform operations on user s favorites Overview Availability Since DSM 4 3 Version 1 Method list Description List user s favorites Availability Since version 1 Request Parameter Description Value Default Value Availability offset Optional Specify how many Integer 0 1 and later favorites are skipped before beginning to return user s favorites limit Optional Number of favorites Integer 0 1 and later requested 0 indicates to list all favorites status_filter Optional Show favorites with a valid broken orja 1 and later given favorite status all Options of favorite statuses include valid A folder which a favorite links to exists broken A folder which a favorite links to doesn t exist or doesn t be permitted to access it all Both valid and broken statuses additional Optional Additional requested name size name 1 and later information of a folder which a user group favorite links to separated by a mtime atime
60. n archive This is a non blocking method You need to start to extract files with start method Then you should poll requests with status method to get the progress status or make a request with the stop method to cancel the operation Availability Since version 1 Request Parameter Description Value Default Value Availability file path A file path of an archive to be String None 1 and later extracted starting with a shared folder dest folder _pa A destination folder path String None 1 and later th starting with a shared folder to which the archive will be extracted overwrite Optional Whether or notto Boolean false 1 and later overwrite if the extracted file exists in the destination folder keep dir Optional Whether to keep the Boolean true 1 and later folder structure within an archive create_subfold Optional Whether to create a Boolean false 1 and later er subfolder with an archive name which archived files are extracted to Copyright Synology Inc All Rights Reserved Synology File Station Official API codepage Optional The language DSM supported DSM Codepage 1 and later codepage used for decoding _ language including Setting file name with an archive lenu cht chs krn ger fre ita spn jpn dan nor sve nid rus plk ptb ptg hun trk or csy password Optional The password for String None 1 and later extracting the file item_id Optional
61. ntains all response information described in Object gt each method error lt JSON Style The data object contains error information when a request Object gt fails The basic elements are described in the next table Following describes the format of error information in error element Key Value Description code Error Code An error code will be returned when a request fails There are two kinds of error codes a common error code which is shared between all APIs the other is a specific API error code described under the corresponding API spec errors lt JSON Style The array contains detailed error information of each file Each Array gt element within errors is a JSON Style Object which contains an error code and other information such as a file path or name Note When there is no detailed information this error element won t be responded Example 1 Respond an invalid request to get information of File Station without a method parameter Request http myds com port webapi FilStation info cgi api SYNO FileStation Info amp version 1 Failed Response success false Werror 2 code 101 Copyright Synology Inc All Rights Reserved Synology File Station Official API Example 2 Respond an invalid request with a illegal path to create a folder Request http myds com port webapi FilStation info cgi api SYNO FileStation CreateFolder amp method create amp version 1 amp f
62. of the uploaded file unit Linux timestamp in millisecond Linux timestamp in millisecond None 1 and later atime Optional Set last access time of the uploaded file unit Linux timestamp in millisecond Linux timestamp in millisecond None 1 and later Copyright Synology Inc All Rights Reserved 64 Synology File Station Official API Parameter Description Value Default Value Availability filename file File content Must be the last Binary data None 1 and later part part Note Linux timestamp in millisecond defined as the number of milliseconds that have elapsed since 00 00 00 Coordinated Universal Time UTC Thursday 1 January 1970 Example POST webapi FileStation api_ upload cgi Content Length 20326728 Content type multipart form data boundary AaB03x AaB03x content disposition form data name api SYNO FileStation Upload AaB03x content disposition form data name version it AaBO03x content disposition form data name method upload AaB03x content disposition form data name dest folder path upload test AaB03x COMECME Chas DOcMEl On mE Torm deata name creete PDErSnta EENE AaB03x content disposition form data name file filename filel txt Content Type application octet stream Copyright Synology Inc All Rights Reserved 65 Synology File Station O
63. older path 2Ftest name 3A Failed Response success false Werror sd Veodew alOOr Yerrors to i Teodor vpathu A e eSt ae Example 3 Respond a successful request to get information from File Station Request http myds com port webapi FilStation info cgi api SYNO FileStation Info amp version 1 amp method getinfo Success Response ZSC CeS SH Erue Udata Uig menager g Trte MNO Site Mam enc ADS MSMPONOIPIE Slaveliea me g trte WETIOOOIce WaLiciewieEL g Gres ISO Note that to demonstrate examples with clarity only the data object is included in the response examples given in the following sections Copyright Synology Inc All Rights Reserved Synology File Station Official API Common Error Codes The codes listed below are common error codes of wrong parameters or failed login for all WebAPIs Code Description 100 Unknown error 101 No parameter of API method or version 102 The requested API does not exist 103 The requested method does not exist 104 The requested version does not support the functionality 105 The logged in session does not have permission 106 Session timeout 107 Session interrupted by duplicate login The codes listed below are common error codes of file operations for all File Station APIs Code Description 400 Invalid parameter of file operat
64. ollowing five sections API Workflow Briefly introduces how to work with File Station APIs Making Requests Elaborates how to construct API requests Parsing Response Describes how to parse response data Common Error Code Lists all common error codes that might be returned from all File Station APIs Working Example Provides an example to request a file operation API Workflow The following five step and easy to follow workflow shows how to make your application interact with File Station APIs Retrieve API information Making API Requests Send an API Parse an API Response Step 1 Retrieve API Information First your application needs to retrieve API information from the target DiskStation to know which APIs are available for use on the target DiskStation This information can be accessed simply through Copyright Synology Inc All Rights Reserved Synology File Station Official API a request to webapi query cgi with SYNO API Info API parameters The information provided in the response contains available API name API method API path and API version Once you have all the information at hand your application can make further requests to all available APIs Step 2 Log in In order to make your application interact with File Station your application needs to log in with an account and password first The login process is simply making a request to SYNO API Auth API with the login method If successful the API
65. ology Inc All Rights Reserved Synology File Station Official API Copyright Synology Inc All Rights Reserved Synology File Station Official API Wiewgore n VEE Gn Walsicliiew se a ESG nameti MiIGIN INS ese WoaiehtUsmey vakcleoy siG EDL Eats sate 1 Dein shedu Ss jer Ue Ugiiesenes 0 Mega 3 2 stop Description Stop the searching task s The search temporary database won t be deleted so it s possible to list the search result using list method after stopping it Availability Since version 1 Request taskid Unique ID s for the search task which are String None 1 and later gotten from start method Specify multiple search task IDs by Example GET webapi FileStation file find cgi api SYNO FileStation Search amp version 1 amp method stop amp taskid 51CE617CF57B24E5 42 Response No specific response It returns an empty success response if completed without error clean Description Delete search temporary database s Availability Since version 1 Copyright Synology Inc All Rights Reserved Synology File Station Official API Request taskid Unique ID s for the search task which are String None 1 and later gotten from start method Specify multiple search task IDs by Example GET webapi FileStation file find cgi api SYNO FileStation Search amp version 1 amp method clea n amp taskid 51
66. or make a request with the stop method to cancel the operation With the blocking method you can directly make requests with delete method to delete files folders but the response is not returned until the delete operation is completed Overview Availability Since DSM 4 3 Version 1 Method start Description Delete file s folder s This is a non blocking method You should poll a request with status method to get more information or make a request with stop method to cancel the operation Availability Since version 1 Request Parameter Description Value Default Value Availability path One or more deleted file folder String None 1 and later paths starting with a shared folder separated by commas accurate progr Optional true calculates the Boolean true 1 and later ess progress of each deleted file with the sub folder recursively false calculates the progress of files which you give in path parameters The latter is faster than recursively but less precise Note Only non blocking methods suits using the status method to get progress Copyright Synology Inc All Rights Reserved Synology File Station Official API recursive Optional true Recursively Boolean true 1 and later delete files within a folder false Only delete first level file folder If a deleted folder contains any file an error occurs because the folder can t be di
67. quest http myds com port webapi query cgi api SYNO API Info amp version 1 amp method query quer y SYNO API Auth SYNO FileStation Response Holena 3 if MISNONO NEI iorela Sf Hoat Mae LatEA CAT minVersion 1 maxVersion 3 JSKO PileStation lise path FileStation file share cgi minVersion 1 maxVersion 1 WSUICCSSS 3 TVE Step 2 Login After the SYNO API Auth path and supported version information are returned you can log ina FileStation session by requesting SYNO API Auth API version 3 located at webapi auth cgi Request http myds com port webapi auth cgi api SYNO API Auth version 3 method login amp accou nt admin passwd 12345 amp session FileStation amp format cookie Copyright Synology Inc All Rights Reserved 11 Synology File Station Official API Response dama sid ohOCjwhHhwghw USUCCESES S TEVE Step 3 Request a File Station API After a session is logged in you can continue to call the method of listing shared folder in SYNO FileStation List The cgi path and version are provided in the response of Step 1 and the list of all tasks can be requested by excluding the offset and limit parameters Request http myds com port webapi FileStation file share cgi api SYNO FileStation List ve rsion l1 method list share Response Usata offset 07 Yghares e a Wateeliliets EUS name video path video hoi asdar on Crue M
68. r Type Description Availability processed_size_ Integer If accurate progress parameter is true byte 1 and later sizes of all copied moved files will be accumulated If false only byte sizes of the file you give in path parameter is accumulated total Integer If accurate progress parameter is true the 1 and later value indicates total byte sizes of files including subfolders will be copied moved If false it indicates total byte sizes of files you give in path parameter excluding files within subfolders Otherwise when the total number is calculating the value is 1 path String A copying moving path which you give in path 1 and later parameter finished Boolean If the copy move task is finished or not 1 and later progress Double A progress value is between 0 1 It is equal to 1 and later processed size parameter divided by total parameter dest folder pat String A desitination folder path where files folders are 1 and later h copied moved Example dest folder path video test finished false path video test avi MOLOCESSCC Sizes O57 UpBOg sess ORO lol 22 a8 O2lS6sio2 a THEOL Ss SS325 stop Description Stop a copy move task Availability Since version 1 Copyright Synology Inc All Rights Reserved Synology File Station Official API Request Parameter Description Value Default Availabili
69. r example 404 Not Found Copyright Synology Inc All Rights Reserved Synology File Station Official API SYNO FileStation DirSize Description Get the accumulated size of files folders within folder s This is a non blocking API You need to start it with the start method Then you should poll requests with the status method to get progress status or make a request with stop method to cancel the operation Overview Availability Since DSM 4 3 Version 1 Method start Description Start to calculate size for one or more file folder paths Availability Since version 1 Request path One or more file folder paths starting with String None 1 and later a shared folder for calculating cumulative oy size separated by a comma Example GET webapi FileStation file dirSize cgi api SYNO FileStation DirSize amp version 1 amp method start path S2Fdownload S2F201301Enhencement Response lt data gt object definitions taskid String A unique ID for the task for the calculating size 1 task Copyright Synology Inc All Rights Reserved Synology File Station Official API Example taskid 51CBD CD5 76E461 status Description Get the status of the size calculating task Availability Since version 1 Request taskid A unique ID for the task which is gotten String None 1 and later from start method Example
70. rectly deleted search taskid Optional A unique ID for the String None 1 and later search task which is gotten from start method It s used to delete the file in the search result Example GET webapi FileStation file delete cgi api SYNO FileStation Delete amp version 1 amp method st art path s2Fvideos2Fdel folder Response lt data gt object definitions taskid String A unique ID for the delete task 1 and later Example Meaisieicls Misa lesiceieiom SiH Y Y SACS status Description Get the deleting status Availability Since version 1 Request taskid A unique ID for the delete task which is String None 1 and later gotten from start method Example GET webapi FileStation file delete cgi api SYNO FileStation Delete amp version 1 amp method st atus amp taskid FileStation 51CEC9C979340E5A 85 Copyright Synology Inc All Rights Reserved 86 Response lt data gt object definitions Synology File Station Official API Parameter Type Description Availability processed_nu J Integer If accurate progress parameter is true the 1 and later m number of all deleted files will be accumulated If false only the number of file you give in path parameter is accumulated total Integer If accurate progress parameter is true the 1 and later value indicates how many file
71. rocessing path video test2 test avi Copyright Synology Inc All Rights Reserved Synology File Station Official API Copyright Synology Inc All Rights Reserved 102 versioni I Wa i api SYNO FileStation Delete vertinne es IS S2 61 110 finished true method start params VECCULBEE ROCESS 3 eeu Synology File Station Official API path video test test avi path video test test avi Vorocesseel inulin iL processing path video test test avi Torogresses 1 Weasel WE ae Sects Ong oil 5510 QE Ebene DOL Meoieeulits IL Wyer onone il hl offset 0 une reeulL is al API Error Code No specific API error codes clear_finished Description Delete all finished background tasks Availability Since version 1 Request Parameter Description Value Default Availability Value taskid Unique IDs of finished copy move delete String None 1 and later compress or extract tasks Specify multiple task IDs by If it s not given all finished tasks are deleted Copyright Synology Inc All Rights Reserved Synology File Station Official API Example GET webapi FileStation background_task cgi api SYNO FileStation BackgroundTask version l amp method clear finished Response No specific response It returns an empty success response if completed without error API Error Code No specific API e
72. roup 1 and later uid Integer File UID 1 and later gid Integer File GID 1 and later lt time gt object definition Parameter Type Description Availability atime Linux Linux timestamp of last access in second 1 and later timestamp in second mtime Linux Linux timestamp of last modification in second 1 and later timestamp in second ctime Linux Linux timestamp of last change in second 1 and later timestamp in second crtime Linux Linux timestamp of create time in second 1 and later timestamp in second Note Linux timestamp in second defined as the number of seconds that have elapsed since 00 00 00 Coordinated Universal Time UTC Thursday 1 January 1970 Copyright Synology Inc All Rights Reserved Synology File Station Official API lt shared folder perm gt object definition Parameter Type Description Availability share right String RW The shared folder is writable RO the shared 1 and later folder is read only posix Integer POSIX file permission For example 777 means 1 and later owner group or other has all permission 764 means owner has all permission group has read write permission other has read permission adv_right lt adv_right gt Specail privelge of the shared folder 1 and later object acl enable Boolean If the configure of Windows ACL privilege of the 1 and later shared folder is ena
73. rror codes 103 Copyright Synology Inc All Rights Reserved Synology File Station Official API Document Revision History This table describes the changes to the Synology File Station Official API document Date Note 2013 08 27 Initial release 104 Copyright Synology Inc All Rights Reserved
74. s Reserved Synology File Station Official API Parameter Description Value Default Value Availability force parent Optional true no error occurs if a folder exists and make parent folders as needed false parent folders are not created Boolean false 1 and later additional Optional Additional requested file information separated by commas When an additional option is requested responded objects will be provided in the specified additional option Options include m real_path return a real path in volume 7 size return file byte size m owner return information about file owner including user name group name UID and GID 7 time return information about time including last access time last modified time last change time and create time m perm return information about file permission m type return a file extension real_path size o wner time perm or type None 1 and later Example GET webapi FileStation file crtfdr cgi api SYNO FileStation CreateFolder version l met hod create amp folder path 2Fvideo amp name test Response lt data gt object definitions Parameter Type Description Availability folders JSON Style Array of lt file gt objects about file information of a new 1 and later Array folder path lt file gt object definition Same as definition in SYNO FileStation
75. s including subfolders will be deleted If false it indicates how many files you give in path parameter When the total number is calculating the value is 1 path String A deletion path which you give in path parameter 1 and later processing p String A deletion path which could be located at a 1 and later ath subfolder finished Boolean Whether or not the deletion task is finished 1 and later progress Double Progress value whose range between 0 1 is equal 1 and later to processed_num parameter divided by total parameter Example finished false Togas E a o Oa Pprocescedinuni kimp processing path video 1000 509 progress 0 03199071809649467 Wteoirals GOSS stop Description Stop a delete task Availability Since version 1 Request Parameter Description Value Default Availability Value taskid A unique ID for the deletion task which is String None 1 and later obtained from start method Copyright Synology Inc All Rights Reserved Synology File Station Official API Example GET webapi FileStation file delete cgi api SYNO FileStation Delete amp version 1 method st op taskid FileStation 51CEC9C979340E5A Response No specific response It returns an empty success response if completed without error delete Description Delete files folders This is a blocking method The response is not returned until the deletion operation is completed Av
76. savaseidscovivsisavovestagdsveidivaveatdadoneotbinvesesiedivesvaeenadetseee 48 SYNO FileStation TAUMD 1 00 cccccccsccscsscsecscsscsscseesecsessecsesacsecsecsecsecsessesaesaesacsecsesseseesasssssaesessessesaesaessecassaesessessesaesaeeaee 54 SYNO FileStatiOn DirSiZe esere n aa a ae E aderi cdhagedioladasalaieasceslenesanadasgeduclesevalasunacdeelaverss 56 SAAN ON TIENIE IOLA DIS 59 SYNO FileStation CheckPermission cccccscecssesscsscsecssescsscsecsecsecsecsesscsecsessecsecsessecsessesacsecsscsesaesaesaesaesaeseseesaesaesaneaes 62 SYNO FileStation Upload siss soe iesezeses seas sdsesbaessaeeh eye Gsteaksnscchaesdesscavenbarstyeceadesusnsesedeunte coaceabisasdechadeensnsaseieaconenaeardestater 63 SYNO FileStation DOWNOA ccccccecsscsccsssscsscseesecsecsessesscsecsecsecssssessessessssacsecsessessesasssesaesacsecsesaesaesaesaesacsesoesaueaecaueaes 66 SYNO FileStation Sharing 0 ce ceeseseceseseseeseseeseesesesesceeeeeecseseseseseecaeseaesaeseeeeeaeacseaeeeeesecaeaeaeeeeeeeeesaeaeaeseeeeeeesataeaeeeeeeeneeaes 68 SYNO FileStation Greate FO OET a E chs ud E E a E a a E R E RE 75 SYNO FileStation RENAME ccccceccsccecssesecsesscsscseesecsessecscsscsecsecsessecsessecsessesassecsscsessessscsssaesacsessessesaessesaeseeseseecausaesaeae 78 SYNO FileStation CopyMOve iic is cccccostscsccsesectccecatce coestetaccensschcesstnedececeasernsetstesesssetasesstesbeaecbesesesatadeassetededesetostnandiedeteret 80 SYNO FileStation Delete ccc
77. sharing link ID Availability Since version 1 Request id A unique ID of a sharing link String None 1 and later Example GET webapi FileStation file sharing cgi api SYNO FileStation Sharing amp version 1 amp method getinfo amp id pHTBKOfF9 Response Returned lt data gt object is a lt Sharing_Link gt object defined in the Response Objects section Example Meleice ene lalole gO areke xpire cieu has password false id pHTBKOF9 isFolder false link owner admin 68 Copyright Synology Inc All Rights Reserved list Description Synology File Station Official API name ITEMA 20448251 0 mp3 path test ITEMA 20448251 0 mp3 Ustat SWE uya url http myds com 5000 fbsharing pHTBKOf9 List user s file sharing links Availability Since version 1 Request Parameter Description Value Default Value Availability offset Optional Specify how many Integer 0 1 and later sharing links are skipped before beginning to return listed sharing links limit Optional Number of sharing links Integer 0 1 and later requested 0 means to list all sharing links sort by Optional Specify information of name isFolder None 1 and later the sharing link to sort on path date_expired Options include date_available id a unique ID of sharing a status file folder has_password name file name id ur
78. st_file path String The requested destination path of an archive 1 Example dest file path download download zip finished true stop Description Stop the compress task Availability Since version 1 Request taskid A unique ID for the compress task which is String None 1 and later obtained from start method Example GET webapi FileStation file compress cgi api SYNO FileStation Compress amp version 1 amp metho d stop taskid FileStation 51CBB25CC31961FD 96 Response No specific response It returns an empty success response if completed without error Copyright Synology Inc All Rights Reserved 97 API Error Code Synology File Station Official API 1300 Failed to compress files folders 1301 Cannot create the archive because the given archive name is too long Copyright Synology Inc All Rights Reserved Synology File Station Official API SYNO FileStation BackgroundTask Description Get information regarding tasks of file operations which is run as the background process including copy move delete compress and extract tasks with non blocking APl methods You can use the status method to get more information or use the stop method to cancel these background tasks in individual API such as SYNO FileStation CopyMove API SYNO FileStation Delete API SYNO FileStation Extract API and SYNO FileStation Compress API Overvi
79. t Parameter Description Value Default Value Availability folder path A searched folder path starting with a shared folder String None 1 and later recursive Optional If searching files within a folder and subfolders recursively or not Boolean true 1 and later pattern Optional Search for files whose names and extensions match a case insensitive glob pattern Note 1 Ifthe pattern doesn t contain any glob syntax and of glob syntax will be added at begin and end of the string automatically for partially matching the pattern 2 You can use to separate multiple glob patterns Glob patterns None 1 and later extension Optional Search for files whose extensions match a file type pattern in a case insensitive glob pattern If you give this criterion folders aren t matched Note You can use commas to separate multiple glob patterns Glob patterns None 1 and later filetype Optional file enumerate regular files dir enumerate folders all enumerate regular files and folders file dir or all all 1 and later size from Optional Search for files whose sizes are greater than the given byte size Byte size None 1 and later size to Optional Search for files whose sizes are less than the given byte size Byte size None 1 and later mtime from
80. tension Example GET webapi FileStation file share cgi api SYNO FileStation List version 1 method list additional real path 2Csizes2Cowner s2Ctime s2Cperms2Ctype amp folder path 2Fvideo Response lt data gt object definitions Parameter Type Description Availability total Integer Total number of files 1 and later offset Integer Requested offset 1 and later files JSON Style Array of lt file gt objects 1 and later Array lt file gt object definition Parameter Type Description Availability path String Folder file path started with a shared folder 1 and later name String File name 1 and later isdir Boolean If this file is folder or not 1 and later children lt children gt File list within a folder which is described by a lt file gt 1 and later object object The value is returned only if goto path parameter is given additional lt file File additional object 1 and later additional gt object lt children gt object definition Parameter Type Description Availability total Integer Total number of files 1 and later offset Integer Requested offset 1 and later files JSON Style Array of lt file gt objects 1 and later Array lt file additional gt object definition Parameter Type Description Availability real path String Real path started with a volume path 1 and later size Integer Fil
81. ters need to be escaped Commas are replaced by slashes and slashes are replaced by double slashes because commas are used to separate multiple elements in a parameter Password relative parameters do not need to be escaped including passwd or password parameter Please see the following example If you want to make a request to the SYNO API Info API version 1 with the query method on your DiskStation whose address is http myds com port default port for HTTP is 5000 or 5001 for HTTPS for the list of all available API methods the corresponding parameters are API name SYNO API Info version 1 path query cgi Copyright Synology Inc All Rights Reserved Synology File Station Official API method query params query all And the request will look like this http myds com port webapi query cgi api SYNO API Info amp version 1 amp method query quer y all Note that an API s path and supported version information can be acquired by sending a request to SYNO API Info The location of SYNO API Info is fixed so that you can always request SYNO API Info with webapi query cgi Parsing Response All API responses are encoded in the JSON format and the JSON response contains elements as follows Key Value Description success true false true the request finishes successfully false the request fails with an error data data lt JSON Style The data object co
82. tially matching the pattern 2 You can use to separate multiple glob patterns Glob patterns None 1 and later filetype Optional file only enumerate regular files dir only enumerate folders all enumerate regular files and folders file dir or all a 1 and later goto path Optional Folder path started with a shared folder Return all files and sub folders within folder path path until goto path path recursively String None 1 and later additional Optional Additional requested file information separated by a comma When an additional option is requested responded objects will be provided in the specified additional option Options include m real_path return a real path in volume m size return file byte size 7 owner return information about file owner including user name group name UID and GID m time return information about time including last access time last modified time last change time and create time 7 perm return information about file permission real_path size owner time perm type or mount_point_ty pe None 1 and later Copyright Synology Inc All Rights Reserved 28 Synology File Station Official API Parameter Description Value Default Value Availability m mount_point_type return a type of a virtual file system of a mount point m type return a file ex
83. ty Value taskid A unique ID for the copy move task which String None 1 and later is gotten from start method Example GET webapi FileStation file MVCP cgi api SYNO FileStation CopyMove amp version 1 method st op amp taskid FileStation_ 51D00B7912CDEO0BO Response No specific response It returns an empty success response if completed without error API Error Code Code Description 1000 Failed to copy files folders More information in lt errors gt object 1001 Failed to move files folders More information in lt errors gt object 1002 An error occurred at the destination More information in lt errors gt object 1003 Cannot overwrite or skip the existing file because no overwrite parameter is given 1004 File cannot overwrite a folder with the same name or folder cannot overwrite a file with the same name 1006 Cannot copy move file folder with special characters to a FAT32 file system 1007 Cannot copy move a file bigger than 4G to a FAT32 file system 83 Copyright Synology Inc All Rights Reserved Synology File Station Official API SYNO FileStation Delete Description Delete file s folder s There are two kinds of methods one is a non blocking method and the other is a blocking method With the non blocking method you can start the deletion operation using the start method Then you should poll a request with the status method to get more information
84. ut error clear_broken Description Delete all broken statuses of favorites Copyright Synology Inc All Rights Reserved Synology File Station Official API Availability Since version 1 Request No parameters are required Example GET webapi FileStation file favorite cgi api SYNO FileStation Favorite amp version 1 amp metho celest lsic l lt em Response No specific response It returns an empty success response if completed without error edit Description Edit a favorite name Availability Since version 1 Request path A folder path starting with a shared folder String None 1 and later is edited from a user s favorites name New favorite name String None 1 and later Example GET webapi FileStation file favorite cgi api SYNO FileStation Favorite amp version 1 amp metho d edit path s2Fvideos2Ffav iname my video Response No specific response It returns an empty success response if completed without error replace_all Description Replace multiple favorites of folders to the existed user s favorites Availability Since version 1 Copyright Synology Inc All Rights Reserved Request Synology File Station Official API Parameter Description Value Default Value Availability path One or more folder paths starting with a shared folder separated by a comma is added to the user
85. view Availability Since DSM 4 3 Version 1 Method start Description Start to compress file s folder s Availability Since version 1 Request Parameter Description Value Default Value Availability path One or more file paths to be String None 1 and later compressed separated by commas The path should start with a shared folder dest_file _path A destination file path including String None 1 and later file name of an archive for the compressed archive level Optional Compress level used moderate store moderate 1 and later could be one of following values 1 moderate default moderate compression and normal compression speed 2 store pack files with no compress 3 fastest fastest compression speed but less compression 4 best slowest compression speed but optimal compression fastest or best 94 Copyright Synology Inc All Rights Reserved 95 Synology File Station Official API Parameter Description Value Default Value Availability mode Optional Compress mode used add update add 1 and later could be one of following values refreshen or 1 add default Update synchronize existing items and add new files If an archive does not exist a new one is created 2 update Update existing items if newer on the file system and add new files If the archive does not exist create a new archive
86. yright Synology Inc All Rights Reserved Synology File Station Official API Availability Since version 1 Request taskid A unique ID for the task which is gotten String None 1 and later from start method Example GET webapi FileStation file md5 cgi api SYNO FileStation MD5 amp version 1 method stop tas kid 51CBD95028B22AED Response No specific response It returns an empty success response if completed without error API Error Code No specific API error codes 61 Copyright Synology Inc All Rights Reserved Synology File Station Official API SYNO FileStation CheckPermission Description Check if a logged in user has a permission to do file operations on a given folder file Overview Availability Since DSM 4 3 Version 1 Method write Description Check if a logged in user has write permission to create new files folders in a given folder Availability Since version 1 Request path A folder path starting with a shared folder String None 1 and later to check write permission create only Optional True by default If set to true the Boolean None 1 and later permission will be allowed when there is non existent file folder Example GET webapi FileStation file permission cgi api SYNO FileStation CheckPermission amp versio n l method write path 2Fdownload 2Ftest zip amp create only true 62 Response Th

Download Pdf Manuals

image

Related Search

Related Contents

取扱説明書 お客さまへ  患者さんへの負担がより少ない疼痛管理が可能で  Manual - Texas  Manual de servicio Centralita Virtual.  Elite 400W  X130e User Guide  bulletin WD N° 387 100817 - Académie des vins anciens  

Copyright © All rights reserved.
Failed to retrieve file