2

According to the Azure DevOps Services REST API Reference, the request URI has the following format:

https://{instance}[/{team-project}]/_apis[/{area}]/{resource}?api-version={version}

Regarding the api-version:

Every API request should include an api-version to avoid having your app or service break as APIs evolve.

I started using the .NET client libraries for Azure DevOps Services (and TFS) to manage dashboards programmatically.

I am able to connect to Azure DevOps using a Personal Access Token:

var credential = new VssBasicCredential(string.Empty, "PersonalAccessToken");

using (VssConnection connection = new VssConnection(new Uri("...."), credential))
using (var client = connection.GetClient<DashboardHttpClient>())
{
     // ...
}

How can I specify the API version? Does it still make sense to do it, when using the .NET client libraries?

user247702
  • 22,915
  • 14
  • 108
  • 152
Rui Jarimba
  • 10,350
  • 10
  • 55
  • 79

1 Answers1

2

The API version is decided by the client libraries. You can confirm this by disassembling them (e.g. using ILSpy).

For example, in the current stable release of Microsoft.TeamFoundationServer.Client, DashboardHttpClientBase has a CreateDashboardAsnc method that makes the following call:

this.SendAsync<Dashboard>(..., new ApiResourceVersion("4.1-preview.2"), ...);
user247702
  • 22,915
  • 14
  • 108
  • 152