Items - Get Items Batch

Post for retrieving a set of items given a list of paths or a long path. Allows for specifying the recursionLevel and version descriptors for each path.

POST https://dev.azure.com/{organization}/{project}/_apis/tfvc/itembatch?api-version=7.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 '7.1' to use this version of the api.

Request Body

Name Type Description
includeContentMetadata

boolean

If true, include metadata about the file type

includeLinks

boolean

Whether to include the _links field on the shallow references

itemDescriptors

TfvcItemDescriptor[]

Item path and Version descriptor properties

Responses

Name Type Description
200 OK

array[]

successful operation

Media Types: "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.

Examples

Multiple items

Sample request

POST https://dev.azure.com/fabrikam/_apis/tfvc/itembatch?api-version=7.1

{
  "itemDescriptors": [
    {
      "path": "$/Fabrikam-Fiber-TFVC/AuthSample/AuthSample/Program.cs",
      "version": 5,
      "versionType": "changeset"
    },
    {
      "path": "$/Fabrikam-Fiber-TFVC/AuthSample",
      "recursionLevel": "Full"
    }
  ]
}

Sample response

{
  "count": 2,
  "value": [
    [
      {
        "version": 5,
        "changeDate": "2014-03-19T17:23:59.697Z",
        "path": "$/Fabrikam-Fiber-TFVC/AuthSample/AuthSample/Program.cs",
        "url": "https://dev.azure.com/fabrikam/_apis/tfvc/items/%24/Fabrikam-Fiber-TFVC/AuthSample/AuthSample/Program.cs?versionType=Changeset&version=5"
      }
    ],
    [
      {
        "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"
      },
      {
        "version": 9,
        "changeDate": "2014-03-21T19:32:02.213Z",
        "path": "$/Fabrikam-Fiber-TFVC/AuthSample/Code/App.config",
        "url": "https://dev.azure.com/fabrikam/_apis/tfvc/items/%24/Fabrikam-Fiber-TFVC/AuthSample/Code/App.config?versionType=Changeset&version=9"
      },
      {
        "version": 9,
        "changeDate": "2014-03-21T19:32:02.213Z",
        "path": "$/Fabrikam-Fiber-TFVC/AuthSample/Code/AuthSample.cs",
        "url": "https://dev.azure.com/fabrikam/_apis/tfvc/items/%24/Fabrikam-Fiber-TFVC/AuthSample/Code/AuthSample.cs?versionType=Changeset&version=9"
      },
      {
        "version": 9,
        "changeDate": "2014-03-21T19:32:02.213Z",
        "path": "$/Fabrikam-Fiber-TFVC/AuthSample/Code/AuthSample.csproj.vspscc",
        "url": "https://dev.azure.com/fabrikam/_apis/tfvc/items/%24/Fabrikam-Fiber-TFVC/AuthSample/Code/AuthSample.csproj.vspscc?versionType=Changeset&version=9"
      },
      {
        "version": 9,
        "changeDate": "2014-03-21T19:32:02.213Z",
        "path": "$/Fabrikam-Fiber-TFVC/AuthSample/Code/AuthSample.csproj",
        "url": "https://dev.azure.com/fabrikam/_apis/tfvc/items/%24/Fabrikam-Fiber-TFVC/AuthSample/Code/AuthSample.csproj?versionType=Changeset&version=9"
      },
      {
        "version": 9,
        "changeDate": "2014-03-21T19:32:02.213Z",
        "path": "$/Fabrikam-Fiber-TFVC/AuthSample/Code/Properties",
        "isFolder": true,
        "url": "https://dev.azure.com/fabrikam/_apis/tfvc/items/%24/Fabrikam-Fiber-TFVC/AuthSample/Code/Properties?versionType=Changeset&version=9"
      },
      {
        "version": 9,
        "changeDate": "2014-03-21T19:32:02.213Z",
        "path": "$/Fabrikam-Fiber-TFVC/AuthSample/Code/Properties/AssemblyInfo.cs",
        "url": "https://dev.azure.com/fabrikam/_apis/tfvc/items/%24/Fabrikam-Fiber-TFVC/AuthSample/Code/Properties/AssemblyInfo.cs?versionType=Changeset&version=9"
      }
    ]
  ]
}

Definitions

Name Description
TfvcItemDescriptor

Item path and Version descriptor properties

TfvcItemRequestData

Request body used by Get Items Batch

TfvcVersionOption

Defaults to None.

TfvcVersionType

Defaults to Latest.

VersionControlRecursionType

Defaults to OneLevel.

TfvcItemDescriptor

Item path and Version descriptor properties

Name Type Description
path

string

Item path.

recursionLevel

VersionControlRecursionType

Defaults to OneLevel.

version

string

Specify the desired version, can be null or empty string only if VersionType is latest or tip.

versionOption

TfvcVersionOption

Defaults to None.

versionType

TfvcVersionType

Defaults to Latest.

TfvcItemRequestData

Request body used by Get Items Batch

Name Type Description
includeContentMetadata

boolean

If true, include metadata about the file type

includeLinks

boolean

Whether to include the _links field on the shallow references

itemDescriptors

TfvcItemDescriptor[]

Item path and Version descriptor properties

TfvcVersionOption

Defaults to None.

Value Description
none

None.

previous

Return the previous version.

useRename

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

TfvcVersionType

Defaults to Latest.

Value Description
none

Version is treated as a ChangesetId.

changeset

Version is treated as a ChangesetId.

shelveset

Version is treated as a Shelveset name and owner.

change

Version is treated as a Change.

date

Version is treated as a Date.

latest

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

tip

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

mergeSource

Version will be treated as a MergeSource.

VersionControlRecursionType

Defaults to OneLevel.

Value Description
none

Only return the specified item.

oneLevel

Return the specified item and its direct children.

oneLevelPlusNestedEmptyFolders

Return the specified item and its direct children, as well as recursive chains of nested child folders that only contain a single folder.

full

Return specified item and all descendants