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}

DID THIS ARTICLE SOLVE YOUR ISSUE?
Let us know so we can improve!