Вы пробовали API коллекций проектов ?
Пример запроса:
GET https://mytfsserver/DefaultCollection/_apis/projectCollections/d81542e4-cdfa-4333-b082-1ae2d6c3ad16?api-version=1.0-preview.2
Пример ответа:
{
"id": "d81542e4-cdfa-4333-b082-1ae2d6c3ad16",
"name": "DefaultCollection",
"url": "https://mytfsserver/DefaultCollection/_apis/projectCollections/d81542e4-cdfa-4333-b082-1ae2d6c3ad16",
"state": "Started",
"_links": {
"self": {
"href": "https://mytfsserver/DefaultCollection/_apis/projectCollections/d81542e4-cdfa-4333-b082-1ae2d6c3ad16"
},
"web": {
"href": "https://mytfsserver/DefaultCollection"
}
}
}
Существует также ссылка на некоторый пример кода C #.
using Microsoft.TeamFoundation.Core.WebApi;
using Microsoft.VisualStudio.Services.Common;
using Microsoft.VisualStudio.Services.WebApi;
using System;
using System.Collections.Generic;
namespace Microsoft.TeamServices.Samples.Client.ProjectsAndTeams
{
[ClientSample(CoreConstants.AreaName, CoreConstants.ProjectCollectionsResource)]
public class ProjectCollectionsSample : ClientSample
{
[ClientSampleMethod]
public IEnumerable<TeamProjectCollectionReference> ListProjectCollections()
{
VssConnection connection = Context.Connection;
ProjectCollectionHttpClient projectCollectionClient = connection.GetClient<ProjectCollectionHttpClient>();
IEnumerable<TeamProjectCollectionReference> projectCollections = projectCollectionClient.GetProjectCollections().Result;
foreach(var collection in projectCollections)
{
Console.WriteLine(collection.Name);
}
return projectCollections;
}
}
}