Newer Version Available

This content describes an older version of this product. View Latest

Get Repositories

Call a method to get all repositories.
Call getRepositories() to get all repositories and get the first SharePoint online repository found.
1final string sharePointOnlineProviderType ='ContentHubSharepointOffice365';
2final ConnectApi.ContentHubRepositoryCollection repositoryCollection = ConnectApi.ContentHub.getRepositories();
3ConnectApi.ContentHubRepository sharePointOnlineRepository = null;
4for(ConnectApi.ContentHubRepository repository : repositoryCollection.repositories){
5   if(sharePointOnlineProviderType.equalsIgnoreCase(repository.providerType.type)){
6      sharePointOnlineRepository = repository;
7      break;
8   }
9}