• Articles
  • Api Documentation
Show / Hide Table of Contents
  • Hyland.ShareBaseSdk
    • IShareBaseClient
    • ShareBaseClient
    • ShareBaseServerLocation
  • Hyland.ShareBaseSdk.Exceptions
    • ForbiddenAccessException
    • NotFoundException
    • ShareBaseException
    • ShareBaseInvalidPasswordException
  • Hyland.ShareBaseSdk.Models
    • DocumentShare
    • DocumentShareLinks
    • Embedded
    • ExpireStyle
    • FolderShare
    • FolderShareLinks
    • ICreateFolderCommand
    • IEmbedded
    • IShareBaseDocument
    • IShareBaseFolder
    • IShareBaseLibrary
    • IShareBaseTempFile
    • IShareBaseTempFileLinks
    • ITagSearchResponse
    • ShareBaseDocument
    • ShareBaseFolder
    • ShareBaseLibrary
    • ShareBaseTagType
    • ShareBaseTagTypeInput
    • ShareBaseTagTypeValue
    • SharedDocumentOptions
    • SharedFolderOptions
    • ShareOptions
    • ShareType
    • TagTypeAssociation
    • TagTypeConstraints
    • TagTypeDataType

Class ShareBaseClient

A client for communication to ShareBase.

Inheritance
System.Object
ShareBaseClient
Implements
IShareBaseClient
System.IDisposable
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Hyland.ShareBaseSdk
Assembly: Hyland.ShareBaseSdk.dll
Syntax
public class ShareBaseClient : IShareBaseClient, IDisposable

Constructors

ShareBaseClient(ShareBaseServerLocation, String, String, String, ILogger, HttpClient, Int64)

Constructs a ShareBaseClient for communicating to ShareBase.

The client gets created with an address and token to communicate to ShareBase, an application name and version for the project integrating with ShareBase, and optionally an System.Net.Http.HttpClient.

If the HttpClient is not provided, a default is used, which has a timeout of 90 seconds. It also has a System.Net.Http.HttpClientHandler with a new System.Net.Http.HttpClientHandler.CookieContainer, without using cookies, using System.Net.CredentialCache.DefaultCredentials, and with System.Net.Http.HttpClientHandler.PreAuthenticate set to true.

Declaration
public ShareBaseClient(ShareBaseServerLocation withServerLocation, string withToken, string withAppName, string withAppVersion, ILogger withLogger = null, HttpClient httpClient = null, long maxLogLength = 1024000L)
Parameters
Type Name Description
ShareBaseServerLocation withServerLocation

The server location of the ShareBase API.

System.String withToken

A valid ShareBase API token.

System.String withAppName

The name of the application using the SDK.

System.String withAppVersion

The version of the application using the SDK.

Microsoft.Extensions.Logging.ILogger withLogger

An optional ILogger for getting detailed logging information.

System.Net.Http.HttpClient httpClient

An optional System.Net.Http.HttpClient

System.Int64 maxLogLength

An optional parameter to set the maximum size to log when logging HTTP responses. Defaults to 1 MB.

Exceptions
Type Condition
System.ArgumentNullException

The server url, token, app name, or app version was null.

System.ArgumentException

The server url, token, app name, or app version was whitespace.

ShareBaseClient(String, String, String, String, ILogger, HttpClient, Int64)

Constructs a ShareBaseClient for communicating to ShareBase.

The client gets created with an address and token to communicate to ShareBase, an application name and version for the project integrating with ShareBase, and optionally an System.Net.Http.HttpClient.

If the HttpClient is not provided, a default is used, which has a timeout of 120 seconds. It also has a System.Net.Http.HttpClientHandler with a new System.Net.Http.HttpClientHandler.CookieContainer, without using cookies, using System.Net.CredentialCache.DefaultCredentials, and with System.Net.Http.HttpClientHandler.PreAuthenticate set to true.

Declaration
public ShareBaseClient(string withServerUrl, string withToken, string withAppName, string withAppVersion, ILogger withLogger = null, HttpClient httpClient = null, long maxLogLength = 1024000L)
Parameters
Type Name Description
System.String withServerUrl

The server address of the ShareBase API.

System.String withToken

A valid ShareBase API token.

System.String withAppName

The name of the application using the SDK.

System.String withAppVersion

The version of the application using the SDK.

Microsoft.Extensions.Logging.ILogger withLogger

An optional ILogger for getting detailed logging information.

System.Net.Http.HttpClient httpClient

An optional System.Net.Http.HttpClient

System.Int64 maxLogLength

An optional parameter to set the maximum size to log when logging HTTP responses. Defaults to 1 MB.

Exceptions
Type Condition
System.ArgumentNullException

The server url, token, app name, or app version was null.

System.ArgumentException

The server url, token, app name, or app version was whitespace.

Methods

AddDocumentToFolderAsync(Int64, String, Stream, CancellationToken)

Adds a document to a folder using specified stream.

Note, invalid characters in the document name (e.g. "?") will each be sanitized and replaced with an underscore symbol ("_").

Declaration
public Task<IShareBaseDocument> AddDocumentToFolderAsync(long folderId, string documentName, Stream stream, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.Int64 folderId

The id of the folder to add the document to.

System.String documentName

The name of the document.

System.IO.Stream stream

A stream containing document.

System.Threading.CancellationToken cancellationToken

The cancellation token to use.

Returns
Type Description
System.Threading.Tasks.Task<IShareBaseDocument>

The created document.

Exceptions
Type Condition
System.ArgumentOutOfRangeException

The folder id was equal to or less than zero.

System.ArgumentException

The name was empty or whitespace.

System.ArgumentNullException

The named was null or the stream was null.

ShareBaseException

The filename contained invalid characters for Windows.

NotFoundException

The folder was not found.

ForbiddenAccessException

Insufficient access to the specified folder.

ShareBaseException

AssociateTagTypesToFolderAsync(Int64, TagTypeAssociation[], CancellationToken)

Associates tag types to a folder.

Declaration
public Task AssociateTagTypesToFolderAsync(long folderId, TagTypeAssociation[] tagTypeAssociation, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.Int64 folderId

The id of the folder.

TagTypeAssociation[] tagTypeAssociation

Tag type association.

System.Threading.CancellationToken cancellationToken

The cancellation token to use.

Returns
Type Description
System.Threading.Tasks.Task
Exceptions
Type Condition
NotFoundException

The folder was not found.

ForbiddenAccessException

Insufficient access to create tag type associations for the folder.

ForbiddenAccessException

Insufficient access to manage tag types.

ShareBaseException

CreateDocumentShareAsync(Int64, SharedDocumentOptions, CancellationToken)

Creates a document share.

Declaration
public Task<DocumentShare> CreateDocumentShareAsync(long documentId, SharedDocumentOptions options, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.Int64 documentId

The id of the document to create a share for.

SharedDocumentOptions options

The options for the document share.

System.Threading.CancellationToken cancellationToken

The cancellation token to use.

Returns
Type Description
System.Threading.Tasks.Task<DocumentShare>

Created DocumentShare.

Exceptions
Type Condition
System.ArgumentOutOfRangeException

The document id was less than or equal to zero.

System.ArgumentNullException

The options argument was null.

ShareBaseInvalidPasswordException

The password settings for the document share were invalid.

ShareBaseException

There was an error creating the document share.

ForbiddenAccessException

Insufficient access to create shares for the specified document.

NotFoundException

The document with the given Id was not found.

ShareBaseException

CreateFolderAsync(Int64, String, CancellationToken)

Creates a new folder with a specified folder name.

Note, invalid characters in the folder name (e.g. "?") will each be sanitized and replaced with an underscore symbol ("_").

Declaration
public Task<IShareBaseFolder> CreateFolderAsync(long libraryId, string folderName, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.Int64 libraryId

The id of the library under which to create the folder.

System.String folderName

The folder name.

System.Threading.CancellationToken cancellationToken

The cancellation token to use.

Returns
Type Description
System.Threading.Tasks.Task<IShareBaseFolder>

The created folder.

Exceptions
Type Condition
System.ArgumentOutOfRangeException

The library id was less than or equal to zero.

System.ArgumentNullException

The folder name was null.

System.ArgumentException

The folder name was empty.

NotFoundException

The library was not found.

ForbiddenAccessException

Insufficient access to get the specified library.

ShareBaseException

CreateFolderAsync(Int64, CancellationToken)

Creates a new folder with an auto-generated name.

Declaration
public Task<IShareBaseFolder> CreateFolderAsync(long libraryId, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.Int64 libraryId

The id of the library under which to create the folder.

System.Threading.CancellationToken cancellationToken

The cancellation token to use.

Returns
Type Description
System.Threading.Tasks.Task<IShareBaseFolder>

The created folder.

Exceptions
Type Condition
System.ArgumentOutOfRangeException

The library id was less than or equal to zero.

NotFoundException

The library was not found.

ForbiddenAccessException

Insufficient access to get the specified library.

ShareBaseException

CreateFolderPathAsync(Int64, String, CancellationToken)

Creates a nested folder structure from the specified folder path.

Note, invalid characters in the folder path (e.g. "?") will each be sanitized and replaced with an underscore symbol ("_").

Declaration
public Task<IShareBaseFolder> CreateFolderPathAsync(long libraryId, string folderPath, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.Int64 libraryId

The id of the library under which to create the folder.

System.String folderPath

A string representing the folder structure to create. Ex: "Level1\Level2\Level3"

System.Threading.CancellationToken cancellationToken

The cancellation token to use.

Returns
Type Description
System.Threading.Tasks.Task<IShareBaseFolder>

The inner-most created folder.

Exceptions
Type Condition
System.ArgumentOutOfRangeException

The library id was less than or equal to zero.

System.ArgumentNullException

The folder path was null.

System.ArgumentException

The folder path was empty.

NotFoundException

The library was not found.

ForbiddenAccessException

Insufficient access to get the specified library.

ShareBaseException

CreateFolderShareAsync(Int64, SharedFolderOptions, CancellationToken)

Creates a folder share.

Declaration
public Task<FolderShare> CreateFolderShareAsync(long folderId, SharedFolderOptions options, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.Int64 folderId

The id of the folder to create a share for.

SharedFolderOptions options

The options for the folder share.

System.Threading.CancellationToken cancellationToken

The cancellation token to use.

Returns
Type Description
System.Threading.Tasks.Task<FolderShare>

Created FolderShare.

Exceptions
Type Condition
System.ArgumentOutOfRangeException

The folder id was less than or equal to zero.

System.ArgumentNullException

The options argument was null.

NotFoundException

The folder was not found.

ForbiddenAccessException

Insufficient access to create the folder share.

ShareBaseException

CreateLibraryTagTypeAsync(Int64, ShareBaseTagTypeInput, CancellationToken)

Creates a library tag type.

Declaration
public Task<ShareBaseTagType> CreateLibraryTagTypeAsync(long libraryId, ShareBaseTagTypeInput tagType, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.Int64 libraryId

Library Id.

ShareBaseTagTypeInput tagType

TagType.

System.Threading.CancellationToken cancellationToken

The cancellation token to use.

Returns
Type Description
System.Threading.Tasks.Task<ShareBaseTagType>

The newly created tag type.

Exceptions
Type Condition
System.ArgumentNullException

The tag type is null.

NotFoundException

The library was not found.

ForbiddenAccessException

Insufficient access to create a tag type for the library.

ForbiddenAccessException

Insufficient access to manage tag types.

ShareBaseException

DeleteDocumentAsync(Int64, CancellationToken)

Deletes a specified document from ShareBase.

Declaration
public Task DeleteDocumentAsync(long documentId, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.Int64 documentId

The id of the document to delete.

System.Threading.CancellationToken cancellationToken

The cancellation token to use.

Returns
Type Description
System.Threading.Tasks.Task
Exceptions
Type Condition
System.ArgumentOutOfRangeException

The document id was less than or equal to zero.

NotFoundException

The document was not found.

ForbiddenAccessException

Insufficient access to the specified document.

ShareBaseException

DeleteFolderAsync(Int64, CancellationToken)

Deletes a specified folder from ShareBase.

Declaration
public Task DeleteFolderAsync(long folderId, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.Int64 folderId

The id of the folder to delete.

System.Threading.CancellationToken cancellationToken

The cancellation token to use.

Returns
Type Description
System.Threading.Tasks.Task
Exceptions
Type Condition
System.ArgumentOutOfRangeException

The folder id was less than or equal to zero.

NotFoundException

The folder was not found.

ForbiddenAccessException

Insufficient access to the specified folder.

ShareBaseException

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

Declaration
public void Dispose()

GetDocumentAsync(Int64, CancellationToken)

Gets a document by id.

Declaration
public Task<IShareBaseDocument> GetDocumentAsync(long documentId, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.Int64 documentId

The id of the document.

System.Threading.CancellationToken cancellationToken

The cancellation token to use.

Returns
Type Description
System.Threading.Tasks.Task<IShareBaseDocument>
Exceptions
Type Condition
System.ArgumentException

The document id was zero.

NotFoundException

The document was not found.

ForbiddenAccessException

Insufficient access to get the document.

ShareBaseException

GetDocumentContentsAsync(Int64, CancellationToken)

Gets a streamed document from ShareBase.

Declaration
public Task<Stream> GetDocumentContentsAsync(long documentId, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.Int64 documentId

The id of the document to download.

System.Threading.CancellationToken cancellationToken

The cancellation token to use.

Returns
Type Description
System.Threading.Tasks.Task<System.IO.Stream>

Stream containing document data.

Exceptions
Type Condition
System.ArgumentOutOfRangeException

The document id was less than or equal to zero.

NotFoundException

The document was not found.

ForbiddenAccessException

Insufficient access to get the document.

ShareBaseException

GetDocumentsInFolderAsync(Int64, Nullable<DateTime>, Nullable<DateTime>, CancellationToken)

Retrieves a list of all documents in a folder.

Declaration
public Task<IEnumerable<IShareBaseDocument>> GetDocumentsInFolderAsync(long folderId, DateTime? fromDate = default(DateTime? ), DateTime? toDate = default(DateTime? ), CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.Int64 folderId

The id of the folder.

System.Nullable<System.DateTime> fromDate

(optional) Obtain documents starting from this date.

System.Nullable<System.DateTime> toDate

(optional) Obtain documents up to this date.

System.Threading.CancellationToken cancellationToken

The cancellation token to use.

Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<IShareBaseDocument>>

List of documents for given folder.

Exceptions
Type Condition
System.ArgumentOutOfRangeException

The folder id was less than or equal to zero.

NotFoundException

The folder was not found.

ForbiddenAccessException

Insufficient access to get the documents in the folder.

ShareBaseException

GetDocumentsInLibraryForTagTypeAsync(Int64, ShareBaseTagTypeValue, CancellationToken)

Searches a library for any documents tagged with a specific tag.

Declaration
public Task<IEnumerable<IShareBaseDocument>> GetDocumentsInLibraryForTagTypeAsync(long libraryId, ShareBaseTagTypeValue tagTypeValue, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.Int64 libraryId

The library to search.

ShareBaseTagTypeValue tagTypeValue

The tag to use to search for documents.

System.Threading.CancellationToken cancellationToken

The cancellation token to use.

Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<IShareBaseDocument>>

List of documents.

Exceptions
Type Condition
NotFoundException

The library was not found.

ForbiddenAccessException

Insufficient access to get documents in the library.

ShareBaseException

GetFolderAsync(Int64, Boolean, Boolean, CancellationToken)

Gets a Folder by Id.

Declaration
public Task<IShareBaseFolder> GetFolderAsync(long folderId, bool embedFolders = false, bool embedDocuments = false, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.Int64 folderId

The id of the folder to retrieve.

System.Boolean embedFolders

Whether to return embedded folders inside of the folder.

System.Boolean embedDocuments

Whether to return embedded documents inside of the folder.

System.Threading.CancellationToken cancellationToken

The cancellation token to use.

Returns
Type Description
System.Threading.Tasks.Task<IShareBaseFolder>

The specified folder.

Exceptions
Type Condition
NotFoundException

The folder was not found.

ForbiddenAccessException

Insufficient access to get the specified folder.

ShareBaseException

GetFolderByPathAsync(Int64, String, CancellationToken)

Gets a folder by the id of its library and its full path.

Declaration
public Task<IShareBaseFolder> GetFolderByPathAsync(long libraryId, string folderPath, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.Int64 libraryId

The id of the library the folder is in.

System.String folderPath

The path to the folder that includes the folder name. Example: "folder1/folder2/targetFolder"

System.Threading.CancellationToken cancellationToken

The cancellation token to use.

Returns
Type Description
System.Threading.Tasks.Task<IShareBaseFolder>

The specified folder or null if a folder in that library with that path isn't found.

Exceptions
Type Condition
System.ArgumentOutOfRangeException

The library id was less than or equal to zero.

System.ArgumentNullException

The folder path was null.

System.ArgumentException

The folder path was empty.

NotFoundException

The library was not found.

ForbiddenAccessException

Insufficient access to the specified library.

ShareBaseException

GetFoldersInLibraryAsync(Int64, String, CancellationToken)

Retrieves the child folders of a folder in a library.

Declaration
public Task<IEnumerable<IShareBaseFolder>> GetFoldersInLibraryAsync(long libraryId, string path, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.Int64 libraryId

The id of the library whose folders should be retrieved.

System.String path

The path of the specific folder in the library.

System.Threading.CancellationToken cancellationToken

The cancellation token to use.

Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<IShareBaseFolder>>

List of folders.

Exceptions
Type Condition
System.ArgumentOutOfRangeException

The library id was less than or equal to zero.

System.ArgumentNullException

The path was null.

NotFoundException

The library was not found.

ForbiddenAccessException

Insufficient access to the specified library or folder.

ShareBaseException

GetFoldersInLibraryAsync(Int64, CancellationToken)

Returns all folders from a given library.

Declaration
public Task<IEnumerable<IShareBaseFolder>> GetFoldersInLibraryAsync(long libraryId, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.Int64 libraryId

The id of the library to obtain folders from.

System.Threading.CancellationToken cancellationToken

The cancellation token to use.

Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<IShareBaseFolder>>

List of folders.

Exceptions
Type Condition
System.ArgumentOutOfRangeException

The library id was less than or equal to zero.

NotFoundException

The library was not found.

ForbiddenAccessException

Insufficient access to the specified library.

ShareBaseException

GetLibrariesAsync(CancellationToken)

Gets all available libraries.

Declaration
public Task<IEnumerable<IShareBaseLibrary>> GetLibrariesAsync(CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.Threading.CancellationToken cancellationToken

The cancellation token to use.

Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<IShareBaseLibrary>>

List of libraries.

Exceptions
Type Condition
ShareBaseException

GetLibraryAsync(Int64, CancellationToken)

Gets a library by id.

Declaration
public Task<IShareBaseLibrary> GetLibraryAsync(long libraryId, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.Int64 libraryId

The id of the library to retrieve.

System.Threading.CancellationToken cancellationToken

The cancellation token to use.

Returns
Type Description
System.Threading.Tasks.Task<IShareBaseLibrary>

The specified library.

Exceptions
Type Condition
NotFoundException

The library was not found.

ForbiddenAccessException

Insufficient access to get the specified library.

ShareBaseException

GetLibraryAsync(String, CancellationToken)

Gets a library by name.

Declaration
public Task<IShareBaseLibrary> GetLibraryAsync(string withName, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String withName

The name of the library to retrieve.

System.Threading.CancellationToken cancellationToken

The cancellation token to use.

Returns
Type Description
System.Threading.Tasks.Task<IShareBaseLibrary>

The specified library.

Exceptions
Type Condition
System.ArgumentNullException

The library name was null.

System.ArgumentException

The library name was empty.

NotFoundException

The library was not found.

ForbiddenAccessException

Insufficient access to get the specified library.

ShareBaseException

GetLibraryTagTypesAsync(Int64, CancellationToken)

Gets all tag types for a library.

Declaration
public Task<IEnumerable<ShareBaseTagType>> GetLibraryTagTypesAsync(long libraryId, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.Int64 libraryId

Library Id.

System.Threading.CancellationToken cancellationToken

The cancellation token to use.

Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<ShareBaseTagType>>

List of tag types.

Exceptions
Type Condition
NotFoundException

The library was not found.

ForbiddenAccessException

Insufficient access to get tag types for the library.

ShareBaseException

GetLibraryTagTypesByTagTypeNameAsync(Int64, String, CancellationToken)

Gets library tag type by name.

Declaration
public Task<IEnumerable<ShareBaseTagType>> GetLibraryTagTypesByTagTypeNameAsync(long libraryId, string tagTypeName, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.Int64 libraryId

Library Id.

System.String tagTypeName

TagType name.

System.Threading.CancellationToken cancellationToken

The cancellation token to use.

Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<ShareBaseTagType>>

List of tag types.

Exceptions
Type Condition
System.ArgumentNullException

The tag type name was null.

System.ArgumentException

The tag type name was empty.

NotFoundException

The library was not found.

ForbiddenAccessException

Insufficient access to get tag types for the library.

NotFoundException

A tag type with that name was not found.

ShareBaseException

GetSubFoldersAsync(Int64, CancellationToken)

Retrieves the child folders of a folder.

Declaration
public Task<IEnumerable<IShareBaseFolder>> GetSubFoldersAsync(long folderId, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.Int64 folderId

The id of the folder whose children should be retrieved.

System.Threading.CancellationToken cancellationToken

The cancellation token to use.

Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<IShareBaseFolder>>

List of folders.

Exceptions
Type Condition
NotFoundException

The folder was not found.

ForbiddenAccessException

Insufficient access to the specified folder.

ShareBaseException

MoveDocumentToFolderAsync(IShareBaseDocument, Int64, CancellationToken)

Moves an existing document to a different folder.

Declaration
public Task<IShareBaseDocument> MoveDocumentToFolderAsync(IShareBaseDocument document, long folderId, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
IShareBaseDocument document

The document to move.

System.Int64 folderId

The id of the destination folder.

System.Threading.CancellationToken cancellationToken

The cancellation token to use.

Returns
Type Description
System.Threading.Tasks.Task<IShareBaseDocument>

The specified document.

Exceptions
Type Condition
System.ArgumentNullException

The document was null.

System.ArgumentOutOfRangeException

The folder id was less than or equal to zero.

NotFoundException

The document was not found or the destination folder was not found.

ForbiddenAccessException

Insufficient access to move the document to the destination.

ShareBaseException

PurgeDocumentAsync(Int64, CancellationToken)

Purges a specified document from ShareBase.

Declaration
public Task PurgeDocumentAsync(long documentId, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.Int64 documentId

The id of the document to purge.

System.Threading.CancellationToken cancellationToken

The cancellation token to use.

Returns
Type Description
System.Threading.Tasks.Task
Exceptions
Type Condition
System.ArgumentOutOfRangeException

The document id was less than or equal to zero.

NotFoundException

The document was not found.

ForbiddenAccessException

Insufficient access to the specified document, or purging is disabled.

ShareBaseException

PurgeFolderAsync(Int64, CancellationToken)

Purges a specified folder from ShareBase.

Declaration
public Task PurgeFolderAsync(long folderId, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.Int64 folderId

The id of the folder to purge.

System.Threading.CancellationToken cancellationToken

The cancellation token to use.

Returns
Type Description
System.Threading.Tasks.Task
Exceptions
Type Condition
System.ArgumentOutOfRangeException

The folder id was less than or equal to zero.

NotFoundException

The folder was not found.

ForbiddenAccessException

Insufficient access to the specified folder, or purging is disabled.

ShareBaseException

RemoveMonitoredTagTypeAssociationsForFolderAsync(Int64, CancellationToken)

Removes the global Monitored tag type associations for a folder and its documents. This can be used to stop folders from being monitored, and must be called by a site admin who has Modify access to the folder.

Note, the association is only removed from documents in the folder in the request. Tag associations and values remain for child folders. Further calls should be made if it is desired to stop monitoring sub-folders and their documents.

Declaration
public Task RemoveMonitoredTagTypeAssociationsForFolderAsync(long forFolderWithId, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.Int64 forFolderWithId

The id of the folder to stop monitoring.

System.Threading.CancellationToken cancellationToken

The cancellation token to use.

Returns
Type Description
System.Threading.Tasks.Task
Exceptions
Type Condition
NotFoundException

The specified folder was not found.

ForbiddenAccessException

Insufficient access to manage tags or insufficient access to modify the folder.

ShareBaseException

ReviseDocumentAsync(Int64, String, Stream, CancellationToken)

Adds a revision to an existing ShareBase document using specified Stream.

Note, invalid characters in the document name (e.g. "?") will each be sanitized and replaced with an underscore symbol ("_").

Declaration
public Task<IShareBaseDocument> ReviseDocumentAsync(long documentId, string documentName, Stream stream, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.Int64 documentId

The id of the document to revise.

System.String documentName

The name of the document revision.

System.IO.Stream stream

Stream containing document.

System.Threading.CancellationToken cancellationToken

The cancellation token to use.

Returns
Type Description
System.Threading.Tasks.Task<IShareBaseDocument>

The specified document.

Exceptions
Type Condition
System.ArgumentOutOfRangeException

The document id was less than or equal to zero.

System.ArgumentException

The name was empty or whitespace.

System.ArgumentNullException

The name or stream were null.

NotFoundException

The document was not found.

ForbiddenAccessException

Insufficient access to revise the document.

ShareBaseException

The name was invalid.

ShareBaseException

TryGetFolderAsync(Int64, Boolean, Boolean, CancellationToken)

Tries to get a folder by id. If not found, null will be returned.

Declaration
public Task<IShareBaseFolder> TryGetFolderAsync(long folderId, bool embedFolders = false, bool embedDocuments = false, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.Int64 folderId

The id of the folder to retrieve.

System.Boolean embedFolders

Whether to return embedded folders inside of the folder.

System.Boolean embedDocuments

Whether to return embedded documents inside of the folder.

System.Threading.CancellationToken cancellationToken

The cancellation token to use.

Returns
Type Description
System.Threading.Tasks.Task<IShareBaseFolder>

The specified folder or null if not found.

Exceptions
Type Condition
ForbiddenAccessException

Insufficient access to get the specified folder.

ShareBaseException

Implements

IShareBaseClient
System.IDisposable
Back to top Generated by DocFX