Azure DevOps – REST APIs – Part 1 – for Projects

Hi All,
LIFE IS BEAUTIFUL 🙂 I hope we all are safe 🙂 STAY SAFE, STAY HEALTHY, STAY HOME 🙂
Background: We have started discussing Azure DevOps. In last seven articles of Azure DevOps we discussed
- Introductory part of Azure DevOps – Introduction of Azure DevOps
- Organizations in Azure DevOps – What are Azure DevOps Organizations, how to create Organizations, permissions etc.
- Microsoft Azure DevOps – Deleting and Recovering Organization
- Microsoft Azure DevOps – Projects – What are Azure DevOps Projects, how to create Projects, permissions etc.
- Microsoft Azure DevOps – Types of Projects – Public project, Private project
- Microsoft Azure DevOps – Project settings
- Microsoft Azure DevOps – Deleting and Recovering Projects
In this article we will move ahead and will discuss REST APIs for DevOps projects. We will access REST APIs from browser and in next upcoming articles we will discuss how we can programmatically access REST APIs
Take away from this article: At the end of this article we will got to know about
- What are REST APIs
- What are REST APIs
- What are REST APIs
Azure DevOps REST APIs scenarios : This is good question 🙂 why we require REST APIs for Azure DevOps services. There are quite few scenarios where I think we can utilize DevOps REST APIs such as
- Consider Jira Integration, as soon as bug / CR created in Jira, there should be new workitem in DevOps
- Similarly integration with Service Now tickets
- Integration with time card applications
Prerequisites :
- We must have an organization in Azure DevOps.
- Bit knowledge of REST APIs
What are REST APIs :
- Microsoft Defines – Representational State Transfer (REST) APIs are service endpoints that support sets of HTTP operations (methods)
- Azure REST APIs support GET, HEAD, PUT, POST, and PATCH methods
- These REST APIs can be consumed from browser and get the data in JSON format
Azure DevOps request URI :
- Format of the Azure DevOps request URI – What are REST APIs
- instance – The Azure DevOps Services organization. eg. – https://dev.azure.com/{organization}
- resource path: The resource path is as follows:
_apis/{area}/{resource}
. For example_apis/wit/workitems
. - api-version: api-versions are in the following format:
{major}.{minor}[-{stage}[.{resource-version}]]
, for example:api-version=1.0
api-version=1.2-preview
api-version=2.0-preview.1
- Best Practice : API version must be specified with every request.
Examples :
- Fetching all the projects in given Organization –
https://dev.azure.com/prashamsabadra/_apis/projects?api-version=2.0
count 2
value
0
id "d56fbb79-1205-4688-89c3-cbd13450702b"
name "Knowledge Junction Intranet"
description "Intranet application for Knowledge Junction"
url "https://dev.azure.com/prashamsabadra/_apis/projects/d56fbb79-1205-4688-89c3-cbd13450702b"
state "wellFormed"
revision 26
visibility "private"
lastUpdateTime "2020-08-28T04:28:36.11Z"
1
id "42592a57-9732-43bb-818c-9bd3687df0c3"
name "Managing M365 group lifecycle"
url "https://dev.azure.com/prashamsabadra/_apis/projects/42592a57-9732-43bb-818c-9bd3687df0c3"
state "wellFormed"
revision 11
visibility "private"
lastUpdateTime "2020-08-16T05:02:44.06Z"
- If we want specific project details, we can use Project ID or Project name as
https://dev.azure.com/prashamsabadra/_apis/projects/Knowledge%20Junction%20Intranet?api-version=6.0 OR
https://dev.azure.com/prashamsabadra/_apis/projects/d56fbb79-1205-4688-89c3-cbd13450702b?api-version=6.0
result will be :
id "d56fbb79-1205-4688-89c3-cbd13450702b"
name "Knowledge Junction Intranet"
description "Intranet application for Knowledge Junction"
url "https://dev.azure.com/prashamsabadra/_apis/projects/d56fbb79-1205-4688-89c3-cbd13450702b"
state "wellFormed"
revision 26
_links
self
href "https://dev.azure.com/prashamsabadra/_apis/projects/d56fbb79-1205-4688-89c3-cbd13450702b"
collection
href "https://dev.azure.com/prashamsabadra/_apis/projectCollections/00c6f6b9-c4b0-4a74-8f11-f923aa9a6525"
web
href "https://dev.azure.com/prashamsabadra/Knowledge Junction Intranet"
visibility "private"
defaultTeam
id "4af029c3-ba47-4caf-8f30-a8dde67ef7cb"
name "Knowledge Junction Intranet Team"
url "https://dev.azure.com/prashamsabadra/_apis/projects/d56fbb79-1205-4688-89c3-cbd13450702b/teams/4af029c3-ba47-4caf-8f30-a8dde67ef7cb"
lastUpdateTime "2020-08-28T04:28:36.11Z"
References:
Next Article : In next article we will discuss how to access/call Azure DevOps REST APIs programmatically.
We have very good series going on Azure DevOps. Please have a look once – https://knowledge-junction.in/?s=Azure+DevOps
Thanks for reading 🙂 Feel free to discuss / comment / questions 🙂 . SHARING IS CARING 🙂
Share In Teams:Enjoy the beautiful life 🙂 Have a FUN 🙂 HAVE A SAFE LIFE 🙂 TAKE CARE 🙂
1 Response
[…] Azure DevOps – REST APIs – Part 1 – for Projects […]