10

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.

0

4 Answers 4

15

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

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

Sign up to request clarification or add additional context in comments.

Comments

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

1 Comment

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?
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.

Comments

0

Some of the available Swagger 2.0 documents for the AzDOS REST API at GitHub has been imported to SwaggerHub. You will be required to register an account.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.