https://dev.azure.com/{{organization}}/{{project}}/_apis/sourceProviders/{{providerName}}/filecontents
?repository={{repository}}
&path={{path}}
&commitOrBranch={{commitOrBranch}}
&api-version=5.0-preview.1
But where do you look for these variables' values? Your current url should look like this if you go into Azure DevOps, choose Repos > Files from the left navigation, and select a specific file:
https://dev.azure.com/{{organization}}/{{project}}/_git/{{repository}}?path=%2Fpackage.json
For organisation, project, and repository, you should use those values. An HTTP encoded version of the unix file path appears in path. Because / is encoded as percent 2F in HTTP, the path is just /package.
You either know what you want for this value or you should use master, so commit or branch is very self-explanatory. Because the documentation presently leads to this version of the API, I've "hard-coded" it in the above URI.
You'll need providerName as the final variable. TfsGit is, in a nutshell, the best option. This value was obtained by searching the list of source providers for one that has a supportedCapabilities value of true. queryFileContents.