priya
priya

Reputation: 489

How to get file content of repositories in Azure DevOps

could someone tell a way to get file contents through rest api in azure devops? I tried in this way but it isnt getting proper results.

https://dev.azure.com/org/project/_apis/sourceProviders/Git/filecontents?serviceEndpointId=&repository=&commitOrBranch=main&path=/&api-version=6.0-preview.1

Upvotes: 0

Views: 5621

Answers (2)

Sudhakar Mangipudi
Sudhakar Mangipudi

Reputation: 1

It should be in this format https://dev.azure.com/{organization}/{project}/_apis/sourceProviders/{providerName}/filecontents?api-version=5.0-preview.1

Service endpoint should be TFGit as per the documentation here

Upvotes: 0

priya
priya

Reputation: 489

The URL I have posted above works..I had given wrong input for source provider. It should have been TfsGit.

Upvotes: 2

Related Questions