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