9

Does Azure DevOps REST API has swagger url?

I would like to be able to generate wrapper code in C# or Powershell around it, but cannot find it.

mark
  • 59,016
  • 79
  • 296
  • 580

3 Answers3

14

OpenAPI 2.0 definitions for Azure DevOps Services REST APIs are available in this repository:

https://github.com/MicrosoftDocs/vsts-rest-api-specs

Helen
  • 87,344
  • 17
  • 243
  • 314
5

I am afraid there is not swagger url for azure devops api. Azure DevOps Services .NET SDK is available to integrate with C#.

Here is an example showing how to use Azure DevOps Services .NET SDK.

Here is an example showing how to call Restful api via httpclient.

For powershell You can refer to below example:

$url = "https://dev.azure.com/<...>/MyconsoleApp/_apis/wiki/wikis/MyconsoleApp.wiki/pages?path=/SamplePage123&api-version=5.0"
$connectionToken="xxxxxxxxxxxxxxxxxxxxxxxxx"
$base64AuthInfo= System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes(":$($connectionToken)"))
$pipeline = Invoke-RestMethod -Uri $url -Headers @{authorization = "Basic $base64AuthInfo"} -Method Get
Levi Lu-MSFT
  • 27,483
  • 2
  • 31
  • 43
  • I think this is alittle silly. If I just want to poke the API in postman for example, and not build a client to do it or use Powershell? – garfbradaz May 01 '20 at 16:19
2

You can check out AzurePipelinesPS on the PSGallery it is a PowerShell module that wraps the api.

If you would prefer to write your own wrapper you can check out the rest api documentation.

Dejulia489
  • 1,165
  • 8
  • 14