Items - List

Get a list of Tfvc items

GET https://dev.azure.com/{organization}/{project}/_apis/tfvc/items?api-version=7.0
GET https://dev.azure.com/{organization}/{project}/_apis/tfvc/items?scopePath={scopePath}&recursionLevel={recursionLevel}&includeLinks={includeLinks}&versionDescriptor.version={versionDescriptor.version}&versionDescriptor.versionOption={versionDescriptor.versionOption}&versionDescriptor.versionType={versionDescriptor.versionType}&api-version=7.0

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 '7.0' to use this version of the api.

includeLinks
query

boolean

True to include links.

recursionLevel
query

VersionControlRecursionType

None (just the item), or OneLevel (contents of a folder).

scopePath
query

string

Version control path of a folder to return multiple items.

versionDescriptor.version
query

string

Version object.

versionDescriptor.versionOption
query

TfvcVersionOption

versionDescriptor.versionType
query

TfvcVersionType

Responses

Name Type Description
200 OK

TfvcItem[]

successful operation

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.

Examples

A folder
A folder and its children
Changeset version

A folder

Sample Request

GET https://dev.azure.com/fabrikam/_apis/tfvc/items?scopePath=$/Fabrikam-Fiber-TFVC/AuthSample&api-version=7.0

Sample Response

{
  "value": [
    {
      "version": 5,
      "isBranch": true,
      "changeDate": "2014-03-19T17:23:59.697Z",
      "path": "$/Fabrikam-Fiber-TFVC/AuthSample",
      "isFolder": true,
      "url": "https://dev.azure.com/fabrikam/_apis/tfvc/items/%24/Fabrikam-Fiber-TFVC/AuthSample?versionType=Changeset&version=5"
    },
    {
      "version": 9,
      "changeDate": "2014-03-21T19:32:02.213Z",
      "path": "$/Fabrikam-Fiber-TFVC/AuthSample/AuthSample.sln",
      "url": "https://dev.azure.com/fabrikam/_apis/tfvc/items/%24/Fabrikam-Fiber-TFVC/AuthSample/AuthSample.sln?versionType=Changeset&version=9"
    },
    {
      "version": 5,
      "changeDate": "2014-03-19T17:23:59.697Z",
      "path": "$/Fabrikam-Fiber-TFVC/AuthSample/AuthSample.vssscc",
      "url": "https://dev.azure.com/fabrikam/_apis/tfvc/items/%24/Fabrikam-Fiber-TFVC/AuthSample/AuthSample.vssscc?versionType=Changeset&version=5"
    },
    {
      "version": 9,
      "changeDate": "2014-03-21T19:32:02.213Z",
      "path": "$/Fabrikam-Fiber-TFVC/AuthSample/Code",
      "isFolder": true,
      "url": "https://dev.azure.com/fabrikam/_apis/tfvc/items/%24/Fabrikam-Fiber-TFVC/AuthSample/Code?versionType=Changeset&version=9"
    }
  ],
  "count": 4
}

A folder and its children

Sample Request

GET https://dev.azure.com/fabrikam/_apis/tfvc/items?scopePath=$/Fabrikam-Fiber-TFVC/AuthSample&recursionLevel=OneLevel&api-version=7.0

Sample Response

{
  "value": [
    {
      "version": 5,
      "isBranch": true,
      "changeDate": "2014-03-19T17:23:59.697Z",
      "path": "$/Fabrikam-Fiber-TFVC/AuthSample",
      "isFolder": true,
      "url": "https://dev.azure.com/fabrikam/_apis/tfvc/items/%24/Fabrikam-Fiber-TFVC/AuthSample?versionType=Changeset&version=5"
    },
    {
      "version": 9,
      "changeDate": "2014-03-21T19:32:02.213Z",
      "path": "$/Fabrikam-Fiber-TFVC/AuthSample/AuthSample.sln",
      "url": "https://dev.azure.com/fabrikam/_apis/tfvc/items/%24/Fabrikam-Fiber-TFVC/AuthSample/AuthSample.sln?versionType=Changeset&version=9"
    },
    {
      "version": 5,
      "changeDate": "2014-03-19T17:23:59.697Z",
      "path": "$/Fabrikam-Fiber-TFVC/AuthSample/AuthSample.vssscc",
      "url": "https://dev.azure.com/fabrikam/_apis/tfvc/items/%24/Fabrikam-Fiber-TFVC/AuthSample/AuthSample.vssscc?versionType=Changeset&version=5"
    },
    {
      "version": 9,
      "changeDate": "2014-03-21T19:32:02.213Z",
      "path": "$/Fabrikam-Fiber-TFVC/AuthSample/Code",
      "isFolder": true,
      "url": "https://dev.azure.com/fabrikam/_apis/tfvc/items/%24/Fabrikam-Fiber-TFVC/AuthSample/Code?versionType=Changeset&version=9"
    }
  ],
  "count": 4
}

Changeset version

Sample Request

GET https://dev.azure.com/fabrikam/_apis/tfvc/items?api-version=7.0

Sample Response

{
  "version": 9,
  "changeDate": "2014-03-21T19:32:02.213Z",
  "path": "$/Fabrikam-Fiber-TFVC/AuthSample/AuthSample.sln",
  "contentMetadata": {
    "encoding": 65001,
    "contentType": "text/plain",
    "fileName": "AuthSample.sln",
    "extension": ".sln"
  },
  "url": "https://dev.azure.com/fabrikam/_apis/tfvc/items/%24/Fabrikam-Fiber-TFVC/AuthSample/AuthSample.sln?versionType=Changeset&version=9&versionOptions=None",
  "_links": {
    "self": {
      "href": "https://dev.azure.com/fabrikam/_apis/tfvc/items/%24/Fabrikam-Fiber-TFVC/AuthSample/AuthSample.sln?versionType=Changeset&version=9"
    }
  }
}

Definitions

Name Description
FileContentMetadata
ReferenceLinks

The class to represent a collection of REST reference links.

TfvcItem

Metadata for an item.

TfvcVersionOption

Defaults to None.

TfvcVersionType

Defaults to Latest.

VersionControlRecursionType

Defaults to OneLevel.

FileContentMetadata

Name Type Description
contentType

string

encoding

integer

extension

string

fileName

string

isBinary

boolean

isImage

boolean

vsLink

string

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

Metadata for an item.

Name Type Description
_links

ReferenceLinks

The class to represent a collection of REST reference links.

changeDate

string

Item changed datetime.

content

string

contentMetadata

FileContentMetadata

deletionId

integer

Greater than 0 if item is deleted.

encoding

integer

File encoding from database, -1 represents binary.

hashValue

string

MD5 hash as a base 64 string, applies to files only.

isBranch

boolean

True if item is a branch.

isFolder

boolean

isPendingChange

boolean

True if there is a change pending.

isSymLink

boolean

path

string

size

integer

The size of the file, if applicable.

url

string

version

integer

Changeset version Id.

TfvcVersionOption

Defaults to None.

Name Type Description
none

string

None.

previous

string

Return the previous version.

useRename

string

Only usuable with versiontype MergeSource and integer versions, uses RenameSource identifier instead of Merge identifier.

TfvcVersionType

Defaults to Latest.

Name Type Description
change

string

Version is treated as a Change.

changeset

string

Version is treated as a ChangesetId.

date

string

Version is treated as a Date.

latest

string

If Version is defined the Latest of that Version will be used, if no version is defined the latest ChangesetId will be used.

mergeSource

string

Version will be treated as a MergeSource.

none

string

Version is treated as a ChangesetId.

shelveset

string

Version is treated as a Shelveset name and owner.

tip

string

Version will be treated as a Tip, if no version is defined latest will be used.

VersionControlRecursionType

Defaults to OneLevel.

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.