You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/integrate/get-started/rest/samples.md
+52-14Lines changed: 52 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,13 +2,14 @@
2
2
title: REST API samples
3
3
description: REST API samples for Azure DevOps, including personal access tokens (PATs).
4
4
ms.assetid: 9E17A266-051F-403F-A285-7F21D9CC52F0
5
+
ai-usage: ai-assisted
5
6
ms.subservice: azure-devops-ecosystem
6
7
ms.topic: conceptual
7
8
ms.custom: devx-track-dotnet
8
9
monikerRange: '<= azure-devops'
9
10
ms.author: chcomley
10
11
author: chcomley
11
-
ms.date: 03/21/2025
12
+
ms.date: 06/12/2025
12
13
---
13
14
14
15
# REST API samples for Azure DevOps
@@ -17,26 +18,30 @@ ms.date: 03/21/2025
17
18
18
19
Most samples in this article use personal access tokens (PATs). While PATs are a compact example for authentication, we don't recommend using them for production applications. There are many other authentication mechanisms available, including Microsoft Authentication Library, OAuth, and Session tokens. For more information to gauge which is best suited for your scenario, see [Authentication guidance](../authentication/authentication-guidance.md).
19
20
20
-
For more information, see [Azure DevOps Services REST API Reference](/rest/api/azure/devops/?view=azure-devops-rest-7.2&preserve-view=true) and [Get started with REST APIs](../../how-to/call-rest-api.md).
21
+
For more information, see [Azure DevOps REST API Reference](/rest/api/azure/devops/?view=azure-devops-rest-7.2&preserve-view=true) and [Get started with REST APIs](../../how-to/call-rest-api.md).
21
22
22
-
## Personal access tokens
23
+
## Authentication
23
24
24
-
Authenticate with Azure DevOps when you use the REST APIs or .NET Libraries.
25
+
Authenticate with Azure DevOps when using the REST APIs or .NET Libraries by following these steps:
25
26
26
-
Get started with these samples and [create a PAT](../../../organizations/accounts/use-personal-access-tokens-to-authenticate.md).
27
+
-**Create a PAT:**
28
+
Start with these samples and [create a personal access token (PAT)](../../../organizations/accounts/use-personal-access-tokens-to-authenticate.md).
27
29
28
-
> [!NOTE]
29
-
> We don't recommend using PATs. For more secure authentication mechanisms, see [Authentication guidance](../authentication/authentication-guidance.md).
To provide the PAT through an HTTP header, first convert it to a Base64 string. The following example shows how to convert to Base64 using C#. You can provide the resulting string as an HTTP header in the following format:
32
+
-**Use Basic Authentication with a PAT:**
33
+
1. Convert your PAT to a Base64-encoded string in the format `username:PAT` (the username can be empty).
34
+
2. Add the encoded string to the `Authorization` HTTP header.
0 commit comments