Newer Version Available
ContentHub Class
Namespace
ContentHub Methods
The following are methods for ContentHub. All methods are static.
addRepositoryItem(repositoryId, repositoryFolderId, file)
API Version
39.0
Requires Chatter
No
Signature
public static ConnectApi.RepositoryFolderItem addRepositoryItem(String repositoryId, String repositoryFolderId, ConnectApi.ContentHubItemInput file)
Parameters
- repositoryId
- Type: String
- The ID of the repository.
- repositoryFolderId
- Type: String
- The ID of the repository folder.
- file
- Type: ConnectApi.ContentHubItemInput
- The item type ID and fields of the item type.
Return Value
Example
This example creates a file without binary content (metadata only) in a repository folder. After the file is created, we show the file’s ID, name, description, external URL, and download URL.
addRepositoryItem(communityId, repositoryId, repositoryFolderId, file)
API Version
39.0
Requires Chatter
No
Signature
public static ConnectApi.RepositoryFolderItem addRepositoryItem(String communityId, String repositoryId, String repositoryFolderId, ConnectApi.ContentHubItemInput file)
Parameters
- communityId
- Type: String
- Use either the ID for a community, internal, or null.
- repositoryId
- Type: String
- The ID of the repository.
- repositoryFolderId
- Type: String
- The ID of the repository folder.
- file
- Type: ConnectApi.ContentHubItemInput
- The item type ID and fields of the item type.
Return Value
addRepositoryItem(repositoryId, repositoryFolderId, file, fileData)
API Version
39.0
Requires Chatter
No
Signature
public static ConnectApi.RepositoryFolderItem addRepositoryItem(String repositoryId, String repositoryFolderId, ConnectApi.ContentHubItemInput file, ConnectApi.BinaryInput fileData)
Parameters
- repositoryId
- Type: String
- The ID of the repository.
- repositoryFolderId
- Type: String
- The ID of the repository folder.
- file
- Type: ConnectApi.ContentHubItemInput
- The item type ID and fields of the item type.
- fileData
- Type: ConnectApi.BinaryInput
- The binary file.
Return Value
Example
addRepositoryItem(communityId, repositoryId, repositoryFolderId, file, fileData)
API Version
39.0
Requires Chatter
No
Signature
public static ConnectApi.RepositoryFolderItem addRepositoryItem(String communityId, String repositoryId, String repositoryFolderId, ConnectApi.ContentHubItemInput file, ConnectApi.BinaryInput fileData)
Parameters
- communityId
- Type: String
- Use either the ID for a community, internal, or null.
- repositoryId
- Type: String
- The ID of the repository.
- repositoryFolderId
- Type: String
- The ID of the repository folder.
- file
- Type: ConnectApi.ContentHubItemInput
- The item type ID and fields of the item type.
- fileData
- Type: ConnectApi.BinaryInput
- The binary file.
Return Value
getAllowedItemTypes(repositoryId, repositoryFolderId)
API Version
39.0
Requires Chatter
No
Signature
public static ConnectApi.ContentHubAllowedItemTypeCollection getAllowedItemTypes(String repositoryId, String repositoryFolderId)
Parameters
Return Value
getAllowedItemTypes(repositoryId, repositoryFolderId, filter)
API Version
39.0
Requires Chatter
No
Signature
public static ConnectApi.ContentHubAllowedItemTypeCollection getAllowedItemTypes(String repositoryId, String repositoryFolderId, ConnectApi.ConnectContentHubItemType filter)
Parameters
- repositoryId
- Type: String
- The ID of the repository.
- repositoryFolderId
- Type: String
- The ID of the repository folder.
- filter
- Type: ConnectApi.ContentHubItemType
- Specifies the item types. Values
are:
- Any—Includes files and folders.
- FilesOnly—Includes files only.
- FoldersOnly—Includes folders only.
Return Value
Example
This example calls getAllowedItemTypes(repositoryId, repositoryFolderId, ConnectApi.ContentHubItemType.FilesOnly) to get the first ConnectApi.ContentHubItemTypeSummary.id of a file. The context user can create allowed files in a repository folder in the external system.
getAllowedItemTypes(communityId, repositoryId, repositoryFolderId)
API Version
39.0
Requires Chatter
No
Signature
public static ConnectApi.ContentHubAllowedItemTypeCollection getAllowedItemTypes(String communityId, String repositoryId, String repositoryFolderId)
Parameters
Return Value
getAllowedItemTypes(communityId, repositoryId, repositoryFolderId, filter)
API Version
39.0
Requires Chatter
No
Signature
public static ConnectApi.ContentHubAllowedItemTypeCollection getAllowedItemTypes(String communityId, String repositoryId, String repositoryFolderId, ConnectApi.ConnectContentHubItemType filter)
Parameters
- communityId
- Type: String
- Use either the ID for a community, internal, or null.
- repositoryId
- Type: String
- The ID of the repository.
- repositoryFolderId
- Type: String
- The ID of the repository folder.
- filter
- Type: ConnectApi.ContentHubItemType
- Specifies the item types. Values
are:
- Any—Includes files and folders.
- FilesOnly—Includes files only.
- FoldersOnly—Includes folders only.
Return Value
getFilePreview(repositoryId, repositoryFileId, formatType)
API Version
39.0
Requires Chatter
No
Signature
public static ConnectApi.FilePreview getFilePreview(String repositoryId, String repositoryFileId, ConnectApi.FilePreviewFormat formatType)
Parameters
- repositoryId
- Type: String
- The ID of the repository.
- repositoryFileId
- Type: String
- The ID of the repository file.
- formatType
- Type: ConnectApi.FilePreviewFormat
-
Specifies the format of the file preview. Values are:
- Pdf—Preview format is PDF.
- Svg—Preview format is compressed SVG.
- Thumbnail—Preview format is 240 x 180 PNG.
- ThumbnailBig—Preview format is 720 x 480 PNG.
- ThumbnailTiny—Preview format is 120 x 90 PNG.
Return Value
Type: ConnectApi.FilePreview
Example
getFilePreview(repositoryId, repositoryFileId, formatType, startPageNumber, endPageNumber)
API Version
39.0
Requires Chatter
No
Signature
public static ConnectApi.FilePreview getFilePreview(String repositoryId, String repositoryFileId, ConnectApi.FilePreviewFormat formatType, Integer startPageNumber, Integer endPageNumber)
Parameters
- repositoryId
- Type: String
- The ID of the repository.
- repositoryFileId
- Type: String
- The ID of the repository file.
- formatType
- Type: ConnectApi.FilePreviewFormat
- Specifies the format of the file preview. Values are:
- Pdf—Preview format is PDF.
- Svg—Preview format is compressed SVG.
- Thumbnail—Preview format is 240 x 180 PNG.
- ThumbnailBig—Preview format is 720 x 480 PNG.
- ThumbnailTiny—Preview format is 120 x 90 PNG.
- startPageNumber
- Type: Integer
- The starting page number in the range of file preview URLs.
- endPageNumber
- Type: Integer
- The ending page number in the range of file preview URLs.
Return Value
Type: ConnectApi.FilePreview
getFilePreview(communityId, repositoryId, repositoryFileId, formatType)
API Version
39.0
Requires Chatter
No
Signature
public static ConnectApi.FilePreview getFilePreview(String communityId, String repositoryId, String repositoryFileId, ConnectApi.FilePreviewFormat formatType)
Parameters
- communityId
- Type: String
- Use either the ID for a community, internal, or null.
- repositoryId
- Type: String
- The ID of the repository.
- repositoryFileId
- Type: String
- The ID of the repository file.
- formatType
- Type: ConnectApi.FilePreviewFormat
- Specifies the format of the file preview. Values are:
- Pdf—Preview format is PDF.
- Svg—Preview format is compressed SVG.
- Thumbnail—Preview format is 240 x 180 PNG.
- ThumbnailBig—Preview format is 720 x 480 PNG.
- ThumbnailTiny—Preview format is 120 x 90 PNG.
Return Value
Type: ConnectApi.FilePreview
getFilePreview(communityId, repositoryId, repositoryFileId, formatType, startPageNumber, endPageNumber)
API Version
39.0
Requires Chatter
No
Signature
public static ConnectApi.FilePreview getFilePreview(String communityId, String repositoryId, String repositoryFileId, ConnectApi.FilePreviewFormat formatType, Integer startPageNumber, Integer endPageNumber)
Parameters
- communityId
- Type: String
- Use either the ID for a community, internal, or null.
- repositoryId
- Type: String
- The ID of the repository.
- repositoryFileId
- Type: String
- The ID of the repository file.
- formatType
- Type: ConnectApi.FilePreviewFormat
- Specifies the format of the file preview. Values are:
- Pdf—Preview format is PDF.
- Svg—Preview format is compressed SVG.
- Thumbnail—Preview format is 240 x 180 PNG.
- ThumbnailBig—Preview format is 720 x 480 PNG.
- ThumbnailTiny—Preview format is 120 x 90 PNG.
- startPageNumber
- Type: Integer
- The starting page number in the range of file preview URLs.
- endPageNumber
- Type: Integer
- The ending page number in the range of file preview URLs.
Return Value
Type: ConnectApi.FilePreview
getItemType(repositoryId, repositoryItemTypeId)
API Version
39.0
Requires Chatter
No
Signature
public static ConnectApi.ContentHubItemTypeDetail getItemType(String repositoryId, String repositoryItemTypeId)
Parameters
Return Value
getItemType(communityId, repositoryId, repositoryItemTypeId)
API Version
39.0
Requires Chatter
No
Signature
public static ConnectApi.ContentHubItemTypeDetail getItemType(String communityId, String repositoryId, String repositoryItemTypeId)
Parameters
Return Value
getPreviews(repositoryId, repositoryFileId)
API Version
39.0
Requires Chatter
No
Signature
public static ConnectApi.FilePreviewCollection getPreviews(String repositoryId, String repositoryFileId)
Parameters
Return Value
Example
getPreviews(communityId, repositoryId, repositoryFileId)
API Version
39.0
Requires Chatter
No
Signature
public static ConnectApi.FilePreviewCollection getPreviews(String communityId, String repositoryId, String repositoryFileId)
Parameters
Return Value
getRepositories()
API Version
39.0
Requires Chatter
No
Signature
public static ConnectApi.ContentHubRepositoryCollection getRepositories()
Return Value
Example
This example gets all repositories and gets the first SharePoint online repository found.
getRepositories(communityId)
API Version
39.0
Requires Chatter
No
Signature
public static ConnectApi.ContentHubRepositoryCollection getRepositories(String communityId)
Parameters
- communityId
- Type: String
- Use either the ID for a community, internal, or null.
Return Value
getRepositories(pageParam, pageSize)
API Version
39.0
Requires Chatter
No
Signature
public static ConnectApi.ContentHubRepositoryCollection getRepositories(Integer pageParam, Integer pageSize)
Parameters
Return Value
getRepositories(communityId, pageParam, pageSize)
API Version
39.0
Requires Chatter
No
Signature
public static ConnectApi.ContentHubRepositoryCollection getRepositories(String communityId, Integer pageParam, Integer pageSize)
Parameters
- communityId
- Type: String
- Use either the ID for a community, internal, or null.
- pageParam
- Type: Integer
- Specifies the number of the page you want returned. Starts at 0. If you pass in null or 0, the first page is returned.
- pageSize
- Type: Integer
- Specifies the number of items per page. Valid values are from 1 through 100. If you pass in null, the default page size is 25.
Return Value
getRepository(repositoryId)
API Version
369.0
Requires Chatter
No
Signature
public static ConnectApi.ContentHubRepository getRepository(String repositoryId)
Parameters
- repositoryId
- Type: String
- The ID of the repository.
Return Value
Example
getRepository(communityId, repositoryId)
API Version
39.0
Requires Chatter
No
Signature
public static ConnectApi.ContentHubRepository getRepository(String communityId, String repositoryId)
Parameters
Return Value
getRepositoryFile(repositoryId, repositoryFileId)
API Version
39.0
Requires Chatter
No
Signature
public static ConnectApi.RepositoryFileDetail getRepositoryFile(String repositoryId, String repositoryFileId)
Parameters
Return Value
Example
getRepositoryFile(repositoryId, repositoryFileId, includeExternalFilePermissionsInfo)
API Version
39.0
Requires Chatter
No
Signature
public static ConnectApi.RepositoryFileDetail getRepositoryFile(String repositoryId, String repositoryFileId, Boolean includeExternalFilePermissionsInfo)
Parameters
- repositoryId
- Type: String
- The ID of the repository.
- repositoryFileId
- Type: String
- The ID of the repository file.
- includeExternalFilePermissionsInfo
- Type: Boolean
- Specifies whether to include permission
information, such as whether the file is shared and what are the available
permission types.
Managing external file permissions is supported for Google Drive, SharePoint Online, and OneDrive for Business.
Return Value
Example
getRepositoryFile(communityId, repositoryId, repositoryFileId)
API Version
39.0
Requires Chatter
No
Signature
public static ConnectApi.RepositoryFileDetail getRepositoryFile(String communityId, String repositoryId, String repositoryFileId)
Parameters
Return Value
getRepositoryFile(communityId, repositoryId, repositoryFileId, includeExternalFilePermissionsInfo)
API Version
39.0
Requires Chatter
No
Signature
public static ConnectApi.RepositoryFileDetail getRepositoryFile(String communityId, String repositoryId, String repositoryFileId, Boolean includeExternalFilePermissionsInfo)
Parameters
- communityId
- Type: String
- Use either the ID for a community, internal, or null.
- repositoryId
- Type: String
- The ID of the repository.
- repositoryFileId
- Type: String
- The ID of the repository file.
- includeExternalFilePermissionsInfo
- Type: Boolean
- Specifies whether to include permission
information, such as whether the file is shared and what are the available
permission types.
Managing external file permissions is supported for Google Drive, SharePoint Online, and OneDrive for Business.
Return Value
getRepositoryFolder(repositoryId, repositoryFolderId)
API Version
39.0
Requires Chatter
No
Signature
public static ConnectApi.RepositoryFolderDetail getRepositoryFolder(String repositoryId, String repositoryFolderId)
Parameters
Return Value
Example
getRepositoryFolder(communityId, repositoryId, repositoryFolderId)
API Version
39.0
Requires Chatter
No
Signature
public static ConnectApi.RepositoryFolderDetail getRepositoryFolder(String communityId, String repositoryId, String repositoryFolderId)
Parameters
Return Value
getRepositoryFolderItems(repositoryId, repositoryFolderId)
API Version
39.0
Requires Chatter
No
Signature
public static ConnectApi.RepositoryFolderItemsCollection getRepositoryFolderItems(String repositoryId, String repositoryFolderId)
Parameters
Return Value
Example
getRepositoryFolderItems(communityId, repositoryId, repositoryFolderId)
API Version
39.0
Requires Chatter
No
Signature
public static ConnectApi.RepositoryFolderItemsCollection getRepositoryFolderItems(String communityId, String repositoryId, String repositoryFolderId)
Parameters
Return Value
getRepositoryFolderItems(repositoryId, repositoryFolderId, pageParam, pageSize)
API Version
39.0
Requires Chatter
No
Signature
public static ConnectApi.RepositoryFolderItemsCollection getRepositoryFolderItems(String repositoryId, String repositoryFolderId, Integer pageParam, Integer pageSize)
Parameters
- repositoryId
- Type: String
- The ID of the repository.
- repositoryFolderId
- Type: String
- The ID of the repository folder.
- pageParam
- Type: Integer
- Specifies the number of the page you want returned. Starts at 0. If you pass in null or 0, the first page is returned.
- pageSize
- Type: Integer
- Specifies the number of items per page. Valid values are from 1 through 100. If you pass in null, the default page size is 25.
Return Value
getRepositoryFolderItems(communityId, repositoryId, repositoryFolderId, pageParam, pageSize)
API Version
39.0
Requires Chatter
No
Signature
public static ConnectApi.RepositoryFolderItemsCollection getRepositoryFolderItems(String communityId, String repositoryId, String repositoryFolderId, Integer pageParam, Integer pageSize)
Parameters
- communityId
- Type: String
- Use either the ID for a community, internal, or null.
- repositoryId
- Type: String
- The ID of the repository.
- repositoryFolderId
- Type: String
- The ID of the repository folder.
- pageParam
- Type: Integer
- Specifies the number of the page you want returned. Starts at 0. If you pass in null or 0, the first page is returned.
- pageSize
- Type: Integer
- Specifies the number of items per page. Valid values are from 1 through 100. If you pass in null, the default page size is 25.
Return Value
updateRepositoryFile(repositoryId, repositoryFileId, file)
API Version
39.0
Requires Chatter
No
Signature
public static ConnectApi.RepositoryFileDetail updateRepositoryFile(String repositoryId, String repositoryFileId, ConnectApi.ContentHubItemInput file)
Parameters
- repositoryId
- Type: String
- The ID of the repository.
- repositoryFileId
- Type: String
- The ID of the repository file.
- file
- Type: ConnectApi.ContentHubItemInput
- The item type ID and fields of the item type.
Return Value
Example
updateRepositoryFile(repositoryId, repositoryFileId, file, fileData)
API Version
39.0
Requires Chatter
No
Signature
public static ConnectApi.RepositoryFileDetail updateRepositoryFile(String repositoryId, String repositoryFileId, ConnectApi.ContentHubItemInput file, ConnectApi.BinaryInput fileData)
Parameters
- repositoryId
- Type: String
- The ID of the repository.
- repositoryFileId
- Type: String
- The ID of the repository file.
- file
- Type: ConnectApi.ContentHubItemInput
- The item type ID and fields of the item type.
- fileData
- Type: ConnectApi.BinaryInput
- The binary file.
Return Value
Example
This example updates the content and metadata of a file in a repository. After the file is updated, we show the file’s ID, name, description, external URL, and download URL.
updateRepositoryFile(communityId, repositoryId, repositoryFileId, file)
API Version
39.0
Requires Chatter
No
Signature
public static ConnectApi.RepositoryFileDetail updateRepositoryFile(String communityId, String repositoryId, String repositoryFileId, ConnectApi.ContentHubItemInput file)
Parameters
- communityId
- Type: String
- Use either the ID for a community, internal, or null.
- repositoryId
- Type: String
- The ID of the repository.
- repositoryFileId
- Type: String
- The ID of the repository file.
- file
- Type: ConnectApi.ContentHubItemInput
- The item type ID and fields of the item type.
Return Value
updateRepositoryFile(communityId, repositoryId, repositoryFileId, file, fileData)
API Version
39.0
Requires Chatter
No
Signature
public static ConnectApi.RepositoryFileDetail updateRepositoryFile(String communityId, String repositoryId, String repositoryFileId, ConnectApi.ContentHubItemInput file, ConnectApi.BinaryInput fileData)
Parameters
- communityId
- Type: String
- Use either the ID for a community, internal, or null.
- repositoryId
- Type: String
- The ID of the repository.
- repositoryFileId
- Type: String
- The ID of the repository file.
- file
- Type: ConnectApi.ContentHubItemInput
- The item type ID and fields of the item type.
- fileData
- Type: ConnectApi.BinaryInput
- The binary file.