microsoft / azure-devops-dotnet-samples

.NET/C# samples for integrating with Azure DevOps Services and Azure DevOps Server
https://docs.microsoft.com/azure/devops/integrate
MIT License
522 stars 518 forks source link

How do I queue a build? #311

Open anirbansaha96 opened 3 years ago

anirbansaha96 commented 3 years ago

I am trying to Queue a Build using a REST API call. I am sending a POST request to POST https://dev.azure.com/{organization}/{project}/_apis/build/builds?api-version=6.0 With the request body:

{"build" : {
  "Definition" : 1
}
}

I have also tried other request body sample. But none of them works. How do I send a request to queue this build? In the header, I am sending my PAT and it is working.