Image Uploader Scripting API: implement.h File Reference

| Image Uploader Scripting API

Functions
implement.h File Reference

## Functions

int | Authenticate ()
int | CreateFolder (CFolderItem parent, CFolderItem folder)
int | DoLogout ()
array | GetFolderAccessTypeList ()
int | GetFolderList (CFolderList folderList)
table | GetServerParamList ()
int | IsAuthenticated ()
int | ModifyFolder (CFolderItem folder)
int | RefreshToken ()
int | ShortenUrl (string url, UploadParams params)
int | UploadFile (string pathToFile, UploadParams params)

## Detailed Description

# Functions to implement

You have to implement at least one function — UploadFile.
If your service supports authentication, you have to implement Authenticate function. If you want to support album listing/creating/modifying, you have to implement also GetFolderList, CreateFolder, ModifyFolder, GetFolderAccessTypeList.

## Function Documentation

## ◆ Authenticate()

int Authenticate | ( |  | ) |

Returns
  1 - success,
  0 - failure

## ◆ DoLogout()

int DoLogout | ( |  | ) |

Returns
  1 - success,
  0 - fail

## ◆ GetFolderAccessTypeList()

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"];
}

## ◆ GetServerParamList()

table GetServerParamList | ( |  | ) |

function GetServerParamList() {
return {
useWebdav = "Use WebDav",
someOption = {
title = "Some option",
type = "text"
},
useOAuth = {
title = "Use OAUth",
type = "boolean"
},
expiration = {
title = "Expiration",
type = "choice",
items = [
{
id = "",
label = Never"
},
{
id = "PT5M",
label = "15 minutes"
},
{
id = "PT30M",
label = "30 minutes"
},
{
id = "PT1H",
label = "1 hour"
}
]
},
privateKeyPath = {
title = "Private key path",
type = "filename"
}
};
}

## ◆ IsAuthenticated()

int IsAuthenticated | ( |  | ) |

Returns
  1 - is authenticated,
  0 - is not authenticated

## ◆ RefreshToken()

int RefreshToken | ( |  | ) |

Since
  1.3.3

Returns
  1 - success,
  0 - failure

## ◆ UploadFile()

int UploadFile | ( | string | pathToFile,
|  | UploadParams | params
| ) |  |

Required function for server Type="image" or Type="file".

Returns
  1 - success,
  0 - fail
  -1 - fail and abort upload (for example, authorization failed, this value supported since v.1.3.1)

GetServerParamList
table GetServerParamList()
GetFolderAccessTypeList
array GetFolderAccessTypeList()