getting 203 with error when using vsts rest api
Asked Answered
A

3

9

When I'm trying to create a new work item in VSTS with the POST request:

https://galilinetsky.visualstudio.com/Automatiom/_apis/wit/workitems/$Test%20Case?api-version=5.0-preview.2

I get the next response :

Microsoft Internet Explorer's Enhanced Security Configuration is currently enabled on your environment. This enhanced level of security prevents our web integration experiences from displaying or performing correctly. To continue with your operation please disable this configuration or contact your administrator.

What am I doing wrong?

Arlaarlan answered 19/8, 2018 at 1:1 Comment(5)
Which version of windows you are using?Shulem
windows 10, i tried the same on windows 7Arlaarlan
Do you use PAT?Propertied
I tried but it didn't helpArlaarlan
Does this answer your question? Azure Devops 203 Non-Authoritative Information with REST APIEthelda
T
9

It's mainly caused by the PAT format is incorrect.

Such as if I add colon : before the PAT, the REST API will return with 203.

enter image description here

Trenna answered 20/8, 2018 at 11:14 Comment(1)
I get the same problem with my GET/POST requests, but there is no colon before the Personal Access Token, and adding one to the PAT results in a 401 error (instead of a 203 error).Fabriane
F
23

The solution is to be found in a similar question: Why I get Internet Explorer enhanced security error message in Chrome if I call VSO API from Angularjs SPA?

Andy writes

the PAT has to be prefix[ed] by ":" before you base 64 encode it"

So the solution is:

  1. Create a Personal Access Token
  2. Add a colon (':') before it
  3. Encode the new PAT (with the preceding colon) using Base 64

Et voila ! That PAT will no longer give you a 203 error.

Fabriane answered 8/3, 2019 at 12:30 Comment(1)
Thanks for this. Would never have figured it out on my own!Kimi
T
9

It's mainly caused by the PAT format is incorrect.

Such as if I add colon : before the PAT, the REST API will return with 203.

enter image description here

Trenna answered 20/8, 2018 at 11:14 Comment(1)
I get the same problem with my GET/POST requests, but there is no colon before the Personal Access Token, and adding one to the PAT results in a 401 error (instead of a 203 error).Fabriane
S
1

adding on to @numeratus This question took awhile for me to get correctly on powershell. https://www.opentechguides.com/how-to/article/azure/201/devops-rest-powershell.html helped me greatly and a resulting simplified powershell request to azure apis

#enter your token in pat token
$pat = "xxx"

# Create header with PAT
$token = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes(":$($pat)"))
$header = @{authorization = "Basic $token"}

#enter your url in projects url
$projectsUrl = "https://feeds.dev.azure.com/"
$projects = Invoke-RestMethod -Uri $projectsUrl -Method Get -ContentType "application/json" -Headers $header
Scenario answered 14/10, 2022 at 21:4 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.