Items - Get
Get Item Metadata and/or Content for a single item. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content which is always returned as a download.
GET https://dev.azure.com/{organization}/{project}/_apis/tfvc/items?path={path}&api-version=5.1
GET https://dev.azure.com/{organization}/{project}/_apis/tfvc/items?path={path}&fileName={fileName}&download={download}&scopePath={scopePath}&recursionLevel={recursionLevel}&versionDescriptor.version={versionDescriptor.version}&versionDescriptor.versionType={versionDescriptor.versionType}&versionDescriptor.versionOption={versionDescriptor.versionOption}&includeContent={includeContent}&api-version=5.1
URI Parameters
Name | In | Required | Type | Description |
---|---|---|---|---|
organization
|
path | True |
string |
The name of the Azure DevOps organization. |
project
|
path |
string |
Project ID or project name |
|
api-version
|
query | True |
string |
Version of the API to use. This should be set to '5.1' to use this version of the api. |
path
|
query | True |
string |
Version control path of an individual item to return. |
download
|
query |
boolean |
If true, create a downloadable attachment. |
|
file
|
query |
string |
file name of item returned. |
|
include
|
query |
boolean |
Set to true to include item content when requesting json. Default is false. |
|
recursion
|
query |
None (just the item), or OneLevel (contents of a folder). |
||
scope
|
query |
string |
Version control path of a folder to return multiple items. |
|
version
|
query |
string |
Version descriptor. Default is null. |
|
version
|
query |
Version descriptor. Default is null. |
||
version
|
query |
Version descriptor. Default is null. |
Responses
Name | Type | Description |
---|---|---|
200 OK |
successful operation Media Types: "text/plain", "application/octet-stream", "application/zip", "application/json" |
Security
oauth2
Type:
oauth2
Flow:
accessCode
Authorization URL:
https://app.vssps.visualstudio.com/oauth2/authorize&response_type=Assertion
Token URL:
https://app.vssps.visualstudio.com/oauth2/token?client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer&grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer
Scopes
Name | Description |
---|---|
vso.code | Grants the ability to read source code and metadata about commits, changesets, branches, and other version control artifacts. Also grants the ability to search code and get notified about version control events via service hooks. |
Definitions
Name | Description |
---|---|
File |
|
Reference |
The class to represent a collection of REST reference links. |
Tfvc |
|
Tfvc |
|
Tfvc |
|
Version |
FileContentMetadata
Name | Type | Description |
---|---|---|
contentType |
string |
|
encoding |
integer |
|
extension |
string |
|
fileName |
string |
|
isBinary |
boolean |
|
isImage |
boolean |
|
vsLink |
string |
ReferenceLinks
The class to represent a collection of REST reference links.
Name | Type | Description |
---|---|---|
links |
object |
The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only. |
TfvcItem
Name | Type | Description |
---|---|---|
_links |
The class to represent a collection of REST reference links. |
|
changeDate |
string |
|
content |
string |
|
contentMetadata | ||
deletionId |
integer |
|
encoding |
integer |
File encoding from database, -1 represents binary. |
hashValue |
string |
MD5 hash as a base 64 string, applies to files only. |
isBranch |
boolean |
|
isFolder |
boolean |
|
isPendingChange |
boolean |
|
isSymLink |
boolean |
|
path |
string |
|
size |
integer |
The size of the file, if applicable. |
url |
string |
|
version |
integer |
TfvcVersionOption
Name | Type | Description |
---|---|---|
none |
string |
|
previous |
string |
|
useRename |
string |
TfvcVersionType
Name | Type | Description |
---|---|---|
change |
string |
|
changeset |
string |
|
date |
string |
|
latest |
string |
|
mergeSource |
string |
|
none |
string |
|
shelveset |
string |
|
tip |
string |
VersionControlRecursionType
Name | Type | Description |
---|---|---|
full |
string |
Return specified item and all descendants |
none |
string |
Only return the specified item. |
oneLevel |
string |
Return the specified item and its direct children. |
oneLevelPlusNestedEmptyFolders |
string |
Return the specified item and its direct children, as well as recursive chains of nested child folders that only contain a single folder. |
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for