js-owncloud-client
Version:
ownCloud client library for JavaScript
2,011 lines (1,704 loc) • 58.1 kB
YAML
swagger: "2.0"
info:
version: "10.0.0"
title: ownCloud documentation
tags:
- name: "General"
description: "Methods like initLibrary, login etc."
- name: "Sharing"
description: "File/Folder sharing methods"
- name: "Apps Management"
description: "Methods for Enabling/Disabling/Retrieving apps"
- name: "User Management"
description: "User Creation/Deletion/Updation methods"
- name: "Group Management"
description: "Group Creation/Deletion/Updation methods"
- name: "Files Management"
description: "File and Folder Creation/Deletion/Updation methods"
host: localhost:8080
basePath: /
schemes:
- http
consumes:
- application/json
produces:
- application/json
paths:
/initLibrary:
get:
tags:
- General
description: |
```js
var owncloud = require('js-owncloud-client');
var oc = new owncloud(instance);
```
summary: Initialize owncloud session
operationId: initLibrary
parameters:
- name: url
in: query
description: server URL
type: string
responses:
"success":
description: The library was initialised successfuly.
schema:
type: boolean
/login:
get:
tags:
- General
description: |
```js
oc.login(username, password).then(status => {
// True if successful
}).catch(error => {
// error message
});
```
operationId: login
summary: Logs you in to your specified ownCloud instance
parameters:
- name: user
description: username
in: query
type: string
- name: pass
description: password
in: query
type: string
format: password
responses:
"success":
description: Login attemot was successful
schema:
type: boolean
"faliure":
description: Login attemot was un-successful
schema:
type: string
example: "Current user is not logged in"
/getApps:
get:
tags:
- Apps Management
description: |
```js
oc.apps.getApps().then(apps => {
// All Apps
}).catch(error => {
// error message
});
```
summary: Get all the enabled and disbaled apps via the Provisioning API
operationId: getApps
produces:
- "application/json"
responses:
"success":
description: All apps were fetched successfuly
schema:
type: object
example: {
"encryption": false,
"files_sharing": true,
"federation": true,
"updatenotification": true,
"comments": true,
"files_versions": true,
"systemtags": true,
"gallery": false,
"files_trashbin": true,
"provisioning_api": true,
"testing": false,
"files": true,
"dav": true,
"federatedfilesharing": true,
"files_external": true
}
/shareFileWithLink:
get:
tags:
- Sharing
description: |+
```js
oc.shares.shareFileWithLink(path, {
perms: perms,
publicUpload: publicUpload,
password: password
}).then(share => {
/*
Object of class shareInfo
Use methods like getId(), getPath(), getLink() etc.
*/
}).catch(error => {
// error message
});
```
summary: Shares a remote file with link
operationId: shareFileWithLink
parameters:
- name: path
in: query
description: path of the file to be shared
type: string
- name: perms
in: query
required: false
description: permission of the shared object defaults to read only (OPTIONAL)
type: integer
- name: publicUpload
in: query
required: false
description: allows users to upload files or folders (OPTIONAL)
type: boolean
- name: password
in: query
required: false
description: sets a password (OPTIONAL)
type: string
format: password
produces:
- "application/json"
responses:
"success":
description: The file/folder was shared successfuly
schema:
type: object
example: {
"shareInfo": {
"id": "Integer",
"permissions": "Integer",
"link": "string",
"share_type": "Integer"
}
}
"faliure":
description: non-existent file entered
schema:
type: string
example: Wrong path, file/folder doesn't exist
/updateShare:
get:
tags:
- Sharing
description: |+
```js
oc.shares.updateShare(shareId, {
perms: perms,
publicUpload: publicUpload,
password: password
}).then(share => {
/*
Object of class shareInfo
Use methods like getId(), getPath(), getLink() etc.
*/
}).catch(error => {
// error message
});
```
summary: Updates a given share
operationId: updateShare
parameters:
- name: shareId
in: query
description: ID of share to update
type: integer
- name: perms
in: query
required: false
description: permission of the shared object defaults to read only (OPTIONAL)
type: integer
- name: publicUpload
in: query
required: false
description: allows users to upload files or folders (OPTIONAL)
type: boolean
- name: password
in: query
required: false
description: sets a password (OPTIONAL)
type: string
format: password
produces:
- "application/json"
responses:
"success":
description: The specified share was updated successfuly
schema:
type: boolean
/shareFileWithUser:
get:
tags:
- Sharing
description: |+
```js
oc.shares.shareFileWithUser(path, username, {
perms: perms,
remoteUser: remoteUser
}).then(share => {
/*
Object of class shareInfo
Use methods like getId(), getPath(), getLink() etc.
*/
}).catch(error => {
// error message
});
```
summary: Shares a remote file with User
operationId: shareFileWithUser
parameters:
- name: path
in: query
description: path of the file to be shared
type: string
- name: username
in: query
description: name of user to be shared with
type: string
- name: perms
in: query
required: false
description: permission of the shared object defaults to read only (OPTIONAL)
type: integer
- name: remoteUser
in: query
required: false
description: allows users to upload files or folders (OPTIONAL)
type: boolean
produces:
- "application/json"
responses:
"success":
description: The file/folder was shared successfuly
schema:
type: object
example: {
"shareInfo": {
"id": "Integer",
"permissions": "Integer",
"link": "string",
"share_type": "Integer"
}
}
"faliure":
description: non-existent file entered
schema:
type: string
example: Wrong path, file/folder doesn't exist
"faliure ":
description: non-existent user entered
schema:
type: string
example: Please specify a valid user
/shareFileWithGroup:
get:
tags:
- Sharing
description: |+
```js
oc.shares.shareFileWithGroup(path, groupname, {
perms: perms
}).then(share => {
/*
Object of class shareInfo
Use methods like getId(), getPath(), getLink() etc.
*/
}).catch(error => {
// error message
});
```
summary: Shares a remote file with Group
operationId: shareFileWithGroup
parameters:
- name: path
in: query
description: path of the file to be shared
type: string
- name: groupName
in: query
description: name of group to be shared with
type: string
- name: perms
in: query
required: false
description: permission of the shared object defaults to read only (OPTIONAL)
type: integer
produces:
- "application/json"
responses:
"success":
description: The file/folder was shared successfuly
schema:
type: object
example: {
"shareInfo": {
"id": "Integer",
"permissions": "Integer",
"link": "string",
"share_type": "Integer"
}
}
"faliure":
description: non-existent file entered
schema:
type: string
example: Wrong path, file/folder doesn't exist
"faliure ":
description: non-existent group entered
schema:
type: string
example: Please specify a valid group
/getShares:
get:
tags:
- Sharing
description: |+
```js
oc.shares.getShares().then(shares => {
// Array containing all shares
}).catch(error => {
// error message
});
```
summary: Returns array of shares
operationId: getShares
parameters:
- name: path
in: query
description: path to the share to be checked
type: string
- name: reshares
in: query
required: false
description: resharing allowed or not
type: boolean
- name: subfiles
in: query
required: false
description: returns not only the shares from the current user but all shares from the given file
type: boolean
- name: shared_with_me
in: query
required: false
description: returns all shares which are shared with me
type: boolean
produces:
- "application/json"
responses:
"success":
description: All shares were fetched successfuly
schema:
type: object
example: [{
"shareInfo": {
"id": "Integer",
"permissions": "Integer",
"link": "string",
"share_type": "Integer"
}
}, {
"shareInfo": {
"id": "Integer",
"permissions": "Integer",
"link": "string",
"share_type": "Integer"
}
}, {
"shareInfo": {
"id": "Integer",
"permissions": "Integer",
"link": "string",
"share_type": "Integer"
}
}]
/isShared:
get:
tags:
- Sharing
description: |+
```js
oc.shares.isShared(path).then(status => {
// True if shared
}).catch(error => {
// error message
});
```
summary: Checks wether a path is already shared
operationId: isShared
parameters:
- name: path
description: path to the share to be checked
in: query
type: string
responses:
"success":
description: Specified share's status was fetched successfuly
schema:
type: boolean
"faliure":
description: non-exisatent file/folder entered
schema:
type: string
example: "Wrong path, file/folder doesn't exist"
/getShare:
get:
tags:
- Sharing
description: |+
```js
oc.shares.getShare(shareId).then(share => {
/*
Object of class shareInfo
Use methods like getId(), getPath(), getLink() etc.
*/
}).catch(error => {
// error message
});
```
summary: Gets share information about known share
operationId: getShare
parameters:
- name: shareId
description: ID of the share to be checked
in: query
type: number
responses:
"success":
description: share information was fetched successfuly
schema:
type: object
example: {
"shareInfo": {
"id": "Integer",
"permissions": "Integer",
"link": "string",
"share_type": "Integer"
}
}
"faliure":
description: non-existent share ID entered
schema:
type: string
example: Wrong share ID, share doesn't exist
/createUser:
get:
tags:
- User Management
description: |
```js
oc.users.createUser(username, password).then(status => {
// True if successful
}).catch(error => {
// error message
});
```
summary: Creates user via the provisioning API
operationId: createUser
parameters:
- name: username
description: username of the new user to be created
in: query
type: string
- name: password
description: password of the new user to be created
in: query
type: string
format: password
responses:
"success":
description: User was created successfuly
schema:
type: boolean
"faliure":
description: User to create already exists
schema:
type: string
example: "User already exists"
/deleteUser:
get:
tags:
- User Management
description: |
```js
oc.users.deleteUser(username).then(status => {
// True if successful
}).catch(error => {
// error message
});
```
summary: Deletes user via the provisioning API
operationId: deleteUser
parameters:
- name: username
description: username of the user to be deleted
in: query
type: string
responses:
"success":
description: User was removed successfuly
schema:
type: boolean
"faliure":
description: User to delete does not exist
schema:
type: object
example: {
"ocs": {
"meta": {
"status": "failure",
"statuscode": "101",
"message": {}
},
"data": {}
}
}
/searchUsers:
get:
tags:
- User Management
description: |
```js
oc.users.searchUsers(username).then(users => {
// Array of all matching usernames
}).catch(error => {
// error message
});
```
summary: Searches for users via the provisioning API
operationId: searchUsers
parameters:
- name: username
description: username of the user to be searched
in: query
type: string
responses:
"success":
description: All users matching the query fetched successfuly
schema:
type: object
example: [
"user1",
"user2",
"user3"
]
/userExists:
get:
tags:
- User Management
description: |
```js
oc.users.userExists(username).then(status => {
// True if exists
}).catch(error => {
// error message
});
```
summary: Checks a user via the provisioning API
operationId: userExists
parameters:
- name: username
description: name of user to be checked
in: query
type: string
responses:
"success":
description: Status fetched successfuly
schema:
type: boolean
/getUsers:
get:
tags:
- User Management
description: |
```js
oc.users.getUsers().then(users => {
// Array of all usernames
}).catch(error => {
// error message
});
```
summary: Get all users via the Provisioning API
operationId: getUsers
responses:
"success":
description: All users matching the query fetched successfuly
schema:
type: object
example: [
"user1",
"user2",
"user3"
]
/setUserAttribute:
get:
tags:
- User Management
description: |
```js
oc.users.setUserAttribute(username, key, value).then(status => {
// True if successful
}).catch(error => {
// error message
});
```
summary: Sets a user attribute via the Provisioning API
operationId: setUserAttribute
parameters:
- name: username
description: name of user to modify
in: query
type: string
- name: key
description: key of the attribute to be set (email, quota, display, password)
in: query
type: string
- name: value
description: value to be set
in: query
type: string
responses:
"success":
description: Attribute was set successfuly
schema:
type: boolean
"faliure":
description: Entered user or attribute doesn't exist
type: object
example: {
"ocs": {
"meta": {
"status": "failure",
"statuscode": "997",
"message": {}
},
"data": {}
}
}
"faliure ":
description: "Entered attribute's value isn't possible. eg. \"asd\" is not a valid E-Mail address"
type: object
example: {
"ocs": {
"meta": {
"status": "failure",
"statuscode": "102",
"message": {}
},
"data": {}
}
}
/addUserToGroup:
get:
tags:
- User Management
description: |
```js
oc.users.addUserToGroup(username, groupName).then(status => {
// True if successful
}).catch(error => {
// error message
});
```
summary: Adds user to group via the Provisioning API
operationId: addUserToGroup
parameters:
- name: username
description: name of user to modify
in: query
type: string
- name: groupName
description: name of group to add to
in: query
type: string
responses:
"success":
description: User was added to group successfuly
schema:
type: boolean
"faliure":
description: Entered user doesn't exist
type: object
example: {
"ocs": {
"meta": {
"status": "failure",
"statuscode": "103",
"message": {}
},
"data": {}
}
}
"faliure ":
description: "Entered group doesn't exist"
type: object
example: {
"ocs": {
"meta": {
"status": "failure",
"statuscode": "102",
"message": {}
},
"data": {}
}
}
/getUserGroups:
get:
tags:
- User Management
description: |
```js
oc.users.getUserGroups(username).then(status => {
// Array of all groups user is member of
}).catch(error => {
// error message
});
```
summary: Get a list of groups associated to a user via the Provisioning API
operationId: getUserGroups
parameters:
- name: username
description: name of user to list groups
in: query
type: string
responses:
"success":
description: User groups were fetched successfuly
schema:
type: object
example: [
"group1",
"group2"
]
"faliure":
description: Entered user doesn't exist
type: object
example: {
"ocs": {
"meta": {
"status": "failure",
"statuscode": "998",
"message": {}
},
"data": {}
}
}
/userIsInGroup:
get:
tags:
- User Management
description: |
```js
oc.users.userIsInGroup(username, groupName).then(status => {
// True if user is part of group
}).catch(error => {
// error message
});
```
summary: Checks if a user is in a group via the Provisioning API
operationId: userIsInGroup
parameters:
- name: username
description: name of user
in: query
type: string
- name: groupName
description: name of group
in: query
type: string
responses:
"success":
description: User status fetched successfuly
schema:
type: boolean
"faliure":
description: Entered user doesn't exist
type: object
example: {
"ocs": {
"meta": {
"status": "failure",
"statuscode": "998",
"message": {}
},
"data": {}
}
}
/getUser:
get:
tags:
- User Management
description: |
```js
oc.users.getUser(username).then(user => {
// Object of all user details
}).catch(error => {
// error message
});
```
summary: Retrieves information about a user via the Provisioning API
operationId: getUser
parameters:
- name: username
description: name of user to list groups
in: query
type: string
responses:
"success":
description: User information fetched successfuly
schema:
type: object
example: {
"enabled": "boolean",
"quota": {
"free": "XX",
"used": "XX",
"total": "XX",
"relative": "XX"
},
"email": "email@provider.com",
"displayname": "name",
"home": "/path/to/OC/instance",
"two_factor_auth_enabled": "boolean"
}
"faliure":
description: Entered user doesn't exist
type: string
example: "The requested user could not be found"
/removeUserFromGroup:
get:
tags:
- User Management
description: |
```js
oc.users.removeUserFromGroup(username, groupName).then(status => {
// true if successful
}).catch(error => {
// error message
});
```
summary: Removes user from a group via the Provisioning API
operationId: removeUserFromGroup
parameters:
- name: username
description: name of user
in: query
type: string
- name: groupName
description: name of group
in: query
type: string
responses:
"success":
description: User was removed from group successfuly
schema:
type: boolean
"faliure":
description: Entered user doesn't exist
type: object
example: {
"ocs": {
"meta": {
"status": "failure",
"statuscode": "103",
"message": {}
},
"data": {}
}
}
"faliure ":
description: "Entered group doesn't exist"
type: object
example: {
"ocs": {
"meta": {
"status": "failure",
"statuscode": "102",
"message": {}
},
"data": {}
}
}
/addUserToSubadminGroup:
get:
tags:
- User Management
description: |
```js
oc.users.addUserToSubadminGroup(username, groupName).then(status => {
// true if successful
}).catch(error => {
// error message
});
```
summary: Adds user to a subadmin group via the Provisioning API
operationId: addUserToSubadminGroup
parameters:
- name: username
description: name of user to modify
in: query
type: string
- name: groupName
description: name of group to add to
in: query
type: string
responses:
"success":
description: User was added to subadmin group successfuly
schema:
type: boolean
"faliure":
description: Entered user doesn't exist
type: string
example: User does not exist
"faliure ":
description: "Entered group doesn't exist"
type: string
example: "Group:someGroupName does not exist"
/getUserSubadminGroups:
get:
tags:
- User Management
description: |
```js
oc.users.getUserSubadminGroups(username).then(groups => {
// Array of all groups the user is subadmin of
}).catch(error => {
// error message
});
```
summary: Get a list of subadmin groups associated to a user via the Provisioning API
operationId: getUserSubadminGroups
parameters:
- name: username
description: name of user to list groups
in: query
type: string
responses:
"success":
description: User subadmin groups were fetched successfuly
schema:
type: object
example: [
"group1",
"group2"
]
"faliure":
description: Entered user doesn't exist
type: string
example: User does not exist
/userIsInSubadminGroup:
get:
tags:
- User Management
description: |
```js
oc.users.userIsInSubadminGroup(username, groupName).then(status => {
// true if user is a subadmin of the group
}).catch(error => {
// error message
});
```
summary: Checks if a user is in a subadmin group via the Provisioning API
operationId: userIsInSubadminGroup
parameters:
- name: username
description: name of user
in: query
type: string
- name: groupName
description: name of group
in: query
type: string
responses:
"success":
description: User status fetched successfuly
schema:
type: boolean
"faliure":
description: Entered user doesn't exist
type: string
example: User does not exist
/createGroup:
get:
tags:
- Group Management
description: |
```js
oc.groups.createGroup(groupName).then(status => {
// true if successful
}).catch(error => {
// error message
});
```
summary: Creates a group via the provisioning API
operationId: createGroup
parameters:
- name: groupName
description: groupName of the new user to be created
in: query
type: string
responses:
"success":
description: Group was created successfuly
schema:
type: boolean
"faliure":
description: Group already exists
schema:
type: object
example: {
"ocs": {
"meta": {
"status": "failure",
"statuscode": "102",
"message": {}
},
"data": {}
}
}
/deleteGroup:
get:
tags:
- Group Management
description: |
```js
oc.groups.deleteGroup(groupName).then(status => {
// true if successful
}).catch(error => {
// error message
});
```
summary: Deletes a group via the provisioning API
operationId: deleteGroup
parameters:
- name: groupName
description: Name of the new group to be created
in: query
type: string
responses:
"success":
description: Group was deleted successfuly
schema:
type: boolean
"faliure":
description: Group does not exist
schema:
type: object
example: {
"ocs": {
"meta": {
"status": "failure",
"statuscode": "101",
"message": {}
},
"data": {}
}
}
/getGroups:
get:
tags:
- Group Management
description: |
```js
oc.groups.getGroups().then(groups => {
// Array of all group names
}).catch(error => {
// error message
});
```
summary: Gets all groups via the provisioning API
operationId: getGroups
responses:
"success":
description: All groups fetched successfuly
schema:
type: object
example: [
"admin",
"group1",
"group2"
]
/getGroupMembers:
get:
tags:
- Group Management
description: |
```js
oc.groups.getGroupMembers(groupName).then(members => {
// Array of all group members
}).catch(error => {
// error message
});
```
summary: Gets all members of a group via the provisioning API
operationId: getGroupMembers
parameters:
- name: groupName
description: Name of the group to list members
in: query
type: string
responses:
"success":
description: All group members fetched successfuly
schema:
type: object
example: [
"user1",
"user2"
]
"faliure":
description: Group does not exist
schema:
type: string
example: The requested group could not be found
/groupExists:
get:
tags:
- Group Management
description: |
```js
oc.groups.groupExists(groupName).then(status => {
// true if exists
}).catch(error => {
// error message
});
```
summary: Checks a group via provisioning API
operationId: groupExists
parameters:
- name: groupName
description: Name of the group to be checked
in: query
type: string
responses:
"success":
description: Group status fetched successfuly
schema:
type: boolean
/getConfig:
get:
tags:
- General
description: |
```js
oc.getConfig().then(config => {
// object with all config settings of the OC instance
}).catch(error => {
// error message
});
```
summary: Returns ownCloud config information
operationId: getConfig
responses:
"success":
description: Getting all the OC configs went successfuly
schema:
type: object
example: {
"version": "1.7",
"website": "ownCloud",
"host": "localhost",
"contact": {},
"ssl": "false"
}
/getAttribute:
get:
tags:
- Apps Management
description: |
```js
oc.apps.getAttribute(app, key).then(value => {
// value of the key
}).catch(error => {
// error message
});
```
summary: Returns an application attribute
operationId: getAttribute
parameters:
- name: app
description: application ID
in: query
type: string
- name: key
description: attribute key or None to retrieve all values for the given application
in: query
type: string
responses:
"success, existent key entered":
schema:
type: string
example: "VALUE"
"success, no key entered":
schema:
type: object
example: {
"KEY1": "VALUE1",
"KEY2": "VALUE2"
}
"faliure":
schema:
type: string
example: "APPNAME has no key named KEY"
/setAttribute:
get:
tags:
- Apps Management
summary: Sets an application attribute
description: |
```js
oc.apps.setAttribute(app, key, value).then(status => {
// true if successful
}).catch(error => {
// error message
});
```
operationId: setAttribute
parameters:
- name: app
description: application ID
in: query
type: string
- name: key
description: attribute key or None to set for the given application
in: query
type: string
- name: value
description: attribute value to set for the given key
in: query
type: string
responses:
"success":
description: The attribute was set successfuly
type: boolean
/deleteAttribute:
get:
tags:
- Apps Management
description: |
```js
oc.apps.deleteAttribute(app, key).then(status => {
// true if successful
}).catch(error => {
// error message
});
```
summary: Deletes an application attribute
operationId: deleteAttribute
parameters:
- name: app
description: application ID
in: query
type: string
- name: key
description: attribute key or None to set for the given application
in: query
type: string
responses:
"success":
description: The attribute was deleted successfuly
type: boolean
/getVersion:
get:
tags:
- General
description: |
```js
oc.getVersion().then(version => {
// version string of the OC instance
}).catch(error => {
// error message
});
```
summary: Gets the ownCloud version of the connected server
operationId: getVersion
responses:
"success":
description: ownCloud version fetched successfuly
schema:
type: string
example: "10.0.0-Community"
/getCapabilities:
get:
tags:
- General
description: |
```js
oc.getCapabilities().then(capabilities => {
// object with all the capabilities of the logged in user
}).catch(error => {
// error message
});
```
summary: Gets the ownCloud app capabilities
operationId: getCapabilities
responses:
"success":
description: All capabilities of the logged in user fetched succesfully
schema:
type: object
example: {
"core": {
"pollinterval": "60",
"webdav-root": "remote.php/webdav",
"status": {
"installed": "true",
"maintenance": "false",
"needsDbUpgrade": "false",
"version": "10.0.0.12",
"versionstring": "10.0.0",
"edition": "Community",
"productname": "ownCloud"
}
}
}
/enableApp:
get:
tags:
- Apps Management
description: |
```js
oc.apps.enableApp(appname).then(status => {
// True if succesful
}).catch(error => {
// error message
});
```
summary: enables an app via the Provisioning API
operationId: enableApp
parameters:
- name: appname
description: name of application to be enabled
in: query
type: string
responses:
"success":
description: The app was enabled successfuly
type: boolean
/disableApp:
get:
tags:
- Apps Management
description: |
```js
oc.apps.disbleApp(appname).then(status => {
// True if succesful
}).catch(error => {
// error message
});
```
summary: disables an app via the Provisioning API
operationId: disableApp
parameters:
- name: appname
description: name of application to be disabled
in: query
type: string
responses:
"success":
description: The app was disabled successfuly
type: boolean
/listOpenRemoteShare:
get:
tags:
- Sharing
description: |+
```js
oc.shares.listOpenRemoteShare().then(shares => {
// Array containing all shares
}).catch(error => {
// error message
});
```
summary: List all pending remote share
operationId: listOpenRemoteShare
responses:
"success":
description: All remote shares were fetched successfuly
schema:
type: object
example: [
"share1",
"share2",
"share3"
]
/acceptRemoteShare:
get:
tags:
- Sharing
description: |+
```js
oc.shares.acceptRemoteShare(shareId).then(status => {
// True if successful
}).catch(error => {
// error message
});
```
summary: Accepts a remote share
operationId: acceptRemoteShare
parameters:
- name: shareId
description: ID of share to accept
in: query
type: integer
responses:
"success":
description: The share was accepeted
schema:
type: boolean
/declineRemoteShare:
get:
tags:
- Sharing
description: |+
```js
oc.shares.declineRemoteShare(shareId).then(status => {
// True if successful
}).catch(error => {
// error message
});
```
summary: Declines a remote share
operationId: declineRemoteShare
parameters:
- name: shareId
description: ID of share to decline
in: query
type: integer
responses:
"success":
description: The share was accepeted
schema:
type: boolean
"faliure":
description: Wrong share ID entered
schema:
type: string
example: Share does not exist
/deleteShare:
get:
tags:
- Sharing
description: |+
```js
oc.shares.deleteShare(shareId).then(status => {
// True if successful
}).catch(error => {
// error message
});
```
summary: Unshares a file or directory
operationId: deleteShare
parameters:
- name: shareId
description: ID of share to delete
in: query
type: integer
responses:
"success":
description: The share was accepeted
schema:
type: boolean
"faliure":
description: Wrong share ID entered
schema:
type: string
example: "Wrong share ID, share doesn't exist"
/list:
get:
tags:
- Files Management
description: |
```js
oc.files.list(remotePath, depth).then(files => {
// All files in an object
}).catch(error => {
// error message
});
```
summary: Returns the listing/contents of the given remote directory
operationId: list
parameters:
- name: remotePath
description: path to the remote directory
in: query
type: string
- name: depth
description: depth of the listing (0/1) , or "infinity"
in: query
type: string
responses:
"success":
description: All files/folders with corresponding infomation fetched
schema:
type: object
example: [
{
"name": "XX",
"type": "file/dir",
"fileInfo": {
"getlastmodified": "Mon, 01 Jan 1970 00:00:00 GMT",
"resourcetype": {
"d:collection": {}
},
"quota-used-bytes": "XX",
"quota-available-bytes": "XX",
"getetag": "XX"
}
},
{
"name": "XX",
"type": "file/dir",
"fileInfo": {
"getlastmodified": "Mon, 01 Jan 1970 00:00:00 GMT",
"resourcetype": {
"d:collection": {}
},
"quota-used-bytes": "XX",
"quota-available-bytes": "XX",
"getetag": "XX"
}
}
]
"faliure":
description: Non existent file/folder given
schema:
type: string
example: File with name *FileName* could not be located
/getFileContents:
get:
tags:
- Files Management
description: |
```js
oc.files.getFileContents(remotePath).then(content => {
// File Content
}).catch(error => {
// error message
});
```
summary: Returns the contents of a remote file
operationId: getFileContents
parameters:
- name: remotePath
description: path to the remote file
in: query
type: string
responses:
"success":
description: File contents fetched successfuly
schema:
type: string
example: testContent
"faliure":
description: Non existent file given
schema:
type: string
example: File with name *FileName* could not be located
/putFileContents:
get:
tags:
- Files Management
description: |
```js
oc.files.putFileContents(remotePath, content).then(status => {
// True if succesful
}).catch(error => {
// error message
});
```
summary: Write data into a remote file
operationId: putFileContents
parameters:
- name: remotePath
description: path to the remote file
in: query
type: string
- name: content
in: query
description: content to be put
type: string
responses:
"success":
description: File contents put successfuly
schema:
type: boolean
"faliure":
description: Non existent path given
schema:
type: string
example: File with name *FolderName* could not be located
/mkdir:
get:
tags:
- Files Management
description: |
```js
oc.files.mkdir(remotePath).then(status => {
// True if successful
}).catch(error => {
// error message
});
```
summary: Creates a new folder
operationId: mkdir
parameters:
- name: remotePath
description: path of the new folder to be created
in: query
type: string
responses:
"success":
description: Folder created successfuly
schema:
type: boolean
"faliure":
description: Non existent path given
schema:
type: string
example: Parent node does not exist
/delete:
get:
tags:
- Files Management
description: |
```js
oc.files.delete(remotePath).then(status => {
// True if successful
}).catch(error => {
// error message
});
```
summary: Deletes a new file/folder
operationId: delete
parameters:
- name: remotePath
description: path of the file/folder to be deleted
in: query
type: string
responses:
"success":
description: File/folder deleted successfuly
schema:
type: boolean
"faliure":
description: Non existent path given
schema:
type: string
example: File with name *FileName* could not be located
/fileInfo:
get:
tags:
- Files Management
description: |
```js
oc.files.fileInfo(remotePath).then(info => {
// File Information
}).catch(error => {
// error message
});
```
summary: Returns the file info for the given remote file
operationId: fileI