# Image Uploader scripting API

## Functions to implement

`int UploadFile(string pathToFile, CIUUploadParams params)` Obligatory for server Type="image" or Type="file". Return values:
1 - success,
0 - fail
-1 - fail and abort upload (for example, authorization failed, this value supported since v.1.3.1) `int ShortenUrl(string url, CIUUploadParams params)` Obligatory for server Type="urlshortening".
`int GetFolderList(CFolderList folderList)`
`int CreateFolder(CFolderItem parent, CFolderItem folder)`
`int ModifyFolder(CFolderItem folder)`
`array GetFolderAccessTypeList()` Function that returns a list of the types of access restrictions to the album: private, public, friends only, etc.

    function GetFolderAccessTypeList()
    {
        return ["Public", "Private"];
    }

`table GetServerParamList()`

    function GetServerParamList()
    {
    	return
    	{
    		useWebdav = "Use WebDav",
    		token = "Token",
    		enableOAuth ="enableOAuth",
    		tokenType = "tokenType",
    		PrevLogin = "PrevLogin",
    		OAuthLogin = "OAuthLogin"

    	};
    }

`nm` - global object - an instance of NetworkClient
`ServerParams` - global object - an instance of CServerParams