I am trying to acces some source files. I need to get a list of the files to acces. I would like to use the CodeSearch function of the TFS Rest API. All I get is a page not found error.
I have searched all over the internet for TFS 2017 API documentation, but I always end up here, I can not find any TFS 2017 - specific documentation.
I think its similar problem to what this question was about.
I am successfully retrieving the source code by sending a GET request on to
.eu/Development/_apis/tfvc/items?path=%24%2FProjectName%2FFileName%2FMain%2SubFolder%2FGetRandomArticle.cs
but when I try to send a POST request on to
.eu/Development/_apis/search/codesearchresults?api-version=4.1-preview.1
I get a 401 "Page not found."
This is thetest request body:
{
"searchText": "IEnumerable",
"$skip": 0,
"$top": 1,
}
According to the official docs, the version 4.1-preview1 of the REST API is not present in TFS 2017. Thus, the behavior you're observing might be because the incorrect version of the API is used. Try switching to 3.0 and try again.
If you follow this link, you'll find out how to explore the pre-4.1 REST API.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With