Sep 20 2023
12:05 PM
- last edited on
Mar 05 2024
04:51 PM
by
TechCommunityAP
Sep 20 2023
12:05 PM
- last edited on
Mar 05 2024
04:51 PM
by
TechCommunityAP
Hey Everyone,
Hope you all are doing well,
I am trying to create an Azure DevOps Personal Access Token via PAT Lifecycle Management API to utilize Work Items API but I am getting 401 unauthorized Error.
Here's the curl request -
curl --location 'https://vssps.dev.azure.com/mayankaggarwal9919/_apis/tokens/pats?api-version=7.1-preview.1'
--header 'Content-Type: application/json'
--header 'Authorization: Basic [Redacted]'
--header 'Cookie: VstsSession=%7B%22PersistentSessionId%22%3A%229e3cefcb-0bf3-42cb-b3e3-9c76748cb94d%22%2C%22PendingAuthenticationSessionId%22%3A%2200000000-0000-0000-0000-000000000000%22%2C%22CurrentAuthenticationSessionId%22%3A%2200000000-0000-0000-0000-000000000000%22%2C%22SignInState%22%3A%7B%7D%7D; X-VSS-UseRequestRouting=True'
--data '
{
"displayName": "new_token",
"scope": "app_token",
"validTo": "2023-12-01T23:46:23.319Z",
"allOrgs": true
}
'
I tried passing the token in different formats like API Key, Basic and Bearer just to hit and try but getting the same error for all of them, Any insights will be highly appreciated.
Best,
Mayank
Sep 20 2023 03:35 PM
Sep 20 2023 06:25 PM